Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply search bar template to subjects page #9830

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions openlibrary/i18n/messages.pot
Original file line number Diff line number Diff line change
Expand Up @@ -715,13 +715,6 @@ msgstr[1] ""
msgid "Search for books with subject %(name)s."
msgstr ""

#: authors/index.html lib/nav_head.html lists/home.html publishers/index.html
#: publishers/notfound.html publishers/view.html search/advancedsearch.html
#: search/publishers.html search/searchbox.html subjects.html
#: subjects/notfound.html type/local_id/view.html
msgid "Search"
msgstr ""

#: support.html
msgid "How can we help?"
msgstr ""
Expand Down Expand Up @@ -2920,6 +2913,12 @@ msgstr ""
msgid "Search for an Author"
msgstr ""

#: authors/index.html lib/nav_head.html lists/home.html publishers/index.html
#: publishers/notfound.html publishers/view.html search/advancedsearch.html
#: search/publishers.html search/searchbox.html type/local_id/view.html
msgid "Search"
msgstr ""

#: authors/index.html search/authors.html
#, python-format
msgid "about %(subjects)s"
Expand Down
8 changes: 3 additions & 5 deletions openlibrary/templates/subjects.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

$ can_add_tag = ctx.user and (ctx.user.is_super_librarian())
$ has_tag = 'tag' in page

$ q = query_param('q')

<div id="scrollHere"></div>

Expand Down Expand Up @@ -42,10 +42,8 @@ <h3 itemprop="description">
<a href="#search" class="shift">$_("Search for books with subject %(name)s.", name=page.name)</a>

<form action="/search" class="olform pagesearchbox">
<input type="hidden" name="${page.subject_type}_facet" value="$page.name" />
<label for="searchSubjects" class="shift">$_("Search for books with subject %(name)s.", name=page.name)</label>
<input type="text" name="q" aria-label="Search" id="searchSubjects" size="100" class="larger" value="" />
<button type="submit" class="larger">$_("Search")</button>
$:render_template("search/searchbox", q=q)
<input type="hidden" name="${page.subject_type}_facet" value="$page.name"/>
</form>
</div>

Expand Down
4 changes: 2 additions & 2 deletions openlibrary/templates/subjects/notfound.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@


$ name = key.split("/")[-1].replace('_', ' ')
$ q = query_param('q')

<div class="page-heading-search-box">
<span class="tools"><a href="/subjects" class="plain">$_("Subjects")</a> /</span>
Expand All @@ -11,8 +12,7 @@ <h1>$name</h1>
<h3 class="collapse">$_("Try something else?")</h3>

<form action="/search/subjects" class="olform">
<input type="text" name="q" aria-label="Search" size="100" class="larger" value=""/>
<button type="submit" class="larger">$_("Search")</button>
$:render_template("search/searchbox", q=q)
</form>

</div>
1 change: 1 addition & 0 deletions static/css/page-subject.less
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@
@import (less) "components/listLists.less";
@import (less) "components/footer.less";
@import (less) "components/language.less";
@import (less) "components/searchbox.less";
Loading