LP1908612 Bootstrap Opac - Limit to Available user/gcollum/lp1908612-Bootstrap-opac-limit-to-available
authorGarry Collum <gcollum@gmail.com>
Mon, 10 May 2021 19:55:59 +0000 (15:55 -0400)
committerGarry Collum <gcollum@gmail.com>
Mon, 10 May 2021 19:55:59 +0000 (15:55 -0400)
Adds the 'Show All Copies' and 'Show Only Available Copies' to the Bootstrap
Opac's copy screen.

Signed-off-by: Garry Collum <gcollum@gmail.com>
Open-ILS/src/templates-bootstrap/opac/parts/record/copy_table.tt2

index dad40fd..74c1af5 100755 (executable)
@@ -12,6 +12,7 @@ IF serial_holdings;
         copies = copies.merge(units);
     END;
 END;
+available=ctx.available;
 
 FOREACH copy_info IN copies;
     IF copy_info.call_number_label != '##URI##';
@@ -67,6 +68,19 @@ IF has_copies or ctx.foreign_copies;
 </form>
 [% END %]
 [% END %]
+
+<div class="mt-3">
+[% IF available == 'true'; %]
+  <a href="[% mkurl('', {available => 'false' }) %]">
+      [% l('Show All Copies') %]
+  </a>
+[% END %]
+[% IF available == 'false'; %]
+  <a href="[% mkurl('', {available => 'true' }) %]">
+      [% l('Show Only Available Copies') %]
+  </a>
+[% END %]
+
 <table class="container-fluid table table-hover mt-4 miniTable copyTable w-100" >
     <thead>
         <tr>