From: Jane Sandberg <sandbej@linnbenton.edu> Date: Sat, 31 Mar 2018 13:48:49 +0000 (-0700) Subject: LP1760160: Search bar has a different CSS class when on the home page X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=ecee476ede872cc671c8fe4887eb6194d6b9ef85;p=evergreen%2Fjoelewis.git LP1760160: Search bar has a different CSS class when on the home page To test: 1. In templates/opac/css/style.css, add some highly noticeable CSS that applies to .searchbar-home or an element within .searchbar-home, e.g. .searchbar-home .search-box { background-color: purple; height: 4em; } 2. Go to the home page of your public catalog. The .searchbar-home .search-box CSS should have taken effect. 3. Go to another page of your public catalog, such as a search results or login page. The CSS should not have taken effect here. Signed-off-by: Jane Sandberg <sandbej@linnbenton.edu> Signed-off-by: Bill Erickson <berickxx@gmail.com> --- diff --git a/Open-ILS/src/templates/opac/home.tt2 b/Open-ILS/src/templates/opac/home.tt2 index 8f120e6e9e..25dd196983 100644 --- a/Open-ILS/src/templates/opac/home.tt2 +++ b/Open-ILS/src/templates/opac/home.tt2 @@ -4,7 +4,7 @@ ctx.metalinks.push('<link rel="canonical" href="' _ mkurl('', {}, 1) _ '" />'); ctx.page_title = l("Home") %] <h2 class="sr-only">[% l('Catalog Home') %]</h2> - [% INCLUDE "opac/parts/searchbar.tt2" %] + [% INCLUDE "opac/parts/searchbar.tt2" is_home_page=1 %] <div id="content-wrapper"> <div id="main-content-home"> <div class="common-full-pad"></div> diff --git a/Open-ILS/src/templates/opac/parts/searchbar.tt2 b/Open-ILS/src/templates/opac/parts/searchbar.tt2 index 4cf34a393a..1b6b7cfe0a 100644 --- a/Open-ILS/src/templates/opac/parts/searchbar.tt2 +++ b/Open-ILS/src/templates/opac/parts/searchbar.tt2 @@ -46,7 +46,7 @@ END; <span class="browse_the_catalog_lbl"><a href="[% mkurl(ctx.opac_root _ '/browse', {}, expert_search_parms.merge(general_search_parms, facet_search_parms, ['fi:has_browse_entry'])) %]">[% l('Browse the Catalog') %]</a></span> [% INCLUDE 'opac/parts/cart.tt2' %] </div> - <div class="searchbar"> + <div class="searchbar [% is_home_page ? 'searchbar-home' : '' %]"> <span class='search_box_wrapper'> [%- # autosuggest breaks accessibility, as the aria-label # attribute is removed when the Dijit is created. :( %] @@ -54,6 +54,7 @@ END; <input type="text" id="search_box" name="query" aria-label="[% l('Enter search query:'); %]" value="[% is_advanced ? ctx.naive_query_scrub(ctx.user_query) : CGI.param('query') | html %]" + class="search-box" [%- IF use_autosuggest.enabled == "t" %] dojoType="openils.widget.AutoSuggest" type_selector="'qtype'" submitter="this.textbox.form.submit();"