diff --git a/openlibrary/templates/work_search.html b/openlibrary/templates/work_search.html index 6cd027f98a0..84649b5ec09 100644 --- a/openlibrary/templates/work_search.html +++ b/openlibrary/templates/work_search.html @@ -14,6 +14,25 @@ return changequery(page=None,**{k:[i for i in param.get(k, []) if i != v]}) else: return changequery(page=None,**{k:None}) + + def search_facet_track(k): + facet_map = ( + ('has_fulltext', 'eBook'), + ('author_key', 'Author'), + ('subject_facet', 'Subjects'), + ('person_facet', 'People'), + ('place_facet', 'Places'), + ('time_facet', 'Times'), + ('first_publish_year', 'First published'), + ('publisher_facet', 'Publisher'), + ('language', 'Language'), + ('public_scan_b', 'Classic eBooks'), + ) + + return f'SearchFacet|facet_map[k]' + + + $ param = {} $for p in ['q', 'title', 'author', 'page', 'sort', 'isbn', 'oclc', 'contributor', 'publish_place', 'lccn', 'ia', 'first_sentence', 'publisher', 'author_key', 'debug', 'subject', 'place', 'person', 'time'] + facet_fields: @@ -229,9 +248,9 @@

$label

$ display = _('yes') $else: $ display = _('no') - $display $commify(count) + $display $commify(count) $else: - $display $commify(count) + $display $commify(count) $if len(counts) > start_facet_count: