- Add checkbox to search results page
authorJake Litrell <jake@masslnc.org>
Mon, 22 Feb 2016 04:16:51 +0000 (23:16 -0500)
committerJake Litrell <jake@masslnc.org>
Mon, 22 Feb 2016 04:16:51 +0000 (23:16 -0500)
- Adding persistence for checkboxes.
- Sentence Case Fix

Open-ILS/src/templates/opac/parts/advanced/search.tt2
Open-ILS/src/templates/opac/parts/config.tt2
Open-ILS/src/templates/opac/results.tt2

index a658cc5..dd08cd2 100644 (file)
                                 </span>
                             </div>
                             <div class="adv_search_available">
-                                <input type='checkbox' name="fi:-search_format" value="electronic" id='opac.result.excludeelec' />
+                                <input type='checkbox' name="fi:-search_format" value="electronic"
+                                [%- CGI.param('fi:-search_format').grep('electronic').size ?
+                                    ' checked="checked"' : '' %]
+                                id='opac.result.excludeelec' />
                                 <label for='opac.result.excludeelec'>
                                     [% l("Exclude Electronic Resources") %]
                                 </label>
index 47df01b..67a82c1 100644 (file)
@@ -1,4 +1,4 @@
-[% 
+[%
 
 ##############################################################################
 # This file contains skin-level configuration settings.
@@ -88,9 +88,9 @@ show_more_details.default = 'false';
 record.summary.jacket_size = 'medium';
 
 ##############################################################################
-# Define the order in which facets are displayed.  Only facets listed here 
-# will be displayed.  To show all facets sorted by name, comment out this 
-# setting.  
+# Define the order in which facets are displayed.  Only facets listed here
+# will be displayed.  To show all facets sorted by name, comment out this
+# setting.
 # facet.display = [] # show no facets
 facet.display = [
     {facet_class => 'author',  facet_order => ['personal', 'corporate']},
@@ -115,8 +115,8 @@ facet.default_display_count = 5;
 #   lib_selector will put the search library box (with limit to available)
 #   pub_year will put the publication year box
 #   sort_selector will put the sort results selector
-# id DOM id used for linking labels to form controls.  They are pinned 
-#   here instead of auto-generated (from the attr type, for example) 
+# id DOM id used for linking labels to form controls.  They are pinned
+#   here instead of auto-generated (from the attr type, for example)
 #   for consistency.
 
 search.adv_config = [
@@ -179,7 +179,7 @@ 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_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');
 
index 97e6eb5..29b2299 100644 (file)
     <h3 class="sr-only">[% l('Additional search filters and navigation') %]</h3>
     <div class="almost-content-wrapper">
 
-        [%# hide the header bar when displaying metarecord constituents 
+        [%# hide the header bar when displaying metarecord constituents
           instead of skipping it altogether to allow the search form
           variables to propagate %]
         [% IF ctx.metarecord;
           mr_attrs = {marc_xml => ctx.metarecord_master.marc_xml};
           PROCESS get_marc_attrs args=mr_attrs %]
           <div class="results_header_lbl">
-            [% l('Viewing Results for Grouped Record: [_1]', 
+            [% l('Viewing Results for Grouped Record: [_1]',
                 mr_attrs.title) | html %]
           </div>
           [% IF CGI.param('query') %]
                         [% END %]
                     </div>
                     [%- END -%]
-
+                    <br class="clear-both" />
                     <label class="results_header_lbl" for="limit_to_available">
                         <input type="checkbox" id="limit_to_available" name="modifier" value="available"
                             onchange="search_modifier_onchange('available', this, true)"
                             [% CGI.param('modifier').grep('available').size ? ' checked="checked"' : '' %] />
-                        [% l('Limit to available items') %]
+                        [% l('Limit to Available Items') %]
                     </label>
                     [% IF NOT metarecords.disabled %]
                         <label class="results_header_lbl" for="metabib_search_modifier">
                     -%]
                         <input type="hidden" name="detail_record_view" value="1" />
                     [% END %]
+
+                    <label class="results_header_lbl" for='opac.result.excludeelec'>
+                        <input type='checkbox' name="fi:-search_format" value="electronic"
+                            [%- CGI.param('fi:-search_format').grep('electronic').size ? ' checked="checked"' : '' %]
+                            id='opac.result.excludeelec' />
+                        [% l("Exclude Electronic Resources") %]
+                    </label>
+
             </div>
         </div>
     </div>
                     (ctx.records.size ? "table.tt2" : "lowhits.tt2");
                 INCLUDE $path %]
             </div>
-            <div class="common-full-pad"></div>    
+            <div class="common-full-pad"></div>
         </div>
         <br class="clear-both" />
     </div>