TPAC: Split result copy counts into a separate template user/dbs/tpac_copy_counts
authorDan Scott <dan@coffeecode.net>
Wed, 21 Dec 2011 17:58:46 +0000 (12:58 -0500)
committerDan Scott <dan@coffeecode.net>
Wed, 21 Dec 2011 18:04:21 +0000 (13:04 -0500)
As Thomas Berezansky suggests, sites are likely to want to customize the
display of copy counts depending on whether they're consortial sharers,
how deep they want to display, whether they want to just show the
matching search scope... make it easy to customize by moving the
copy counts portion of the results table into a separate template.

Signed-off-by: Dan Scott <dan@coffeecode.net>
Open-ILS/src/templates/opac/parts/result/copy_counts.tt2 [new file with mode: 0644]
Open-ILS/src/templates/opac/parts/result/table.tt2

diff --git a/Open-ILS/src/templates/opac/parts/result/copy_counts.tt2 b/Open-ILS/src/templates/opac/parts/result/copy_counts.tt2
new file mode 100644 (file)
index 0000000..97d5b32
--- /dev/null
@@ -0,0 +1,12 @@
+[%- depths = attrs.copy_counts.size;
+    depth = 0;
+    WHILE depth < depths;
+%]
+<div class="result_count">
+    [% l('[_1] of [quant,_2,copy,copies] available at [_3].',
+        attrs.copy_counts.$depth.available,
+        attrs.copy_counts.$depth.count,
+        ctx.get_aou(attrs.copy_counts.$depth.org_unit).name) | html
+    %]
+</div>
+[%- depth = depth + 1; END %]
index 4ac7929..1ae2b17 100644 (file)
                                                         [% END %]
                                                         [% END %] <!-- END detail_record_view -->
                                                     </table>
-                                                    [%- depths = attrs.copy_counts.size;
-                                                        depth = 0;
-                                                        WHILE depth < depths;
-                                                    %]
-                                                    <div class="result_count">
-                                                        [% l('[_1] of [quant,_2,copy,copies] available at [_3].',
-                                                            attrs.copy_counts.$depth.available,
-                                                            attrs.copy_counts.$depth.count,
-                                                            ctx.get_aou(attrs.copy_counts.$depth.org_unit).name) | html
-                                                        %]
-                                                    </div>
-                                                    [%- depth = depth + 1; END %]
+                                                    [% PROCESS "opac/parts/result/copy_counts.tt2" %]
                                                 </div>
                                             </td>