LP#1612274: Add distinct classes for hold statuses
authorKathy Lussier <klussier@masslnc.org>
Thu, 11 Aug 2016 17:24:00 +0000 (13:24 -0400)
committerMike Rylander <mrylander@gmail.com>
Wed, 24 Aug 2016 14:23:22 +0000 (10:23 -0400)
With more data in the My Account hold status field, libraries may want to
style some statuses or dates differently so that they pop out to the user. Each
hold status and date now has its own class for more flexible styling.

The available status also now has a green, bold font and the suspended status
has a red, bold font.

Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Open-ILS/src/templates/opac/css/style.css.tt2
Open-ILS/src/templates/opac/parts/hold_status.tt2

index 7f2c933..443e87e 100644 (file)
@@ -832,6 +832,16 @@ div.result_table_utils_cont {
     
 }
 
+.myopac-hold-available {
+    color: [% css_colors.text_greatnews %];
+    font-weight: bold;
+}
+
+.myopac-hold-suspended {
+    color: [% css_colors.text_badnews %];
+    font-weight: bold;
+}
+
 #myopac_prefs_div .data_grid {
     border-collapse:collapse;
 }
index 183ead6..fe5f271 100644 (file)
@@ -1,50 +1,62 @@
 [% BLOCK get_hold_status %]
     <div>
-    [%
-        IF hold.hold.status == 4;
-            l("Available") | html;
-            IF ahr.shelf_expire_time;
-                '<br/>';
-                l('Expires [_1]',
-                    date.format(ctx.parse_datetime(ahr.shelf_expire_time), DATE_FORMAT)) | html;
-            END;
-
-        ELSIF hold.hold.status == 6;
-               l("Canceled [_1]",
-                  date.format(ctx.parse_datetime(ahr.cancel_time), DATE_FORMAT)) | html;
-
-        ELSIF hold.hold.status == 7;
-               l("Suspended") | html;
-               IF ahr.thaw_date;
-                   "<br/>";
-                   l("Activate On [_1]",
-                       date.format(ctx.parse_datetime(ahr.thaw_date), DATE_FORMAT)) | html;
-               END;
-
-        ELSIF hold.hold.status == 9;
-               l("Fulfilled [_1]",
-                  date.format(ctx.parse_datetime(ahr.fulfillment_time), DATE_FORMAT))| html;
-
-        ELSIF hold.hold.estimated_wait AND hold.hold.estimated_wait > 0;
+    [% IF hold.hold.status == 4 %]
+            <span class="myopac-hold-available">[% l("Available") %] </span>
+              [% IF ahr.shelf_expire_time %]
+                <br/>
+                [% l("Expires") %]
+                 <span class="myopac-shelf-expire">
+                     [% date.format(ctx.parse_datetime(ahr.shelf_expire_time), DATE_FORMAT) %]
+                 </span>
+              [% END %]
+
+
+     [% ELSIF hold.hold.status == 6 %]
+               <span class="myopac-hold-canceled"> [% l("Canceled") %] </span>
+                  <span class="myopac-cancel-time">
+                      [% date.format(ctx.parse_datetime(ahr.cancel_time), DATE_FORMAT) %]
+                  </span>
+
+     [%  ELSIF hold.hold.status == 7 %]
+               <span class="myopac-hold-suspended"> [% l("Suspended") %] </span>
+                 [% IF ahr.thaw_date %]
+                   <br/>
+                   [% l("Activate On") %]
+                      <span class="my-account-activate-time">
+                        [% date.format(ctx.parse_datetime(ahr.thaw_date), DATE_FORMAT) %]
+                      </span>
+                 [% END %]
+
+     [% ELSIF hold.hold.status == 9 %]
+               <span class="myopac-hold-fulfilled">[% l("Fulfilled") %]</span>
+                  <span class="myopac-fulfill-time">
+                     [% date.format(ctx.parse_datetime(ahr.fulfillment_time), DATE_FORMAT) %]
+                  </span>
+
+
+     [% ELSIF hold.hold.estimated_wait AND hold.hold.estimated_wait > 0;
             # estimated wait is delivered as seconds.
-            SET hwait = POSIX.ceil(hold.hold.estimated_wait / 86400);
-            l("Estimated wait: [quant,_1,day,days]", hwait) | html;
+            SET hwait = POSIX.ceil(hold.hold.estimated_wait / 86400) %]
+              <span class="myopac-hold-wait"> [% l("Estimated wait:") %] </span>
+                <span class="myopac-hold-wait-time">
+                  [% l("[quant,_1,day,days]", hwait) | html %]
+                </span>
 
-        ELSIF hold.hold.status == 3 OR hold.hold.status == 8;
-            l("In Transit") | html;
+     [% ELSIF hold.hold.status == 3 OR hold.hold.status == 8 %]
+            <span class="myopac-transit"> [% l("In Transit") %] </span>
 
-        ELSIF hold.hold.status < 3;
-            l("Waiting for copy") | html;
-        END
-    %]
+     [% ELSIF hold.hold.status < 3 %]
+            <span class="myopac-uncaptured-hold"> [% l("Waiting for copy") %] </span>
+     [% END %]
     </div>
     <div>
         [% # Only show the count for holds that have not been captured
-           IF hold.hold.status < 3 OR hold.hold.status == 7;
-             l('Hold #[_1] on [quant,_2, copy, copies]',
-              hold.hold.queue_position, hold.hold.potential_copies) | html;
-          END
-        %]
+           IF hold.hold.status < 3 OR hold.hold.status == 7 %]
+             <span class="myopac-hold-count">
+                [% l('Hold #[_1] on [quant,_2, copy, copies]',
+                   hold.hold.queue_position, hold.hold.potential_copies) | html %]
+             </span>
+         [% END %]
     </div>
 [% END %]