From e233fcf048193c73fbd86c49f58716a995fd6b8e Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Tue, 23 Jan 2024 19:32:03 +0000 Subject: [PATCH] Bug 35882: Use template wrapper for accordions: Notices This patch updates the notices template so that Bootstrap accordion markup for the notice edit view is generated by WRAPPERs. To test, apply the patch and go to Tools -> Notices. - Edit any notice. - The list of message transport types (Email, Print, SMS) should be displayed as before: Collapsible panels where clicking the transport type heading expands the corresponding information. - Confirm that changes to notices are correctly saved. Signed-off-by: David Nind Signed-off-by: Julian Maurice Signed-off-by: Katrin Fischer --- .../prog/en/modules/tools/letter.tt | 168 +++++++++--------- 1 file changed, 81 insertions(+), 87 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt index b24aaf2a32..293b8f7e82 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt @@ -568,102 +568,96 @@ [% END %] [% BLOCK message_templates %] -
+ [% WRAPPER accordion id="group_${lang}" %] [% FOR mtt IN letters.$lang.templates.keys.sort %] [% SET letter = letters.$lang.templates.$mtt %] [% NEXT IF letter.message_transport_type == "itiva" && !Koha.Preference('TalkingTechItivaPhoneNotification') %] [% NEXT IF letter.message_transport_type == "phone" && !Koha.Preference('PhoneNotification') %] -
- -
-
- [% IF letter.message_transport_type == "sms" and not Koha.Preference("SMSSendDriver") %] -
-
You should enable the SMSSendDriver preference to use the SMS templates.
- [% ELSE %] -
- [% END %] - - -
    - [% IF ( letter.tt_error ) %] -
  1. - Template Toolkit error: - [% letter.tt_error | html %] -
  2. - [% END %] - [% IF ( letter.updated_on ) %] -
  3. - Last updated: - [% letter.updated_on | $KohaDates with_hours = 1 %] -
  4. - [% END %] + [% IF ( letter.updated_on ) %]
  5. - - [% IF letter.is_html %] - - [% ELSE %] - - [% END %] + Last updated: + [% letter.updated_on | $KohaDates with_hours = 1 %]
  6. -
  7. - -
  8. -
  9. - - [% IF letter.message_transport_type == 'sms' %] - - [% IF letter.content && letter.content.length > 0 %] - [% tx("{content_length} / 160 characters", {content_length = letter.content.length} ) %] - [% ELSE %] - [% tx("{content_length} / 160 characters", {content_length = 0} ) %] - [% END %] - - [% END %] - - - - - - -
    - - - - - -
    -
  10. - [% IF preview_is_available %] -
  11. - Preview -
  12. + [% END %] +
  13. + + [% IF letter.is_html %] + + [% ELSE %] + [% END %] -
-
-
-
-
+ +
  • + +
  • +
  • + + [% IF letter.message_transport_type == 'sms' %] + + [% IF letter.content && letter.content.length > 0 %] + [% tx("{content_length} / 160 characters", {content_length = letter.content.length} ) %] + [% ELSE %] + [% tx("{content_length} / 160 characters", {content_length = 0} ) %] + [% END %] + + [% END %] + + + + + + +
    + + + + + +
    +
  • + [% IF preview_is_available %] +
  • + Preview +
  • + [% END %] + + + [% END %] + [% END # /collapse_item %] [% END # /FOR mtt %] -
    + [% END # /WRAPPER accordion %] [% END %] [% MACRO jsinclude BLOCK %]