From: Dan Wells Date: Wed, 16 Jan 2013 20:05:17 +0000 (-0500) Subject: TPAC: Don't display serial headers without content X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=accd12854102132b2a9b6e03c53512d0fbdd190d;p=evergreen%2Fequinox.git TPAC: Don't display serial headers without content Currently, the TPAC serial display code will print a section header, then see if there is any content to show. This causes headers to show up when they are unnecessary or unwanted. Now, we only show the header if we have content needing heading. Signed-off-by: Dan Wells Signed-off-by: Lebbeous Fogle-Weekley --- diff --git a/Open-ILS/src/templates/opac/parts/record/issues-mfhd.tt2 b/Open-ILS/src/templates/opac/parts/record/issues-mfhd.tt2 index 15b9ab9d3c..ced0ec6834 100644 --- a/Open-ILS/src/templates/opac/parts/record/issues-mfhd.tt2 +++ b/Open-ILS/src/templates/opac/parts/record/issues-mfhd.tt2 @@ -15,26 +15,29 @@ }; FOREACH serial IN ctx.mfhd_summaries; -%] - - [% l('Holdings summary ([_1])', serial.location) %] - -[% + printed_mfhd_header = 0; FOREACH type IN mfhd.keys; NEXT UNLESS serial.$type.size; -%] - - [% mfhd.$type %] - [% - FOR thing IN serial.$type; - thing.join(", "); - END %] - + IF !printed_mfhd_header; %] + + [% l('Holdings summary ([_1])', serial.location) %] + + [% printed_mfhd_header = 1; + END; %] + + [% mfhd.$type %] + [% + FOR thing IN serial.$type; + thing.join(", "); + END %] + + [% END; + IF printed_mfhd_header; %] + + + + [% END; %] [% END %] - - - - [% END %] [% END %]