TPAC: Split result copy counts into a separate template
authorDan Scott <dan@coffeecode.net>
Wed, 21 Dec 2011 17:58:46 +0000 (12:58 -0500)
committerThomas Berezansky <tsbere@mvlc.org>
Wed, 21 Dec 2011 20:17:24 +0000 (15:17 -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>
Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
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>