From cd2de47aafd67614a1bb029adfc5f26520c86be1 Mon Sep 17 00:00:00 2001 From: John Crisp Date: Wed, 4 Jun 2025 17:44:26 +0200 Subject: [PATCH] Finish Email templates and fix toggle password --- .../public/koozali/js/sme-password.js | 51 +-- .../AdminLTE/templates/emaildeliver.html.ep | 205 +++++---- .../AdminLTE/templates/emailreceive.html.ep | 411 +++++++++++------- .../themes/AdminLTE/templates/login.html.ep | 11 +- .../templates/partials/_footer.html.ep | 2 +- smeserver-manager-AdminLTE.spec | 6 +- 6 files changed, 406 insertions(+), 280 deletions(-) diff --git a/root/usr/share/smanager/themes/AdminLTE/public/koozali/js/sme-password.js b/root/usr/share/smanager/themes/AdminLTE/public/koozali/js/sme-password.js index 106830d..bbf7479 100644 --- a/root/usr/share/smanager/themes/AdminLTE/public/koozali/js/sme-password.js +++ b/root/usr/share/smanager/themes/AdminLTE/public/koozali/js/sme-password.js @@ -1,33 +1,22 @@ -// js/sme-password.js +$(document).ready(function () { + const togglePassword = document.querySelector("#togglePassword"); + const password = document.querySelector("#password"); -$(document).ready(function() { -/* // For each password input - $('.sme-password').each(function() { - // Create a new container - //alert("sme-password"); - var $inputContainer = $('
'); - - // Move the input into the new container - $(this).wrap($inputContainer); - - // Create the toggle image - var $togglePassword = $('Show Password'); - - // Append the toggle image to the container - $(this).after($togglePassword); - }); */ + let pass = togglePassword; - $('.toggle-password').on('click', function() { - // Find the associated password field - var input = $(this).siblings('.sme-password'); - - // Toggle the type attribute between password and text - var inputType = input.attr('type') === 'password' ? 'text' : 'password'; - input.attr('type', inputType); - - // Toggle the icon source based on the input type - // Check boostrap colours? -// var iconSrc = inputType === 'password' ? 'images/visible.png' : 'images/visible-slash.png'; -// $(this).attr('src', iconSrc); - }); -}); \ No newline at end of file + if (pass) { + togglePassword.addEventListener("click", function () { + // toggle the type attribute + const type = password.getAttribute("type") === "password" ? "text" : "password"; + password.setAttribute("type", type); + // toggle the eye icon + if (type === "text") { + $(this).removeClass("bi-eye"); + $(this).addClass("bi-eye-slash"); + } else { + $(this).removeClass("bi-eye-slash"); + $(this).addClass("bi-eye"); + } + }); +} +}); diff --git a/root/usr/share/smanager/themes/AdminLTE/templates/emaildeliver.html.ep b/root/usr/share/smanager/themes/AdminLTE/templates/emaildeliver.html.ep index 0d99bfe..d95d824 100644 --- a/root/usr/share/smanager/themes/AdminLTE/templates/emaildeliver.html.ep +++ b/root/usr/share/smanager/themes/AdminLTE/templates/emaildeliver.html.ep @@ -5,108 +5,153 @@
% if (config->{debug} == 1) { -

- %= dumper $c->current_route - %= dumper $mai_datas -

+
+            <<%=  dumper $c->current_route %>
+            <<%=  dumper $mai_datas %>
+        
% } + % if ( stash 'error' ) {
- %= $c->render_to_string(inline => stash 'error') + <%= $c->render_to_string(inline => stash 'error') %>
- %} + % } -

<%= $title%>

+

<%= $title %>

- %= form_for '/emailsettingd' => (method => 'POST') => begin +
-

- %=l 'mai_TITLE_UNKNOWN' -

+
- %=l 'mai_DESC_UNKNOWN' +

<%= l 'mai_TITLE_UNKNOWN' %>

-

- - %=l 'mai_LABEL_UNKNOWN' - - - % param 'EmailUnknownUser' => $mai_datas->{emailunknownuser} unless param 'EmailUnknownUser'; - %= select_field 'EmailUnknownUser' => $c->get_emailunknownuser_opt(), class => "" - -

+
- -

- %=l 'mai_TITLE_DELEGATE' -

+
+ <%= l 'mai_DESC_UNKNOWN' %> +
- %=l 'mai_DESC_DELEGATE' +
-

- - %=l 'mai_LABEL_DELEGATE' - - - % param 'DelegateMailServer' => $mai_datas->{delegatemailserver} unless param 'DelegateMailServer'; - %= text_field 'DelegateMailServer', class => "" - -

+
+
+ <%= l 'mai_LABEL_UNKNOWN' %> +
+
+ % param 'EmailUnknownUser' => $mai_datas->{emailunknownuser} unless param 'EmailUnknownUser'; + <%= select_field 'EmailUnknownUser' => $c->get_emailunknownuser_opt(), class => "form-select" %> +
+
- -

- %=l 'mai_TITLE_SMARTHOST' -

+
- %=l 'mai_DESC_SMARTHOST' + +

<%= l 'mai_TITLE_DELEGATE' %>

-

- - %=l 'mai_LABEL_SMARTHOST' - - - % param 'SMTPSmartHost' => $mai_datas->{smtpsmarthost} unless param 'SMTPSmartHost'; - %= text_field 'SMTPSmartHost', class => "" - -

+
-

- - %=l 'mai_LABEL_SMARTHOST_SMTPAUTH_STATUS' - - - % param 'SMTPAUTHPROXY_status' => $mai_datas->{smtpauthproxystatus} unless param 'SMTPAUTHPROXY_status'; - %= select_field 'SMTPAUTHPROXY_status' => [[(l 'DISABLED') => 'disabled'], [(l 'ENABLED') => 'enabled']], class => "" - -

+
+ <%= l 'mai_DESC_DELEGATE' %> +
-

- - %=l 'mai_LABEL_SMARTHOST_SMTPAUTH_USERID' - - - % param 'SMTPAUTHPROXY_Userid' => $mai_datas->{smtpauthproxyuserid} unless param 'SMTPAUTHPROXY_Userid'; - %= text_field 'SMTPAUTHPROXY_Userid', class => "" - -

+
-

- - %=l 'mai_LABEL_SMARTHOST_SMTPAUTH_PASSWD' - - - % param 'SMTPAUTHPROXY_Passwd' => $mai_datas->{smtpauthproxypassword} unless param 'SMTPAUTHPROXY_Passwd'; - %= password_field 'SMTPAUTHPROXY_Passwd', class => "" - -

+ % param 'DelegateMailServer' => $mai_datas->{delegatemailserver} unless param 'DelegateMailServer'; - % my $btn = l('SAVE'); - %= submit_button "$btn", class => "" +
+
+ +
+
+ +
+
- %= hidden_field 'trt' => 'DEL' - % end +
+ +

<%= l 'mai_TITLE_SMARTHOST' %>

+ +
+ +
+ <%= l 'mai_DESC_SMARTHOST' %> +
+ +
+ + % param 'SMTPSmartHost' => $mai_datas->{smtpsmarthost} unless param 'SMTPSmartHost'; + +
+
+ +
+
+ +
+
+ +
+ + % param 'SMTPAUTHPROXY_status' => $mai_datas->{smtpauthproxystatus} unless param 'SMTPAUTHPROXY_status'; + +
+
+ <%= l 'mai_LABEL_SMARTHOST_SMTPAUTH_STATUS' %> +
+
+ <%= select_field 'SMTPAUTHPROXY_status' => [[(l 'DISABLED') => 'disabled'], [(l 'ENABLED') => 'enabled']], class => "form-select" %> +
+
+ +
+ + % param 'SMTPAUTHPROXY_Userid' => $mai_datas->{smtpauthproxyuserid} unless param 'SMTPAUTHPROXY_Userid'; + +
+
+ +
+
+ +
+
+ +
+ + % param 'SMTPAUTHPROXY_Passwd' => $mai_datas->{smtpauthproxypassword} unless param 'SMTPAUTHPROXY_Passwd'; + +
+
+ +
+
+ +
+
+ +
+
+ + + + + + +
+ + + % my $btn = l('SAVE'); + <%= hidden_field 'trt' => 'DEL' %> + +
+
+ +
+
+ +
%end \ No newline at end of file diff --git a/root/usr/share/smanager/themes/AdminLTE/templates/emailreceive.html.ep b/root/usr/share/smanager/themes/AdminLTE/templates/emailreceive.html.ep index f7b6870..2f4baa5 100644 --- a/root/usr/share/smanager/themes/AdminLTE/templates/emailreceive.html.ep +++ b/root/usr/share/smanager/themes/AdminLTE/templates/emailreceive.html.ep @@ -8,196 +8,279 @@
% if (config->{debug} == 1) { -

- %= dumper $c->current_route - %= dumper $mai_datas - %= dumper $c->param('SMTPAuth') -

+
+            <<%=  dumper $c->current_route %>
+            <<%=  dumper $mai_datas %>
+            <<%=  dumper $c->param('SMTPAuth') %>
+        
% } % if ( stash 'error' ) {
-
- %= $c->render_to_string(inline => stash 'error') +
+ <<%= $c->render_to_string(inline => stash 'error') %>
- %} - -

<%= $title%>

+ % } - %= form_for '/emailsettingd' => (method => 'POST') => begin +

<%= $title %>

- %=l 'mai_DESC_MODE' +
-

- - %=l 'mai_LABEL_MODE' - - - % param 'FetchmailMethod' => $mai_datas->{fetchmailmethod} unless param 'FetchmailMethod'; - - %= select_field 'FetchmailMethod' => $c->get_retrieval_opt(), class => "" - -

+
- %#=l 'mai_DESC_SMTP_AUTH_CONTROL' -
- %= l "SMTP port (25) main purpose is to receive emails from another server, STARTTLS is always offered, but auth if offered is only if STARTTLS is also used by client." -
- %= l "SMTPS port (465) will require implicit SSL/TLS then authenticate to send." -
- %= l "SMTP Submission port (587) will require STARTTLS, then authenticate to send." -
+
+ <%= l 'mai_DESC_MODE' %> +
- % my $smtp_mesg=l('SMTP port %u allow client to authenticate:'); -

- - %= sprintf($smtp_mesg,$c->get_db_prop('qpsmtpd','TCPPort',25)); - - + +

+
+ <%= l 'mai_LABEL_MODE' %> +
+
+ % param 'FetchmailMethod' => $mai_datas->{fetchmailmethod} unless param 'FetchmailMethod'; + + <%= select_field 'FetchmailMethod' => $c->get_retrieval_opt(), class =>"form-select" %> +
+
+ +
+ + +
+
+ Note - this first line was disabled? + +
+ <%= l 'mai_DESC_SMTP_AUTH_CONTROL' %> +
+ /end +
+ +
+ +
+ <%= l "SMTP port (25) main purpose is to receive emails from another server, STARTTLS is always offered, but auth if offered is only if STARTTLS is also used by client." %> +
+ +
+ +
+ + <%= l "SMTPS port (465) will require implicit SSL/TLS then authenticate to send." %> +
+ +
+ +
+ <%= l "SMTP Submission port (587) will require STARTTLS, then authenticate to send." %> +
+ +
+ +
+ + + + % my $smtp_mesg=l('SMTP port %u allow client to authenticate:'); % param 'SMTPAuth' => $c->get_current_smtp_auth( FALSE ) unless param 'SMTPAuth'; - - %= select_field 'SMTPAuth' => $c->get_smtp_auth_opt(), class => "" - -

- % my $smtp_mesg=l('SMTPS SSL/TLS auth: port %u status:'); -

- - %= sprintf($smtp_mesg,$c->get_db_prop('sqpsmtpd','TCPPort',465)); - - - % param 'sSMTPAuth' => $c->get_current_smtp_ssl_auth(FALSE,'s', TRUE) unless param 'sSMTPAuth'; - %= select_field 'sSMTPAuth' => $c->get_smtp_ssl_auth_opt(), class => "" - -

+
+
+ <%= sprintf($smtp_mesg,$c->get_db_prop('qpsmtpd','TCPPort',25)); %> +
+
- %my $smtp_mesg=l('Submission port %u status:'); -

- - %= sprintf($smtp_mesg,$c->get_db_prop('uqpsmtpd','TCPPort',587)); - - + + <%= select_field 'SMTPAuth' => $c->get_smtp_auth_opt(), class => "form-select" %> +

+
+ +
+ + % my $smtp_mesg=l('SMTPS SSL/TLS auth: port %u status:'); + % param 'sSMTPAuth' => $c->get_current_smtp_ssl_auth(FALSE,'s', TRUE) unless param 'sSMTPAuth'; + +
+
+ <%= sprintf($smtp_mesg,$c->get_db_prop('sqpsmtpd','TCPPort',465)); %> +
+
+ <%= select_field 'sSMTPAuth' => $c->get_smtp_ssl_auth_opt(), class => "form-select" %> +
+
+ +
+ + % my $smtp_mesg=l('Submission port %u status:'); % param 'uSMTPAuth' => $c->get_current_smtp_ssl_auth(FALSE,'u', TRUE) unless param 'uSMTPAuth'; - - %= select_field 'uSMTPAuth' => $c->get_smtp_ssl_auth_opt(), class => "" - -

- -

- %=l 'mai_TITLE_SECONDARY' -

+
+
+ <%= sprintf($smtp_mesg,$c->get_db_prop('uqpsmtpd','TCPPort',587)); %> +
+
+ + <%= select_field 'uSMTPAuth' => $c->get_smtp_ssl_auth_opt(), class => "form-select" %> +
+
- %=l 'mai_DESC_SECONDARY' +
-

- - %=l 'mai_LABEL_SECONDARY' - - - % param 'SecondaryMailServer' => $mai_datas->{secondarymailserver} unless param 'SecondaryMailServer'; - %= text_field 'SecondaryMailServer', class => "" - -

+

<%= l 'mai_TITLE_SECONDARY' %>

- %=l 'mai_DESC_FETCH_PERIOD' +
-

- - %=l 'mai_LABEL_FETCH_PERIOD' - - - % param 'FreqOffice' => $mai_datas->{freqoffice} unless param 'FreqOffice'; - %= select_field 'FreqOffice' => $c->fetchmail_freq(), class => "" - -

+
+ <%= l 'mai_DESC_SECONDARY' %> +
-

- - %=l 'mai_LABEL_FETCH_PERIOD_NIGHTS' - - - % param 'FreqOutside' => $mai_datas->{freqoutside} unless param 'FreqOutside'; - %= select_field 'FreqOutside' => $c->fetchmail_freq(), class => "" - -

+
-

- - %=l 'mai_LABEL_FETCH_PERIOD_WEEKENDS' - - - % param 'FreqWeekend' => $mai_datas->{freqweekend} unless param 'FreqWeekend'; - %= select_field 'FreqWeekend' => $c->fetchmail_freq(), class => "" - -

+ % param 'SecondaryMailServer' => $mai_datas->{secondarymailserver} unless param 'SecondaryMailServer'; -

- - %=l 'mai_LABEL_POP_ACCOUNT' - - - % param 'SecondaryMailAccount' => $mai_datas->{secondarymailaccount} unless param 'SecondaryMailAccount'; - %= text_field 'SecondaryMailAccount', class => "" - -

+
+
+ +
+
+ +
+
-

- - %=l 'mai_LABEL_POP_PASS' - - - % param 'SecondaryMailPassword' => $mai_datas->{secondarymailpassword} unless param 'SecondaryMailPassword'; - %= password_field 'SecondaryMailPassword', class => "" - -

+
-

- - %=l 'mai_LABEL_SORT_METHOD' - - - % param 'SpecifyHeader' => $mai_datas->{specifyheader} unless param 'SpecifyHeader'; - %= select_field 'SpecifyHeader' => [[(l 'mai_DEFAULT') => 'off'], [(l 'mai_SPECIFY_BELOW') => 'on']], class => "" - -

+
+ <%= l 'mai_DESC_FETCH_PERIOD' %> +
-

- - %=l 'mai_LABEL_SORT_HEADER' - - - % param 'SecondaryMailEnvelope' => $mai_datas->{secondarymailenvelope} unless param 'SecondaryMailEnvelope'; - %= text_field 'SecondaryMailEnvelope', class => "" - -

+ % param 'FreqOffice' => $mai_datas->{freqoffice} unless param 'FreqOffice'; - % my $btn = l('SAVE'); - %= submit_button "$btn", class => "" +
+
+ <%= l 'mai_LABEL_FETCH_PERIOD' %> +
+
+ <%= select_field 'FreqOffice' => $c->fetchmail_freq(), class => "form-select" %> +
+
- %= hidden_field 'trt' => 'REC' - % end +
+ + % param 'FreqOutside' => $mai_datas->{freqoutside} unless param 'FreqOutside'; + +
+
+ <%= l 'mai_LABEL_FETCH_PERIOD_NIGHTS' %> +
+
+ <%= select_field 'FreqOutside' => $c->fetchmail_freq(), class => "form-select" %> +
+
+ +
+ + % param 'FreqWeekend' => $mai_datas->{freqweekend} unless param 'FreqWeekend'; + +
+
+ <%= l 'mai_LABEL_FETCH_PERIOD_WEEKENDS' %> +
+
+ <%= select_field 'FreqWeekend' => $c->fetchmail_freq(), class => "form-select" %> +
+
+ +
+ + % param 'SecondaryMailAccount' => $mai_datas->{secondarymailaccount} unless param 'SecondaryMailAccount'; + +
+
+ +
+
+ +
+
+ +
+ + % param 'SecondaryMailPassword' => $mai_datas->{secondarymailpassword} unless param 'SecondaryMailPassword'; + +
+
+ +
+
+ +
+
+ +
+
+ + +
+ + % param 'SpecifyHeader' => $mai_datas->{specifyheader} unless param 'SpecifyHeader'; + +
+
+ <%= l 'mai_LABEL_SORT_METHOD' %> +
+
+ <%= select_field 'SpecifyHeader' => [[(l 'mai_DEFAULT') => 'off'], [(l 'mai_SPECIFY_BELOW') => 'on']], class => "form-select" %> +
+
+ +
+ + % param 'SecondaryMailEnvelope' => $mai_datas->{secondarymailenvelope} unless param 'SecondaryMailEnvelope'; + +
+
+ +
+
+ +
+
+ +
+ + % my $btn = l('SAVE'); + <%= hidden_field 'trt' => 'REC' %> + +
+
+ +
+
+ +
-%end \ No newline at end of file +%end + diff --git a/root/usr/share/smanager/themes/AdminLTE/templates/login.html.ep b/root/usr/share/smanager/themes/AdminLTE/templates/login.html.ep index cedda38..28b2d4c 100644 --- a/root/usr/share/smanager/themes/AdminLTE/templates/login.html.ep +++ b/root/usr/share/smanager/themes/AdminLTE/templates/login.html.ep @@ -64,12 +64,15 @@
+
- - + + +
+
+
-
<%= hidden_field 'From' => $c->tx->req->url %> @@ -94,9 +97,11 @@
+ diff --git a/root/usr/share/smanager/themes/AdminLTE/templates/partials/_footer.html.ep b/root/usr/share/smanager/themes/AdminLTE/templates/partials/_footer.html.ep index cd2abbc..d47a343 100644 --- a/root/usr/share/smanager/themes/AdminLTE/templates/partials/_footer.html.ep +++ b/root/usr/share/smanager/themes/AdminLTE/templates/partials/_footer.html.ep @@ -9,4 +9,4 @@ % }
Copyright 1999-2006 Mitel Corporation
%= session 'copyRight' -
Copyright (c) 2013-2024 Koozali Foundation Inc.
\ No newline at end of file +
Copyright (c) 2013-2024 Koozali Foundation Inc.
diff --git a/smeserver-manager-AdminLTE.spec b/smeserver-manager-AdminLTE.spec index 217f9db..8e1e7b3 100644 --- a/smeserver-manager-AdminLTE.spec +++ b/smeserver-manager-AdminLTE.spec @@ -1,6 +1,6 @@ %define name smeserver-manager-AdminLTE %define version 11.0.0 -%define release 26 +%define release 27 Summary: AdminLTE is an html framework for admin consoles - this rpm adds it to smeserver manager2 Name: %{name} Version: %{version} @@ -26,6 +26,10 @@ AdminLTE is an html framework for admin consoles wget https://github.com/ColorlibHQ/AdminLTE/archive/master.zip %changelog +* Wed Jun 04 2025 John Crisp 11.0.0-27.sme +- finish Email panels +- Fix login password toggle + * Wed May 28 2025 John Crisp 11.0.0-26.sme - DateTime started but needs other fixes. - Start Email but it really needs partials