Skip to content

Commit 2341e79

Browse files
committed
Persist sort when clicking on carousel
1 parent 4d65986 commit 2341e79

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

openlibrary/macros/RawQueryCarousel.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
fields = ['key', 'title', 'subtitle', 'editions', 'author_name', 'availability', 'cover_i', 'ia', 'id_project_gutenberg', 'id_librivox', 'id_standard_ebooks', 'id_openstax', 'providers']
4848
params = { 'q': query }
4949
# Don't need fields in the search UI url, since they don't do anything there
50-
url = url or "/search?" + urlencode({'q': query})
50+
url = url or "/search?" + urlencode({'q': query, 'sort': sort})
5151
if has_fulltext_only:
5252
params['has_fulltext'] = 'true'
5353

openlibrary/templates/home/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
}
2626
$:render_template("books/custom_carousel", key="trending", books=get_trending_books(books_only=True, since_days=0, since_hours=24, minimum=3, sort_by_count=False), title=_('Trending Books'), url="/trending/daily", test=test, load_more=load_more)
2727

28-
$:macros.QueryCarousel(query="ddc:8* first_publish_year:[* TO 1950] publish_year:[2000 TO *] NOT public_scan_b:false", url="/search?q=ddc%3A8*+first_publish_year%3A%5B*+TO+1950%5D+publish_year%3A%5B2000+TO+*%5D+NOT+public_scan_b%3Afalse&mode=ebooks&has_fulltext=true", title=_('Classic Books'), key="public_domain", sort='random.hourly', use_cache=False, lazy=False, user_lang_only=True)
28+
$:macros.QueryCarousel(query="ddc:8* first_publish_year:[* TO 1950] publish_year:[2000 TO *] NOT public_scan_b:false", title=_('Classic Books'), key="public_domain", sort='random.hourly', use_cache=False, lazy=False, user_lang_only=True)
2929

3030
$:render_template("home/custom_ia_carousel", title=_('Books We Love'), key="staff_picks", subject="openlibrary_staff_picks", sorts=["lending___last_browse desc"], limit=18, test=test, user_lang_only=True)
3131

0 commit comments

Comments
 (0)