OPAC: Show Age Protection Alert
authorTerran McCanna <tmccanna@georgialibraries.org>
Mon, 23 Nov 2020 17:55:55 +0000 (12:55 -0500)
committerChris Sharp <csharp@georgialibraries.org>
Wed, 25 Nov 2020 17:52:18 +0000 (12:52 -0500)
In Bootstrap OPAC, add a star with help popup next to items that are
marked for age protection and are newer than 6 months.

Signed-off-by: Terran McCanna <tmccanna@georgialibraries.org>
Open-ILS/src/templates-bootstrap/opac/parts/record/copy_table.tt2

index a358736..f68c00a 100755 (executable)
@@ -53,7 +53,9 @@ IF has_copies or ctx.foreign_copies;
             [%- IF ctx.is_staff OR serial_holdings %]
             <th scope='col' style="vertical-align:top;">[% l("Holdable?") %]</th>
             [%- END %]
-            <th scope='col' style="vertical-align:top;">[% l("Status") %]</th>
+            <th scope='col'>[% l("Status") %]</th>
+            <th scope='col'>[% l("Due Date") %]</th>
+            <th scope='col' style="vertical-align:top;">&nbsp;</th>
         </tr>
     </thead>
     <tbody>
@@ -214,7 +216,18 @@ END; # FOREACH bib
                 schema_copy_status.${copy_info.status_code};
                 copy_info.copy_status | html;
             -%]</td>
-
+            <td>[%
+                IF copy_info.due_date;
+                    date.format(
+                        ctx.parse_datetime(copy_info.due_date, copy_info.circ_circ_lib),
+                        DATE_FORMAT
+                    );
+                ELSE;
+                    '-';
+                END %]</td>
+        <!-- PINES customization: Show alert if item is new -->
+        <td>[% IF copy_info.age_protect && copy_info.create_date < (date.now - 15552000); '<a href="#" title="" data-toggle="tooltip" data-original-title="This is a new item and may only be checked out locally."><i class="fas fa-star" style="color:orange;" aria-hidden="true"></i></a>'; END; %] 
+        </td>
         </tr>
 
         [% IF copy_info.notes; %]