LP#1487527: Add config.tt2 options and a basic search button
authorThomas Berezansky <tsbere@mvlc.org>
Thu, 29 Oct 2015 16:08:48 +0000 (12:08 -0400)
committerBen Shum <bshum@biblio.org>
Thu, 5 Nov 2015 18:41:16 +0000 (13:41 -0500)
Also adding an optional results page hint

Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Signed-off-by: Ben Shum <bshum@biblio.org>
Open-ILS/src/templates/opac/css/style.css.tt2
Open-ILS/src/templates/opac/parts/config.tt2
Open-ILS/src/templates/opac/parts/searchbar.tt2
Open-ILS/src/templates/opac/results.tt2

index ff8c6ad..f91b504 100644 (file)
@@ -2114,3 +2114,8 @@ label[for*=expert_]
     font-weight: lighter;
     font-size: 70%;
 }
+
+#results-page-depth-hint {
+    text-align: center;
+    font-style: italic;
+}
index 9ce90a2..47df01b 100644 (file)
@@ -170,6 +170,18 @@ ctx.google_books_preview = 0;
 #
 # ctx.maintenance_message = "The system will not be available February 29, 2104.";
 
+##############################################################################
+# Depth Button/Checkbox
+# Recommendation: Do not enable button for basic search without enabling the
+# checkbox for the results page
+ctx.depth_sel_checkbox = 1; # Results Page Checkbox Toggle
+ctx.depth_sel_button = 1; # Basic Search Submit Button
+ctx.depth_sel_depth = 0; # Depth to set to
+ctx.depth_sel_button_label = l('All Libraries');
+ctx.depth_sel_button_class = 'opac-button';
+ctx.depth_sel_checkbox_label = l('Show results from all libraries');
+ctx.depth_sel_tooltip = l('Select this option to expand your results to all libraries while retaining the priority of your selected library\'s holdings.');
+ctx.depth_sel_resultshint = l('Showing results from all libraries');
 
 ##############################################################################
 # Metarecords configuration
index c2d2710..ac13ce0 100644 (file)
         <input id="detail" type="hidden" name="detail_record_view" value="1"/>
     [%- END %]
         <input id='search-submit-go' type="submit" value="[% l('Search') %]" class="opac-button"
-            onclick='setTimeout(function(){$("search-submit-spinner").className=""; $("search-submit-go").className="hidden"}, 2000)'/>
+            onclick='setTimeout(function(){$("search-submit-spinner").className=""; $("search-submit-go").className="hidden";[% IF ctx.depth_sel_button AND NOT took_care_of_form %] $("search-submit-go-depth").className="hidden";[% END %]}, 2000)'/>
+        [%- IF ctx.depth_sel_button AND NOT took_care_of_form %]
+        <button id='search-submit-go-depth' type="submit" value="[% ctx.depth_sel_depth %]" name="depth" class="[% ctx.depth_sel_button_class %]"
+            onclick='setTimeout(function(){$("search-submit-spinner").className=""; $("search-submit-go").className="hidden"; $("search-submit-go-depth").className="hidden";}, 2000)' title="[% ctx.depth_sel_tooltip | html %]">[% ctx.depth_sel_button_label | html %]</button>
+        [%- END %]
         <img id='search-submit-spinner' src='/opac/images/progressbar_green.gif' style='height:16px;width:16px;' class='hidden' alt='[% l("Search In Progress") %]'/>
     </span>
     </div>
index d49c525..97e6eb5 100644 (file)
                             [% l('Group Formats and Editions') %]
                         </label>
                     [% END %]
-                    [% IF loc_value != 1 %]
-                    <label class="results_header_lbl" for="depth_zero" title="[% l('Select this option to expand your results to all Org Units while retaining the priority of your selected library\'s holdings.') %]">
-                        <input type="checkbox" id="depth_zero" name="depth" value="0"
+                    [% IF ctx.depth_sel_checkbox %]
+                    <label class="results_header_lbl" for="depth_sel" title="[% ctx.depth_sel_tooltip | html %]">
+                        <input type="checkbox" id="depth_sel" name="depth" value="[% ctx.depth_sel_depth %]"
                             onchange="this.form.submit()"
-                            [% CGI.param('depth') == '0' ? ' checked="checked"' : '' %] />
-                        [% l('Show results from all Org Units') %]
+                            [% CGI.param('depth') == ctx.depth_sel_depth ? ' checked="checked"' : '' %] />
+                        [% ctx.depth_sel_checkbox_label | html %]
                     </label>
                     [% END %]
                     [%- IF CGI.param('detail_record_view')
     <div id="content-wrapper">
         <div id="main-content">
             <div id="results-page">
+                [%- IF (ctx.depth_sel_checkbox OR ctx.depth_sel_button) AND CGI.param('depth') == ctx.depth_sel_depth AND ctx.depth_sel_resultshint %]
+                <div id="results-page-depth-hint">[% ctx.depth_sel_resultshint | html %]</div>
+                [%- END %]
                 [% path = "opac/parts/result/" _
                     (ctx.records.size ? "table.tt2" : "lowhits.tt2");
                 INCLUDE $path %]