From a5842ed1bfdd43f7f14c722f7a2fa160f79f3d5e Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Wed, 14 Dec 2022 17:16:05 +0000 Subject: [PATCH] Bug 31028: Update patron and biblio includes to remove whitespace These includes used lots of [% %] blocks instead of [%- -%] and as such the produced markup contains superflous spacing. This is OK in the browser, but for some reason does affect rendering in HTML email. Signed-off-by: David Nind Signed-off-by: Helen Oliver Signed-off-by: Kyle M Hall --- .../prog/en/includes/biblio-title.inc | 54 +++++++++---------- .../prog/en/includes/patron-title.inc | 44 +++++++-------- 2 files changed, 49 insertions(+), 49 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/biblio-title.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/biblio-title.inc index 2e7ca6426a..6499e591e4 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/biblio-title.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/biblio-title.inc @@ -1,31 +1,31 @@ -[% IF ( link ) %] - -[% END %] +[%- IF ( link ) -%] + +[%- END -%] -[% IF ( biblio.title ) %] - [% biblio.title | html %] -[% ELSE %] +[%- IF ( biblio.title ) -%] + [%- biblio.title | html -%] +[%- ELSE -%] No title -[% END %] -[% IF ( biblio.medium ) %] - [% biblio.medium | html %] -[% END %] -[% FOREACH subtitle IN biblio.subtitle.split(' \\| ') %][% IF Koha.Preference('marcflavour')=='UNIMARC' %],[% END %] - [% subtitle | html %] -[% END %] -[% part_numbers = biblio.part_number.split(' \\| ') %] -[% part_names = biblio.part_name.split(' \\| ') %] -[% i = 0 %] -[% WHILE ( part_numbers.$i.defined || part_names.$i.defined ) %] - [% IF ( part_numbers.$i.defined ) %] - [% part_numbers.$i | html %] - [% END %] - [% IF ( part_names.$i.defined ) %] - [% part_names.$i | html %] - [% END %] - [% i = i + 1 %] -[% END %] +[%- END -%] +[%- IF ( biblio.medium ) -%] + [%- biblio.medium | html -%] +[%- END -%] +[%- FOREACH subtitle IN biblio.subtitle.split(' \\| ') -%][%- IF Koha.Preference('marcflavour')=='UNIMARC' -%],[%- END -%] + [%- subtitle | html -%] +[%- END -%] +[%- part_numbers = biblio.part_number.split(' \\| ') -%] +[%- part_names = biblio.part_name.split(' \\| ') -%] +[%- i = 0 -%] +[%- WHILE ( part_numbers.$i.defined || part_names.$i.defined ) -%] + [%- IF ( part_numbers.$i.defined ) -%] + [%- part_numbers.$i | html -%] + [%- END -%] + [%- IF ( part_names.$i.defined ) -%] + [%- part_names.$i | html -%] + [%- END -%] + [%- i = i + 1 -%] +[%- END -%] -[% IF ( link ) %] +[%- IF ( link ) -%] -[% END %] +[%- END -%] diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-title.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-title.inc index d0a3267cf5..772035d5bb 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-title.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-title.inc @@ -30,23 +30,23 @@ [%- SET data.borrowernumber = borrowernumber -%] [%- SET data.title = title -%] [%- END -%] -[%# Parameter no_html - if 1, the html tags are NOT generated %] -[%- IF no_title %][% SET data.title = "" %][% END -%] -[%- IF data.title %] - [%- IF no_html %] - [%- span_start = '' %] - [%- span_end = '' %] - [%- ELSE %] - [%- span_start = '' %] - [%- span_end = '' %] - [%- END %] - [% data.title = data.title | html %] +[%# Parameter no_html - if 1, the html tags are NOT generated -%] +[%- IF no_title -%][%- SET data.title = "" -%][%- END -%] +[%- IF data.title -%] + [%- IF no_html -%] + [%- span_start = '' -%] + [%- span_end = '' -%] + [%- ELSE -%] + [%- span_start = '' -%] + [%- span_end = '' -%] + [%- END -%] + [%- data.title = data.title | html -%] [%- SET data.title = span_start _ data.title _ span_end _ ' ' -%] [%- END -%] [%- SET display_patron_name = 1 -%] [%- SET display_cardnumber = 1 -%] -[%- IF no_cardnumber %][% SET display_cardnumber = 0 %][% END -%] -[%- IF hide_patron_infos_if_needed %] [%# Should only be set if patron is set -%] +[%- IF no_cardnumber -%][%- SET display_cardnumber = 0 -%][%- END -%] +[%- IF hide_patron_infos_if_needed -%] [%# Should only be set if patron is set -%] [%- SET can_see_patron_infos = logged_in_user.can_see_patron_infos( patron ) -%] [%- UNLESS can_see_patron_infos -%] [%- SET display_patron_name = 0 -%] @@ -56,27 +56,27 @@ [%- END -%] [%- END -%] [%- IF hide_patron_infos_if_needed AND ( display_patron_name OR display_cardnumber ) -%] - [%- IF link_to == 'circulation_reserves' %] - [%- ELSIF link_to == 'circulation_recalls' %] - [%- ELSIF link_to == 'members_pay' %] - [%- ELSE %] + [%- IF link_to == 'circulation_reserves' -%] + [%- ELSIF link_to == 'circulation_recalls' -%] + [%- ELSIF link_to == 'members_pay' -%] + [%- ELSE -%] [%- END -%] [%- END -%] [%- IF display_patron_name -%] [%- IF data.category_type == 'I' -%] - [%- data.surname | html %] [% IF data.othernames %] ([% data.othernames | html %])[% END -%] + [%- data.surname | html -%] [%- IF data.othernames -%] ([%- data.othernames | html -%])[%- END -%] [%- ELSIF invert_name -%] - [% data.title | $raw %][%- data.surname | html %][% IF ( data.firstname ) %], [% data.firstname | html %][% END %][% IF data.middle_name %] [% data.middle_name | html %][% END %][% IF data.othernames %] ([% data.othernames | html %]) [% END -%] + [%- data.title | $raw -%][%- data.surname | html -%][%- IF ( data.firstname ) -%], [%- data.firstname | html -%][%- END -%][%- IF data.middle_name -%] [%- data.middle_name | html -%][%- END -%][%- IF data.othernames -%] ([%- data.othernames | html -%]) [%- END -%] [%- ELSE -%] - [% data.title | $raw %][%- data.firstname | html %][% IF data.middle_name %] [% data.middle_name | html %][% END %][% IF data.othernames %] ([% data.othernames | html %]) [% END %] [% data.surname | html -%] + [%- data.title | $raw -%][%- data.firstname | html -%][%- IF data.middle_name -%] [%- data.middle_name | html -%][%- END -%][%- IF data.othernames -%] ([%- data.othernames | html -%]) [%- END -%] [%- data.surname | html -%] [%- END -%] - [%- IF display_cardnumber AND data.cardnumber %] ([% data.cardnumber | html %])[% END -%] + [%- IF display_cardnumber AND data.cardnumber -%] ([%- data.cardnumber | html -%])[%- END -%] [%- ELSIF display_cardnumber -%] [%- IF data.cardnumber -%][%# FIXME Cardnumber should always be defined, right? -%] [%- data.cardnumber | html -%] [%- END -%] [%- ELSE -%] - A patron from library [% Branches.GetName( patron.branchcode ) | html -%] + A patron from library [%- Branches.GetName( patron.branchcode ) | html -%] [%- END -%] [%- IF hide_patron_infos_if_needed AND ( display_patron_name OR display_cardnumber ) -%] -- 2.30.2