Skip to content

Commit

Permalink
Merge pull request #8491 from sbwhitt/feat/list-dropper
Browse files Browse the repository at this point in the history
Add Want to Read dropper to lists
  • Loading branch information
jimchamp committed Nov 28, 2023
2 parents 8c3d300 + f86bf82 commit c32d626
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
5 changes: 2 additions & 3 deletions openlibrary/templates/my_books/dropper.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
$def with(page, edition_key=None, async_load=False)

$if not edition_key:
$ edition = page if page.key.startswith("/books/") else None
$ edition_key = edition and edition.key
$ edition = page if page.key.startswith("/books/") else None
$ edition_key = edition and edition.key

$ work = page if page.key.startswith('/works/') else page.works[0] if edition and page.works else None
$ work_key = work and work.key
Expand Down
3 changes: 2 additions & 1 deletion openlibrary/templates/type/list/view_body.html
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,9 @@ <h1>$list.name</h1>
$ cover_url = default_image

$if seed.type in ['edition', 'work']:
$ use_my_books_droppers = 'my_books_dropper' in ctx.features
$ doc = solr_works.get(seed.key) or seed.document
$:macros.SearchResultsWork(doc, attrs=seed_attrs(seed), availability=availabilities.get(seed.key), decorations=remove_item_link(), extra=seed_meta_line(seed))
$:macros.SearchResultsWork(doc, attrs=seed_attrs(seed), availability=availabilities.get(seed.key), decorations=remove_item_link(), extra=seed_meta_line(seed), include_dropper=use_my_books_droppers)
$else:
<li class="searchResultItem" $:seed_attrs(seed)>
<span class="bookcover">
Expand Down

0 comments on commit c32d626

Please sign in to comment.