Tpac; style due-date red/error for overdue items
authorBill Erickson <berick@esilibrary.com>
Thu, 27 Oct 2011 19:10:23 +0000 (15:10 -0400)
committerLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Fri, 28 Oct 2011 14:28:05 +0000 (10:28 -0400)
In the patrons items out list, if an item is overdue, style the due date as
"error" (i.e. bold red).

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Open-ILS/src/templates/opac/myopac/circs.tt2

index c6312e3..c0f5770 100644 (file)
                         <td width="8%" name="renewals" align="center">
                             [% circ.circ.renewal_remaining %]
                         </td>
-                        <td width="13%" style="padding-left:5px;"
-                            name="due_date">
-                            [% date.format(ctx.parse_datetime(circ.circ.due_date),DATE_FORMAT) %]
+                        [%
+                            due_date = ctx.parse_datetime(circ.circ.due_date);
+                            due_class = (date.now > date.format(due_date, '%s')) ? 'error' : '';
+                        %]
+                        <td width="13%" style="padding-left:5px;" name="due_date" class='[% due_class %]'>
+                            [% date.format(due_date, DATE_FORMAT) %]
                         </td>
                         <td width="16%" name="barcode">
                             [% circ.circ.target_copy.barcode | html %]