diff -urN smeserver-manager-0.1.4.old/root/etc/e-smith/templates/usr/share/smanager/conf/srvmngr.conf/28hasJquery smeserver-manager-0.1.4/root/etc/e-smith/templates/usr/share/smanager/conf/srvmngr.conf/28hasJquery --- smeserver-manager-0.1.4.old/root/etc/e-smith/templates/usr/share/smanager/conf/srvmngr.conf/28hasJquery 1970-01-01 04:00:00.000000000 +0400 +++ smeserver-manager-0.1.4/root/etc/e-smith/templates/usr/share/smanager/conf/srvmngr.conf/28hasJquery 2022-01-03 12:27:43.000000000 +0400 @@ -0,0 +1,2 @@ + # is js-jquery available + hasJquery => { -f '/usr/share/smanager/themes/default/public/js/jquery.min.js' ? '1' : '0'; }, diff -urN smeserver-manager-0.1.4.old/root/etc/e-smith/templates/usr/share/smanager/themes/default/public/css/styles.css/50body smeserver-manager-0.1.4/root/etc/e-smith/templates/usr/share/smanager/themes/default/public/css/styles.css/50body --- smeserver-manager-0.1.4.old/root/etc/e-smith/templates/usr/share/smanager/themes/default/public/css/styles.css/50body 2022-01-05 12:30:15.000000000 +0400 +++ smeserver-manager-0.1.4/root/etc/e-smith/templates/usr/share/smanager/themes/default/public/css/styles.css/50body 2021-12-22 23:07:33.000000000 +0400 @@ -192,13 +192,13 @@ font-weight: bold; } -.section { +a.section { } .a, .item { line-height: 12px; } -.section-title { +a.section-title { display: inline-block; color: #6CA345; /*#888;*/ padding-left: 5px; @@ -256,7 +256,16 @@ text-align: center; } -/*end*/ +.toggle-password { + margin-left: -30px; +} +.tg-icon { + position: relative; + top: 5px; + left: 2px; +} + +/*end*/ EOF } diff -urN smeserver-manager-0.1.4.old/root/usr/share/smanager/lib/SrvMngr/Plugin/CSRFDefender.pm smeserver-manager-0.1.4/root/usr/share/smanager/lib/SrvMngr/Plugin/CSRFDefender.pm --- smeserver-manager-0.1.4.old/root/usr/share/smanager/lib/SrvMngr/Plugin/CSRFDefender.pm 2022-01-05 12:30:15.000000000 +0400 +++ smeserver-manager-0.1.4/root/usr/share/smanager/lib/SrvMngr/Plugin/CSRFDefender.pm 2022-01-05 13:59:23.942000000 +0400 @@ -84,7 +84,9 @@ my $session_token = $c->session($s_name); # POST method or local GET with params. - if ( $c->req->method eq 'POST' or ( $c->req->method eq 'GET' && %{$c->req->params->to_hash} ) ) { +# if ( $c->req->method eq 'POST' or ( $c->req->method eq 'GET' && %{$c->req->params->to_hash} ) ) { +# POST method or local GET with param csrftoken present + if ( $c->req->method eq 'POST' or ( $c->req->method eq 'GET' && $request_token ) ) { return 0 unless $request_token; return 0 unless $session_token; return 0 unless $request_token eq $session_token; diff -urN smeserver-manager-0.1.4.old/root/usr/share/smanager/lib/SrvMngr.pm smeserver-manager-0.1.4/root/usr/share/smanager/lib/SrvMngr.pm --- smeserver-manager-0.1.4.old/root/usr/share/smanager/lib/SrvMngr.pm 2022-01-05 12:30:15.000000000 +0400 +++ smeserver-manager-0.1.4/root/usr/share/smanager/lib/SrvMngr.pm 2022-01-05 13:45:34.891000000 +0400 @@ -23,7 +23,7 @@ use SrvMngr::Model::Main; -our $VERSION = '1.410'; +our $VERSION = '1.411'; $VERSION = eval $VERSION; use Exporter 'import'; diff -urN smeserver-manager-0.1.4.old/root/usr/share/smanager/themes/default/templates/layouts/default.html.ep smeserver-manager-0.1.4/root/usr/share/smanager/themes/default/templates/layouts/default.html.ep --- smeserver-manager-0.1.4.old/root/usr/share/smanager/themes/default/templates/layouts/default.html.ep 2021-06-21 13:25:10.000000000 +0400 +++ smeserver-manager-0.1.4/root/usr/share/smanager/themes/default/templates/layouts/default.html.ep 2022-01-03 12:03:07.000000000 +0400 @@ -12,8 +12,10 @@ %= stylesheet '/css/sme_menu.css' %= stylesheet '/css/styles.css' %= content_for 'head_contrib' - %= include 'partials/_js_imports' - %= include 'common_js' + % if (config 'hasJquery') { + %= include 'partials/_js_imports' + %= include 'common_js' + % } %= content_for 'refresh' @@ -24,13 +26,15 @@
- %= content 'js_toggleMenu' + % if (config 'hasJquery') { + %= content 'js_toggleMenu' + % }
- %= content 'js_swapClass' + % if (config 'hasJquery') { + %= content 'js_swapClass' + %= content 'js_togglePassword' + % } diff -urN smeserver-manager-0.1.4.old/root/usr/share/smanager/themes/default/templates/login.html.ep smeserver-manager-0.1.4/root/usr/share/smanager/themes/default/templates/login.html.ep --- smeserver-manager-0.1.4.old/root/usr/share/smanager/themes/default/templates/login.html.ep 2022-01-05 12:30:15.000000000 +0400 +++ smeserver-manager-0.1.4/root/usr/share/smanager/themes/default/templates/login.html.ep 2022-01-05 14:09:14.947000000 +0400 @@ -36,7 +36,10 @@

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

%= hidden_field 'From' => $c->tx->req->url diff -urN smeserver-manager-0.1.4.old/root/usr/share/smanager/themes/default/templates/partials/_js_imports.html.ep smeserver-manager-0.1.4/root/usr/share/smanager/themes/default/templates/partials/_js_imports.html.ep --- smeserver-manager-0.1.4.old/root/usr/share/smanager/themes/default/templates/partials/_js_imports.html.ep 2020-11-19 11:53:26.000000000 +0400 +++ smeserver-manager-0.1.4/root/usr/share/smanager/themes/default/templates/partials/_js_imports.html.ep 2021-12-22 16:45:36.000000000 +0400 @@ -1,4 +1,30 @@ + + +% content_for 'js_togglePassword' => begin + %= javascript begin + + $(document).ready(function() { + + const togglePassword = document.querySelector('#togglePassword'); + const password = document.querySelector('#id_password'); + + if (( togglePassword ) && ( password )) { + togglePassword.addEventListener('click', function (e) { + // toggle the type attribute + const type = password.getAttribute('type') === 'password' ? 'text' : 'password'; + password.setAttribute('type', type); + // toggle the eye slash icon + // this.classList.toggle('eye-slash'); + }) + } + }); + + % end +% end + + + % content_for 'js_toggleMenu' => begin %= javascript begin @@ -7,16 +33,26 @@ $('#menunav').toggle({ duration: 300 }); }); $('#toguser').click(function() { - $('#menuuser').toggle({ duration: 600 }); + $('#menuuser').toggle({ duration: 300 }); }); $('#togadm').click(function() { - $('#menuadm').toggle({ duration: 900 }); + $('#menuadm').toggle({ duration: 300 }); }); + $('.section-title').click(function() { + var $section = $(this).parent().next('div'); + if(!$section.length){ + // alert('No element found!'); + return false; + } + $section.toggle({ duration: 600 }); + }) }); % end % end + + % content_for 'js_swapClass' => begin %= javascript begin (function($) { diff -urN smeserver-manager-0.1.4.old/root/usr/share/smanager/themes/default/templates/partials/_navig2.html.ep smeserver-manager-0.1.4/root/usr/share/smanager/themes/default/templates/partials/_navig2.html.ep --- smeserver-manager-0.1.4.old/root/usr/share/smanager/themes/default/templates/partials/_navig2.html.ep 2020-11-19 11:53:26.000000000 +0400 +++ smeserver-manager-0.1.4/root/usr/share/smanager/themes/default/templates/partials/_navig2.html.ep 2021-12-22 13:10:50.000000000 +0400 @@ -2,14 +2,14 @@ % my %nav = %{SrvMngr->getNavigation( $c->languages(), 'A' )};