Bug 34616: Move default server info outside the <fieldset>

Also DRY current default information dialog block

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Pedro Amorim 2023-08-25 16:41:12 +00:00 committed by Tomas Cohen Arazi
parent f0383e5f6a
commit fb47d04efd
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F

View file

@ -146,6 +146,9 @@
[% IF op == 'edit_form' %] [% IF op == 'edit_form' %]
<h1>Edit SMTP server</h1> <h1>Edit SMTP server</h1>
[% UNLESS smtp_server.is_default %]
[% PROCESS default_server_info %]
[% END %]
<form action="/cgi-bin/koha/admin/smtp_servers.pl" id="edit_save" name="edit_save" class="validated" method="post"> <form action="/cgi-bin/koha/admin/smtp_servers.pl" id="edit_save" name="edit_save" class="validated" method="post">
<input type="hidden" name="op" value="edit_save" /> <input type="hidden" name="op" value="edit_save" />
<input type="hidden" name="smtp_server_id" value="[%- smtp_server.id | html -%]" /> <input type="hidden" name="smtp_server_id" value="[%- smtp_server.id | html -%]" />
@ -226,19 +229,6 @@
[% END %] [% END %]
<span>Sets this SMTP server as the default SMTP server.</span> <span>Sets this SMTP server as the default SMTP server.</span>
</li> </li>
[% UNLESS smtp_server.is_default %]
<div class="dialog message" id="default_server_message">
<p>Current default configuration:</p>
<ul>
<li><strong>Host</strong>: [%- default_config.host | html -%]</li>
<li><strong>Port</strong>: [%- default_config.port | html -%]</li>
<li><strong>Timeout (secs)</strong>: [%- default_config.timeout | html -%]</li>
<li><strong>SSL</strong>: [%- IF default_config.ssl_mode == 'disabled' -%]<span>Disabled</span>[%- ELSIF default_config.ssl_mode == 'ssl' -%]<span>SSL</span>[%- ELSE -%]<span>STARTTLS</span>[%- END -%]</li>
<li><strong>Debug mode</strong>: [%- IF default_config.debug -%]Yes[%- ELSE -%]No[%- END -%]</li>
</ul>
</div>
[% END %]
</ol> </ol>
</fieldset> </fieldset>
<fieldset class="action"> <fieldset class="action">
@ -256,17 +246,7 @@
<h1>SMTP servers</h1> <h1>SMTP servers</h1>
<div class="dialog message" id="default_server_message"> [% PROCESS default_server_info %]
<p>Default configuration:</p>
<ul>
<li><strong>Host</strong>: [%- default_config.host | html -%]</li>
<li><strong>Port</strong>: [%- default_config.port | html -%]</li>
<li><strong>Timeout (secs)</strong>: [%- default_config.timeout | html -%]</li>
<li><strong>SSL</strong>: [%- IF default_config.ssl_mode == 'disabled' -%]<span>Disabled</span>[%- ELSIF default_config.ssl_mode == 'ssl' -%]<span>SSL</span>[%- ELSE -%]<span>STARTTLS</span>[%- END -%]</li>
<li><strong>Debug mode</strong>: [%- IF default_config.debug -%]Yes[%- ELSE -%]No[%- END -%]</li>
</ul>
</div>
[% IF servers_count > 0 %] [% IF servers_count > 0 %]
<div class="page-section"> <div class="page-section">
@ -489,4 +469,18 @@
</script> </script>
[% END %] [% END %]
[% BLOCK default_server_info %]
<div class="dialog message" id="default_server_message">
<p>Current default configuration:</p>
<ul>
<li><strong>Host</strong>: [%- default_config.host | html -%]</li>
<li><strong>Port</strong>: [%- default_config.port | html -%]</li>
<li><strong>Timeout (secs)</strong>: [%- default_config.timeout | html -%]</li>
<li><strong>SSL</strong>: [%- IF default_config.ssl_mode == 'disabled' -%]<span>Disabled</span>[%- ELSIF default_config.ssl_mode == 'ssl' -%]<span>SSL</span>[%- ELSE -%]<span>STARTTLS</span>[%- END -%]</li>
<li><strong>Debug mode</strong>: [%- IF default_config.debug -%]Yes[%- ELSE -%]No[%- END -%]</li>
</ul>
</div>
[% END %]
[% INCLUDE 'intranet-bottom.inc' %] [% INCLUDE 'intranet-bottom.inc' %]