%inherit file="base.html"/> <%! import lazylibrarian from lazylibrarian.config2 import CONFIG %> <%def name="headerIncludes()">
%for name, link in linked_sources: %if link: ${name} %else: ${name} %endif %endfor %if gb_search_link: GoogleBooks (search) %endif %if author.get('AmazonAuthorURL'): Amazon %elif amazon_search_link: Amazon (search) %endif
%endif %if CONFIG['SHOW_REASON']: %if author['Reason']: <% reasonlist = author['Reason'].split() match reasonlist[0].lower().strip(":"): case 'webserver': # manual search and add of author reasonstring = "Manual search" case 'wishlist': # added via wishlist rss search reasonstring = "Wishlist search " + ' '.join(reasonlist[1:]) case 'process_alternate': # added via import of alt folder reasonstring = f"Import {' '.join(reasonlist[1:])} from alternate folder" case 'ol.find_book': reasonstring = "OpenLibrary search" case 'ol_get_author_books': reasonstring = "OpenLibrary search" case 'gr.find_book': reasonstring = "GoodReads search" case 'gr_get_author_books': reasonstring = "GoodReads search" case 'hc.find_book': reasonstring = "HardCover search" case 'hc_get_author_books': reasonstring = "HardCover search" case 'gb.find_book': reasonstring = "GoogleBooks search" case 'gb_get_author_books': reasonstring = "GoogleBooks search" case 'import_csv': reasonstring = "CSV import" case 'sync_calibre_list': reasonstring = "Calibre Sync" case 'api': #by name, id, and refresh reasonstring = "API" case 'add': reasonstring = f"Import author of {' '.join(reasonlist[3:])}" case 'contributor': reasonstring = ' '.join(reasonlist) case 'series': reasonstring = "Search for series " + ' '.join(reasonlist[1:]) case _: reasonstring = null %> %else: reasonstring = "Book added before reason set" %endif %if reasonstring:Added by: ${reasonstring}
%endif %endif %if author['AuthorDeath']:Born: ${author['AuthorBorn']}, Died: ${author['AuthorDeath']}
%else: %if author['AuthorBorn']:Born: ${author['AuthorBorn']}
%endif %endif %if author['Status'] == 'Loading':%endif
Totalbooks: ${author['TotalBooks']}
<% totalbooks = author['UnignoredBooks'] havebooks = author['HaveBooks'] if not havebooks: havebooks = 0 try: percent = (havebooks*100.0)/totalbooks if percent > 100: percent = 100 if percent <= 100: css = "bg-success" if percent <= 75: css = "bg-info" if percent <= 50: css = "bg-warning" if percent <= 25: css = "bg-danger" except (ZeroDivisionError, TypeError): percent = 0 totalbooks = '0' css = "bg-danger" %>%def> <%def name="javascriptIncludes()"> %def>