LP1920042 Bootstrap Opac: Simple Selector in Advanced Search
authorGarry Collum <gcollum@gmail.com>
Thu, 18 Mar 2021 17:49:32 +0000 (13:49 -0400)
committerGalen Charlton <gmc@equinoxOLI.org>
Wed, 26 May 2021 18:45:43 +0000 (14:45 -0400)
Fixes the simple selector in advanced search.

To Test:
1. Go to Administration - Server Administration - MARC Coded Value Maps
2. Assign the 'Is Simple Selector' option to some record attributes.
  In concerto:
     Lang - French, German
     Type - Musical Sound Recording
  Are good choices to test searching.
3. Notice in advanced search that these options no longer appear in the
   Language or Item Type search filters.
4. Apply the patch.
5. The simple selector options should now appear at the top of each search
   filter category.
6. Perform some searches using the simple selector options.

Signed-off-by: Garry Collum <gcollum@gmail.com>
Signed-off-by: Elaine Hardy <ehardy@georgialibraries.org>
Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>

Open-ILS/src/templates-bootstrap/opac/parts/check_value_selector.tt2

index e10ce97..06512ba 100644 (file)
@@ -33,9 +33,26 @@ FOR o IN all_values;
     END;
 END;%]
 
+[%IF simple_sorter.size %]
+<ul class="adv_filters">
+[% FOR o IN simple_sorter.sort('value') %]
+<li>
+<div class="form-check">
+    <label class="form-check-label">
+      <input type="checkbox" class="form-check-input"  name='[% name %]' value='[% o.code | html | replace("'","&#39;") %]'[% values.grep('^' _ o.code _ '$').size ? ' checked' : '' %]>
+      [% o.value | html %]
+    </label>
+  </div>
+  </li>
+[%  END -%]
+</ul>
+[% END; %]
+
 [%IF simple_sorter.size && sorter.size %]
     <p disabled='true'>-----</p>
 [%  END; %]
+
+[%IF sorter.size %]
 <ul class="adv_filters">
 [% FOR o IN sorter.sort('value') %]
 <li>
@@ -48,6 +65,6 @@ END;%]
   </li>
 [%  END -%]
 </ul>
+[% END; %]
 
-
-</div>
\ No newline at end of file
+</div>