Skip to content

Commit

Permalink
Merge pull request #9563 from dwrik/9557/fix/use-new-searchbox-on-rea…
Browse files Browse the repository at this point in the history
…dling-log-and-author-pages

Use new search box on reading log pages and author page
  • Loading branch information
jimchamp authored Jul 29, 2024
2 parents 4f1cb87 + efff4a6 commit e3c8c5c
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion openlibrary/i18n/messages.pot
Original file line number Diff line number Diff line change
Expand Up @@ -6523,7 +6523,7 @@ msgstr ""

#: type/author/view.html
#, python-format
msgid "Search %(author)s Books"
msgid "Search %(author)s books"
msgstr ""

#: Profile.html type/author/view.html
Expand Down
3 changes: 1 addition & 2 deletions openlibrary/templates/account/reading_log.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@
$if len(docs) > 0:
$if key in readlog_keys:
<form method="GET" class="olform pagesearchbox">
<input type="text" minlength="3" placeholder="$_('Search your reading log')" name="q" value="$(query_param('q', ''))"/>
<input type="submit"/>
$:render_template("search/searchbox", q=query_param('q'), placeholder=_('Search your reading log'))
</form>
$if q:
<span class="search-results-stats">$ungettext('%(count)s hit', '%(count)s hits', doc_count, count=commify(doc_count))</span>
Expand Down
4 changes: 2 additions & 2 deletions openlibrary/templates/search/searchbox.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
$def with (q)
$def with (q, placeholder=_('Search'))
<div class="searchbox">
<input type="text" class="searchbox__input" name="q" size="100" placeholder="$_('Search')" aria-label="$_('Search')" value="$q">
<input type="text" class="searchbox__input" name="q" size="100" placeholder="$placeholder" aria-label="$_('Search')" value="$q">
<div>
<input type="submit" value="" class="searchbox__btn-icon" aria-label="$_('Search')">
</div>
Expand Down
3 changes: 1 addition & 2 deletions openlibrary/templates/type/author/view.html
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,7 @@ <h2 class="collapse">
<input type="hidden" name="sort" value="$query_param('sort')"/>
$if (query_param('mode')):
<input type="hidden" name="mode" value="$query_param('mode')"/>
<input type="text" placeholder="$_('Search %(author)s Books', author=title)" name="q" value="$(query_param('q', ''))"/>
<input type="submit"/>
$:render_template("search/searchbox", q=query_param('q'), placeholder=_('Search %(author)s books', author=title))
</form>

$:macros.Pager(page=safeint(query_param('page'), default=1), num_found=books_count)
Expand Down

0 comments on commit e3c8c5c

Please sign in to comment.