beanstalk : record details; copy table; more css
authorBill Erickson <berick@esilibrary.com>
Wed, 4 Apr 2012 15:48:02 +0000 (11:48 -0400)
committerBill Erickson <berick@esilibrary.com>
Wed, 4 Apr 2012 15:48:02 +0000 (11:48 -0400)
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Open-ILS/src/templates/beanstalk/base.tt2
Open-ILS/src/templates/beanstalk/copy_table.tt2 [new file with mode: 0644]
Open-ILS/src/templates/beanstalk/paginate.tt2
Open-ILS/src/templates/beanstalk/record.tt2
Open-ILS/src/templates/beanstalk/results.tt2
Open-ILS/web/images/left_arrow.png [new file with mode: 0644]
Open-ILS/web/images/right_arrow.png [new file with mode: 0644]

index 56cbf75..354de21 100644 (file)
         <title>[% l('Catalog - [_1]', ctx.page_title) %]</title>
         <meta name="viewport" content="format-detection=no,initial-scale=1.0,maximum-scale=1.0,user-scalable=0,width=device-width" />
         <style type='text/css'>
+            body { color: #4D4D4D; }
+            body  a, a:visited { color: #4D4D4D;}
             h1 { font-size: 140%; }
             h2 { font-size: 110%; }
             .hidden { visibility: hidden }
-            .results_paginate { margin: 8px }
+            .results_paginate { margin: 8px; width: 100%; text-align: center; }
             .results_paginate_summary { margin-bottom: 10px; }
-            .results_paginate_links { margin-bottom: 10px; padding-bottom: 10px; border-bottom: 2px dashed #333;}
+            .results_paginate_links { margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px dashed #333;}
             .results_table { width: 100%; border-collapse: collapse;}
             .results_table td { padding-bottom: 10px; vertical-align: bottom}
-            .results_table tr:nth-child(odd) { background: #F8F5D8;  color: #4D4D4D; border-bottom:1px solid #4D4D4D;}
-            .results_table a, a:visited { color: #4D4D4D;}
-            .results_pictd { width:55px }
+            .results_table tr:nth-child(odd) { background: #F8F5D8; border-bottom:1px solid #4D4D4D;}
+            .results_pictd { width: 55px }
+            .pageno_link { font-size: 120%; padding: 0px 5px 0px 5px;}
         </style>
     </head>
-    <body>
-        [% content %] 
-    </body>
+    <body>[% content %]</body>
 </html>
diff --git a/Open-ILS/src/templates/beanstalk/copy_table.tt2 b/Open-ILS/src/templates/beanstalk/copy_table.tt2
new file mode 100644 (file)
index 0000000..811ae8f
--- /dev/null
@@ -0,0 +1,74 @@
+[%-
+
+# If being used in serial mode, flatten list of units so that they can be
+# used like one long list of copies without changing so much code below.
+IF serial_holdings;
+    copies = [];
+    FOREACH h IN serial_holdings;
+        units = h.units.slice(0); # copy
+        FOREACH unit IN units;
+            unit.holding_label = h.label;
+        END;
+        copies = copies.merge(units);
+    END;
+END;
+
+FOREACH copy_info IN copies;
+    IF copy_info.call_number_label != '##URI##';
+        has_copies = 'true';
+    END;
+    IF copy_info.part_label != '';
+        has_parts = 'true';
+    END;
+    IF has_parts && has_copies;
+        LAST;
+    END;
+END;
+-%]
+
+[%- IF has_copies; %]
+    [%- last_cn = 0;
+    FOR copy_info IN copies;
+        callnum = copy_info.call_number_label;
+        NEXT IF callnum == '##URI##';
+
+        callnum_prefix = copy_info.call_number_prefix_label;
+        IF callnum_prefix != "";
+            callnum = callnum_prefix _ " " _ callnum;
+        END;
+
+        callnum_suffix = copy_info.call_number_suffix_label;
+        IF callnum_suffix != "";
+            callnum = callnum  _ " " _ callnum_suffix;
+        END;
+    -%]
+    <div> 
+        <div>[% callnum | html %]</div>
+        <ul>
+            <li>[% l('Location: [_1]', ctx.get_aou(copy_info.circ_lib).name) | html %]</li>
+            <li>[% l('Shelf: [_1]', copy_info.copy_location) | html %]</li>
+            <li>[% l('Barcode: [_1]', copy_info.barcode) | html %]</li>
+            <li>[% l('Status: [_1]', copy_info.copy_status) | html %]</li>
+            [% IF copy_info.due_date %]
+            <li>[% l('Due Date: [_1]', date.format(ctx.parse_datetime(copy_info.due_date), DATE_FORMAT)) %]</li>
+            [% END %]
+        </ul>
+    </div>
+[% END %]
+    <div>        
+        [%- IF ctx.copy_offset > 0 AND NOT serial_holdings;
+            new_offset = ctx.copy_offset - ctx.copy_limit;
+            IF new_offset < 0; new_offset = 0; END %]
+            <span>
+                <a href="[% mkurl('', {copy_offset => new_offset, copy_limit => ctx.copy_limit}) %]">&laquo; [%
+                    l('Previous [_1]', ctx.copy_offset - new_offset) %]</a>
+            </span>
+        [%- END %]
+        [%- IF copies.size >= ctx.copy_limit AND NOT serial_holdings %]
+            <span>
+                <a href="[% mkurl('', {copy_offset => ctx.copy_offset + ctx.copy_limit, copy_limit => ctx.copy_limit}) %]">[%
+                    l('Next [_1]', ctx.copy_limit) %] &raquo;</a>
+            </span>
+        [%- END %]
+
+[% END %]
index 062c2ca..a80cb39 100644 (file)
@@ -10,6 +10,7 @@
 %]
 
 <div class='results_paginate'>
+    [% IF paginate_show_summary %]
     <div class='results_paginate_summary'>
         [% |l(ctx.result_start, ctx.result_stop, ctx.hit_count) %]
         Results <strong>[_1]</strong> - <strong>[_2]</strong> of <strong>[_3]</strong>
@@ -18,9 +19,9 @@
             [% |l(page + 1, page_count) %](page <strong>[_1]</strong> of <strong>[_2]</strong>)[% END %]
         </span>
     </div>
+    [% END %]
     <div class='results_paginate_links'>
         <span>
-
             [%  class = '';
                 href = '#';
                 IF page > 0;
@@ -28,7 +29,7 @@
                 ELSE; class = class _ 'invisible'; END;
             %]
             <a class='[% class %]' href='[% href %]' 
-                title='[% l("Previous page") %]'><span>&lt;--</span> [% l('Previous') %] </a>
+                title='[% l("Previous page") %]'><img src="[% ctx.media_prefix %]/images/left_arrow.png"/></a>
 
             <span style='padding-left: 11px; padding-right:11px;'>
                 [%  # show links to 4 previous pages, the current page, and 3 more pages.
@@ -38,9 +39,9 @@
                         WHILE (pageitr = pageitr + 1) < page_count;
                             IF pageitr < 0; NEXT; END;
                             IF pageitr == page; %]
-                                <span>[% pageitr + 1%]</span>
+                                <span class='pageno_link'>[% pageitr + 1%]</span>
                             [% ELSE %]
-                                <a href="[% mkurl('', {page => pageitr}) %]">[% pageitr + 1%]</a>
+                                <a class='pageno_link' href="[% mkurl('', {page => pageitr}) %]">[% pageitr + 1%]</a>
                         [%  END;
                             added = added + 1;
                             IF added == 8; LAST; END;
@@ -56,7 +57,7 @@
                 ELSE; class = class _ ' invisible'; END;
             %]
             <a class='[% class %]' href='[% href %]' 
-                title='[% l("Next page") %]'> [% l('Next') %] <span>--&gt;</span></a>
+                title='[% l("Next page") %]'><img src="[% ctx.media_prefix %]/images/right_arrow.png"/></a>
         </span>
     </div>
 </div>
index d7bbf96..e42882f 100644 (file)
     [%- END %]
 </ul>
 
+<hr/>
+[% l('Copies') %]
+<hr/>
+
+[%- INCLUDE "beanstalk/copy_table.tt2" copies=ctx.copies %]
 
 [% END %]
index 54d9d1e..0274c85 100644 (file)
@@ -5,7 +5,7 @@
     ctx.page_title = l("Search Results: ") _ CGI.param('query') | html;
 %]
 
-[% PROCESS results_paginate %]
+[% PROCESS results_paginate paginate_show_summary=1 %]
 
 <table class='results_table'>
     [%  FOR rec IN ctx.records;
@@ -43,6 +43,6 @@
 
 </table>
 
-[% PROCESS results_paginate %]
+[% PROCESS results_paginate paginate_show_summary=0 %]
 
 [% END %]
diff --git a/Open-ILS/web/images/left_arrow.png b/Open-ILS/web/images/left_arrow.png
new file mode 100644 (file)
index 0000000..5d9b920
Binary files /dev/null and b/Open-ILS/web/images/left_arrow.png differ
diff --git a/Open-ILS/web/images/right_arrow.png b/Open-ILS/web/images/right_arrow.png
new file mode 100644 (file)
index 0000000..63e7d06
Binary files /dev/null and b/Open-ILS/web/images/right_arrow.png differ