TPac: move hold status chunk to separate template
authorBill Erickson <berick@esilibrary.com>
Fri, 9 Sep 2011 20:00:51 +0000 (16:00 -0400)
committerBill Erickson <berick@esilibrary.com>
Sun, 11 Sep 2011 22:32:58 +0000 (18:32 -0400)
...for easier local overrideing of text that dislays for hold status

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Open-ILS/src/templates/opac/myopac/holds.tt2
Open-ILS/src/templates/opac/myopac/holds/edit.tt2
Open-ILS/src/templates/opac/parts/hold_status.tt2 [new file with mode: 0644]
Open-ILS/src/templates/opac/parts/misc_util.tt2

index 4690f67..b6bb84c 100644 (file)
@@ -1,5 +1,6 @@
 [%  PROCESS "opac/parts/header.tt2";
     PROCESS "opac/parts/misc_util.tt2";
+    PROCESS "opac/parts/hold_status.tt2";
     WRAPPER "opac/parts/myopac/base.tt2";
     myopac_page = "holds"  %]
 <div id='myopac_holds_div'>
index f0b1e52..711a6c3 100644 (file)
@@ -1,5 +1,6 @@
 [%  PROCESS "opac/parts/header.tt2";
     PROCESS "opac/parts/misc_util.tt2";
+    PROCESS "opac/parts/hold_status.tt2";
     PROCESS "opac/parts/org_selector.tt2";
     WRAPPER "opac/parts/base.tt2" + "opac/parts/myopac/base.tt2";
     myopac_page = "holds"; # in this case, just for tab coloring.
diff --git a/Open-ILS/src/templates/opac/parts/hold_status.tt2 b/Open-ILS/src/templates/opac/parts/hold_status.tt2
new file mode 100644 (file)
index 0000000..a15ec5f
--- /dev/null
@@ -0,0 +1,28 @@
+[% BLOCK get_hold_status %]
+    <div>
+    [% 
+        IF hold.hold.status == 4;
+            l("Available");
+            IF ahr.shelf_expire_time;
+                l('<br/>Expires [_1]', 
+                    date.format(ctx.parse_datetime(ahr.shelf_expire_time), DATE_FORMAT));
+            END;
+
+        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);
+
+        ELSIF hold.hold.status == 3;
+            l("In Transit");
+
+        ELSIF hold.hold.status < 3;
+            l("Waiting for copy");
+        END 
+    %]
+    <div>
+    <div>
+        [% l('[_1] hold on [quant,_2,circulating copy,circulating copies]', 
+            hold.hold.queue_position, hold.hold.potential_copies) %]
+    </div>
+[% END %]
index f1ded0e..713a0be 100644 (file)
             END;
         END;
     END;
-
-    BLOCK get_hold_status;
-        IF hold.hold.status == 4;
-            l("Available");
-            IF ahr.shelf_expire_time;
-                l('<br/>Expires [_1]', 
-                    date.format(ctx.parse_datetime(ahr.shelf_expire_time), DATE_FORMAT));
-            END;
-        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);
-        ELSIF hold.hold.status == 3;
-            l("In Transit");
-        ELSIF hold.hold.status < 3;
-            l("Waiting for copy");
-        END %]
-        <div>
-            [% l('[_1] hold on [quant,_2,circulating copy,circulating copies]',
-                    hold.hold.queue_position, hold.hold.potential_copies) %]
-        </div>
-    [% END
 %]