From 2b1067d39b2e6ecda98dbbe22664298193cae1d6 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Fri, 17 Sep 2021 16:18:09 +0000 Subject: [PATCH] Bug 29049: (follow-up) Reduce number of line returns in page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit While moving the dropdown to a block, I noticed the page size was very large when there are many holds This patch chomps a large amoutn of whitespace, from the block and elsewhere and drecreased the paeg from about 400k lines to 25k lines for a record with ~200 holds To test: 1 - Apply previous patch 2 - Load holds tab for a biblio 3 - Save the page as html from your browser, note the size of the file 4 - Apply patch this 5 - Reload and repeat 6 - Note the size is much smaller Signed-off-by: Andrew Fuerste-Henry Signed-off-by: Joonas Kylmälä --- .../prog/en/includes/holds_table.inc | 161 ++++++++---------- 1 file changed, 71 insertions(+), 90 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc index c0799f245d..8dd1fcf60f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc @@ -21,33 +21,31 @@     - - [% SET first_priority = 0 %] - [% SET last_priority = holds.last.priority %] + [%- SET first_priority = 0 -%] + [%- SET last_priority = holds.last.priority -%] [% BLOCK priority_dropdown %] - [% SET loop_priority = 1 %] - [% WHILE loop_priority <= last_priority %] - [% IF this_priority == loop_priority %] + [%- SET loop_priority = 1 -%] + [%- WHILE loop_priority <= last_priority -%] + [%- IF this_priority == loop_priority -%] - [% ELSE %] + [%- ELSE -%] - [% END %] - [% loop_priority = loop_priority + 1 %] - [% END %] + [%- END -%] + [%- loop_priority = loop_priority + 1- %] + [%- END -%] [% END %] - [% FOREACH hold IN holds %] - [% IF !hold.found && first_priority == 0 %] - [% first_priority = hold.priority %] - [% found_holds = loop.index() %] - [% END %] - [% IF Koha.Preference('HoldsSplitQueueNumbering') == 'actual' %] - [% this_priority = hold.priority %] - [% ELSE %] - [% this_priority = loop.count() - found_holds %] - [% END %] + [%- IF !hold.found && first_priority == 0 -%] + [%- first_priority = hold.priority -%] + [%- found_holds = loop.index() -%] + [%- END -%] + [%- IF Koha.Preference('HoldsSplitQueueNumbering') == 'actual' -%] + [%- this_priority = hold.priority -%] + [%- ELSE -%] + [%- this_priority = loop.count() - found_holds -%] + [%- END -%] @@ -60,7 +58,6 @@ [% ELSE %] [% END %] - [% ELSE %] @@ -80,38 +77,31 @@ [% END %] - - [% IF ( CAN_user_reserveforothers_modify_holds_priority ) %] - [% UNLESS hold.found %] - [% SET prev_priority = loop.prev.priority %] - [% SET next_priority = loop.next.priority %] - + [%- IF ( CAN_user_reserveforothers_modify_holds_priority ) -%] + [%- UNLESS hold.found -%] + [%- SET prev_priority = loop.prev.priority -%] + [%- SET next_priority = loop.next.priority -%] Go up - Go top - Go bottom - Go down - [% ELSE %] + [%- ELSE -%] - [% END %] - [% END %] - + [%- END -%] + [%- END -%] [% INCLUDE 'patron-title.inc' patron=hold.patron hide_patron_infos_if_needed=1 %] - [% hold.notes | html | html_line_break %] [% IF Koha.Preference('AllowHoldDateInFuture') %] @@ -121,110 +111,101 @@ [% END %] - - [% IF ( hold.found ) %] - [% IF ( hold.atdestination ) %] + [%- IF ( hold.found ) -%] + [%- IF ( hold.atdestination ) -%] Item waiting at [% hold.wbrname | html %][% IF hold.desk_name %], [% hold.desk_name | html %],[% END %] since [% hold.waiting_date | $KohaDates %] - [% ELSIF (hold.intransit) %] + [%- ELSIF (hold.intransit) -%] Item being transferred to [% hold.wbrname | html %] - [% ELSIF (hold.inprocessing) %] + [%- ELSIF (hold.inprocessing) -%] Item being processed at [% hold.wbrname | html %] - [% END %] - [% ELSE %] - [% IF Koha.Preference('IndependentBranches') && Branches.all().size == 1 %] + [%- END -%] + [%- ELSE -%] + [%- IF Koha.Preference('IndependentBranches') && Branches.all().size == 1 -%] [% Branches.GetName(hold.branchcode) | html %] - [% ELSE %] + [%- ELSE -%] - [% END %] - [% END %] + [%- END -%] + [%- END -%] - - [% IF ( hold.found ) %] + [%- IF ( hold.found ) -%] - [% IF ( hold.barcodenumber ) %] - [% hold.barcodenumber | html %] + [%- IF ( hold.barcodenumber ) -%] + [%- hold.barcodenumber | html -%] - [% ELSE %] + [%- ELSE -%] No barcode - [% END %] + [%- END -%] - [% ELSE %] - [% IF ( hold.item_level_hold ) %] + [%- ELSE -%] + [%- IF ( hold.item_level_hold ) -%] Only item - [% IF ( hold.barcodenumber ) %] - [% hold.barcodenumber | html %] + [%- IF ( hold.barcodenumber ) -%] + [%- hold.barcodenumber | html -%] - [% ELSE %] + [%- ELSE -%] No barcode - [% END %] + [%- END -%] - [% ELSE %] - [% IF hold.itemtype %] + [%- ELSE -%] + [%- IF hold.itemtype -%] Next available [% ItemTypes.GetDescription( hold.itemtype ) | html %] item - [% ELSE %] + [%- ELSE -%] Next available - [% END %] + [%- END -%] - [% END %] - [% END %] - [% IF hold.non_priority %] + [%- END -%] + [%- END -%] + [%- IF hold.non_priority -%]
Non priority hold - [% END %] + [%- END -%] - - [% IF ( CAN_user_reserveforothers_modify_holds_priority ) %] - [% UNLESS hold.found %] + [%- IF ( CAN_user_reserveforothers_modify_holds_priority ) -%] + [%- UNLESS hold.found -%] - [% IF ( hold.lowestPriority ) %] + [%- IF ( hold.lowestPriority ) -%] Unset lowest priority - [% ELSE %] + [%- ELSE -%] Set to lowest priority - [% END %] + [%- END -%] - [% ELSE %] + [%- ELSE -%] - [% END %] - [% END %] - + [%- END -%] + [%- END -%] Cancel - - [% IF Koha.Preference('SuspendHoldsIntranet') %] - [% UNLESS ( hold.found ) %] + [%- IF Koha.Preference('SuspendHoldsIntranet') -%] + [%- UNLESS ( hold.found ) -%] - - [% IF Koha.Preference('AutoResumeSuspendedHolds') %] + [%- IF Koha.Preference('AutoResumeSuspendedHolds') -%] Clear date - [% ELSE %] + [%- ELSE -%] - [% END %] - [% END %] - [% END # IF SuspendHoldsIntranet %] - - [% IF ( hold.found ) %] + [%- END -%] + [%- END -%] + [%- END # IF SuspendHoldsIntranet -%] + [%- IF ( hold.found ) -%] - [% END %] + [%- END -%] - - [% END %] -- 2.20.1