From f54a65cdd4d3db9adcd49d49d675021b8819f35a Mon Sep 17 00:00:00 2001 From: Dan Wells Date: Wed, 16 Jan 2013 15:05:17 -0500 Subject: [PATCH] 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 --- .../templates/opac/parts/record/issues-mfhd.tt2 | 37 ++++++++++++---------- 1 file changed, 20 insertions(+), 17 deletions(-) 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 %] -- 2.11.0