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 <david@davidnind.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Owen Leonard 2024-01-23 19:32:03 +00:00 committed by Katrin Fischer
parent 7cc23bfe1d
commit e233fcf048
Signed by: kfischer
GPG key ID: 0EF6E2C03357A834

View file

@ -568,15 +568,13 @@
[% END %]
[% BLOCK message_templates %]
<div class="panel-group" id="group_[% lang | html %]" role="tablist" aria-multiselectable="true">
[% 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') %]
<div class="panel panel-default">
<div class="panel-heading" role="tab" id="[% letter.message_transport_type | html %]_[% lang | html %]Heading">
<h3 class="panel-title">
<a role="button" class="collapsed" data-toggle="collapse" data-parent="#group_[% lang | html %]" href="#[% letter.message_transport_type | html %]_[% lang | html %]" aria-expanded="false" aria-controls="[% letter.message_transport_type | html %]_[% lang | html %]">
[% WRAPPER accordion_item %]
[% WRAPPER accordion_heading panel_id="${letter.message_transport_type}_${lang}" %]
[% SWITCH letter.message_transport_type %]
[% CASE 'email' %]<span>Email</span>
[% CASE 'print' %]<span>[% tp('Message transport type', 'Print') | html %]</span>
@ -586,11 +584,8 @@
[% CASE 'phone' %]<span>Phone</span>
[% CASE %]<span>[% letter.message_transport_type | html %]</span>
[% END %]
</a>
</h3>
</div> <!-- /.panel-heading -->
<div id="[% letter.message_transport_type | html %]_[% lang | html %]" class="panel-collapse collapse" role="tabpanel" aria-labelledby="[% letter.message_transport_type | html %]_[% lang | html %]Heading">
<div class="panel-body">
[% END %]
[% WRAPPER accordion_panel panel_id="${letter.message_transport_type}_${lang}" %]
[% IF letter.message_transport_type == "sms" and not Koha.Preference("SMSSendDriver") %]
<fieldset class="rows mtt" disabled="disabled">
<div class="dialog message">You should enable the SMSSendDriver preference to use the SMS templates.</div>
@ -659,11 +654,10 @@
[% END %]
</ol>
</fieldset> <!-- /.rows.mtt -->
</div> <!-- /.panel-body -->
</div> <!-- /.panel-collapse -->
</div> <!-- /.panel.panel-default -->
[% END %]
[% END # /collapse_item %]
[% END # /FOR mtt %]
</div> <!-- /.panel-group#lang_lang -->
[% END # /WRAPPER accordion %]
[% END %]
[% MACRO jsinclude BLOCK %]