diff --git a/root/usr/share/smanager/themes/default/public/css/sme-password.css b/root/usr/share/smanager/themes/default/public/css/sme-password.css new file mode 100644 index 0000000..62e1bf3 --- /dev/null +++ b/root/usr/share/smanager/themes/default/public/css/sme-password.css @@ -0,0 +1,17 @@ +/* css/sme-password.css */ +.input-container { + position: relative; + display: inline-block; +} +.sme-password { + padding-right: 5px; /* Ensure space for the toggle icon */ +} +.toggle-password { + position: absolute; + right: 4px; /* Position it towards the right */ + top: 50%; /* Center vertically */ + transform: translateY(-50%); /* Adjust for exact centering */ + cursor: pointer; + width: 20px; /* Set the width of the icon */ + height: 20px; /* Set the height of the icon */ +} \ No newline at end of file diff --git a/root/usr/share/smanager/themes/default/public/images/visible-slash.png b/root/usr/share/smanager/themes/default/public/images/visible-slash.png new file mode 100644 index 0000000..001c465 Binary files /dev/null and b/root/usr/share/smanager/themes/default/public/images/visible-slash.png differ diff --git a/root/usr/share/smanager/themes/default/public/images/visible.png b/root/usr/share/smanager/themes/default/public/images/visible.png new file mode 100644 index 0000000..b53ec92 Binary files /dev/null and b/root/usr/share/smanager/themes/default/public/images/visible.png differ diff --git a/root/usr/share/smanager/themes/default/public/js/sme-password.js b/root/usr/share/smanager/themes/default/public/js/sme-password.js new file mode 100644 index 0000000..cb312b2 --- /dev/null +++ b/root/usr/share/smanager/themes/default/public/js/sme-password.js @@ -0,0 +1,31 @@ +// js/sme-password.js +$(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); + }); + + $('.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 + var iconSrc = inputType === 'password' ? 'images/visible.png' : 'images/visible-slash.png'; + $(this).attr('src', iconSrc); + }); +}); \ No newline at end of file diff --git a/root/usr/share/smanager/themes/default/templates/layouts/default.html.ep b/root/usr/share/smanager/themes/default/templates/layouts/default.html.ep index 932e9e6..5bd7fed 100644 --- a/root/usr/share/smanager/themes/default/templates/layouts/default.html.ep +++ b/root/usr/share/smanager/themes/default/templates/layouts/default.html.ep @@ -11,6 +11,7 @@ %= stylesheet '/css/sme_main.css' %= stylesheet '/css/sme_menu.css' %= stylesheet '/css/styles.css' + %= stylesheet '/css/sme-password.css' %= content_for 'head_contrib' % if (config 'hasJquery') { %= include 'partials/_js_imports' @@ -32,6 +33,7 @@ %= javascript '/js/buttons.html5.min.js' %= javascript '/js/buttons.print.min.js' %= javascript '/js/flag-by-locale.js' + %= javascript '/js/sme-password.js' %= stylesheet '/css/sme-jquery-overrides.css' @@ -125,4 +127,4 @@ - + \ No newline at end of file diff --git a/root/usr/share/smanager/themes/default/templates/login.html.ep b/root/usr/share/smanager/themes/default/templates/login.html.ep index 89cd346..d460b38 100644 --- a/root/usr/share/smanager/themes/default/templates/login.html.ep +++ b/root/usr/share/smanager/themes/default/templates/login.html.ep @@ -43,9 +43,9 @@

%=l 'PASSWORD' - %= password_field 'Password', id => 'id_password', autocomplete => 'current-password' + %= password_field 'Password', id => 'id_password', autocomplete => 'current-password', class=>'sme-password' % if (config 'hasJquery') { - Visible + %# Visible % }

%} @@ -66,4 +66,4 @@ % end -%end +%end \ No newline at end of file diff --git a/root/usr/share/smanager/themes/default/templates/partials/_iba_pwd.html.ep b/root/usr/share/smanager/themes/default/templates/partials/_iba_pwd.html.ep index 58f8613..83f55e1 100644 --- a/root/usr/share/smanager/themes/default/templates/partials/_iba_pwd.html.ep +++ b/root/usr/share/smanager/themes/default/templates/partials/_iba_pwd.html.ep @@ -17,7 +17,7 @@ %=l 'PASSWORD_NEW', class => 'label' - %= password_field 'newPass', class => 'input' + %= password_field 'newPass', class => 'input' , class=>'sme-password'

@@ -25,7 +25,7 @@ %=l 'PASSWORD_VERIFY_NEW', class => 'label' - %= password_field 'newPassVerify', class => 'input' + %= password_field 'newPassVerify', class => 'input', class=>'sme-password'

@@ -39,4 +39,4 @@ % end - + \ No newline at end of file diff --git a/root/usr/share/smanager/themes/default/templates/partials/_js_imports.html.ep b/root/usr/share/smanager/themes/default/templates/partials/_js_imports.html.ep index c145fcd..d5c2054 100644 --- a/root/usr/share/smanager/themes/default/templates/partials/_js_imports.html.ep +++ b/root/usr/share/smanager/themes/default/templates/partials/_js_imports.html.ep @@ -1,5 +1,5 @@ - + @@ -98,4 +98,4 @@ }); % end -% end +% end \ No newline at end of file diff --git a/root/usr/share/smanager/themes/default/templates/partials/_usr_pwd.html.ep b/root/usr/share/smanager/themes/default/templates/partials/_usr_pwd.html.ep index 7e4f1bf..35a1c7b 100644 --- a/root/usr/share/smanager/themes/default/templates/partials/_usr_pwd.html.ep +++ b/root/usr/share/smanager/themes/default/templates/partials/_usr_pwd.html.ep @@ -18,7 +18,7 @@ %=l 'PASSWORD_NEW', class => 'label' - %= password_field 'newPass', class => 'input' + %= password_field 'newPass', class => 'input', class=>'sme-password'

@@ -26,7 +26,7 @@ %=l 'PASSWORD_VERIFY_NEW', class => 'label' - %= password_field 'newPassVerify', class => 'input' + %= password_field 'newPassVerify', class => 'input', class=>'sme-password'

@@ -41,4 +41,4 @@ % end - + \ No newline at end of file diff --git a/root/usr/share/smanager/themes/default/templates/partials/_usr_pwds.html.ep b/root/usr/share/smanager/themes/default/templates/partials/_usr_pwds.html.ep index 6fdee33..007bc91 100644 --- a/root/usr/share/smanager/themes/default/templates/partials/_usr_pwds.html.ep +++ b/root/usr/share/smanager/themes/default/templates/partials/_usr_pwds.html.ep @@ -11,7 +11,7 @@ %=l 'usr_CURRENT_SYSTEM_PASSWORD', class => 'label' - %= password_field 'CurPass', class => 'input' + %= password_field 'CurPass', class => 'input', class=>'sme-password'

@@ -19,7 +19,7 @@ %=l 'usr_NEW_SYSTEM_PASSWORD', class => 'label' - %= password_field 'Pass', class => 'input' + %= password_field 'Pass', class => 'input', class=>'sme-password'

@@ -27,7 +27,7 @@ %=l 'usr_NEW_SYSTEM_PASSWORD_VERIFY', class => 'label' - %= password_field 'PassVerify', class => 'input' + %= password_field 'PassVerify', class => 'input', class=>'sme-password'

@@ -42,4 +42,4 @@ % end - + \ No newline at end of file diff --git a/root/usr/share/smanager/themes/default/templates/userpassword.html.ep b/root/usr/share/smanager/themes/default/templates/userpassword.html.ep index 9020cdf..9e946e3 100644 --- a/root/usr/share/smanager/themes/default/templates/userpassword.html.ep +++ b/root/usr/share/smanager/themes/default/templates/userpassword.html.ep @@ -47,7 +47,7 @@

%= l 'pwd_PASSWORD_OLD' - %= password_field 'Oldpass', class => 'input' + %= password_field 'Oldpass', class => 'input', class=>'sme-password'

% } @@ -55,14 +55,14 @@

%=l 'pwd_PASSWORD_NEW' - %= password_field 'Pass', class => 'input' + %= password_field 'Pass', class => 'input', class=>'sme-password'

%=l 'pwd_PASSWORD_VERIFY_NEW' - %= password_field 'Passverify', class => 'input' + %= password_field 'Passverify', class => 'input', class=>'sme-password'

@@ -75,4 +75,4 @@ -% end +% end \ No newline at end of file diff --git a/smeserver-manager.spec b/smeserver-manager.spec index 5691a54..21f2261 100644 --- a/smeserver-manager.spec +++ b/smeserver-manager.spec @@ -2,7 +2,7 @@ Summary: Sme server navigation module : manager 2 %define name smeserver-manager Name: %{name} %define version 11.0.0 -%define release 41 +%define release 42 Version: %{version} Release: %{release}%{?dist} License: GPL @@ -115,6 +115,9 @@ true %defattr(-,root,root) %changelog +* Fri Jan 17 2025 Brian Read 11.0.0-42.sme +- Implement password visibility icon - [SME: 12803] + * Wed Jan 15 2025 Brian Read 11.0.0-41.sme - Add journal files to those not viewable [SME: 12870]