LP1760160: Search bar has a different CSS class when on the home page
authorJane Sandberg <sandbej@linnbenton.edu>
Sat, 31 Mar 2018 13:48:49 +0000 (06:48 -0700)
committerBill Erickson <berickxx@gmail.com>
Thu, 23 Aug 2018 19:25:14 +0000 (15:25 -0400)
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>

Open-ILS/src/templates/opac/home.tt2
Open-ILS/src/templates/opac/parts/searchbar.tt2

index 8f120e6..25dd196 100644 (file)
@@ -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>
index 4cf34a3..1b6b7cf 100644 (file)
@@ -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();"