Append go-to-top button & Doc (#2759)

This commit is contained in:
Christophe Maudoux 2022-06-02 23:39:00 +02:00
parent 91cff59628
commit 78bd430057
31 changed files with 110 additions and 38 deletions

View File

@ -208,7 +208,7 @@ Password
- **Allow a user to reset his expired password**: if activated, the
user will be prompted to change password if his password is expired
(default: disabled)
- **Search for user before password change**: this option forces the password
- **Search for user before password change**: this option forces the password
change module to search for the user again, refreshing its DN. This feature
is only useful in rare cases when you use LDAP as the password module, but
not as the UserDB module. (default: enabled)

View File

@ -22,7 +22,7 @@ A blank value disables Main logo display.
- Main logo is included in Portal templates AND mail body
Favicon
~~~~~~~~~~~~~~~~~~~~~
~~~~~~~
You can change the default favicon in Manager: General Parameters >
Portal > Customization > Favicon.
@ -49,6 +49,14 @@ Option enabled by default.
your browser (EN by default).
Scroll to top button
~~~~~~~~~~~~~~~~~~~~
You can display a button to go to back to the top after <value> pixels scrolling.
.. tip::
A blank or null value disable this feature.
Custom CSS file
~~~~~~~~~~~~~~~

View File

@ -342,6 +342,7 @@ sub defaultValues {
'samlSPSSODescriptorSingleLogoutServiceSOAP' =>
'urn:oasis:names:tc:SAML:2.0:bindings:SOAP;#PORTAL#/saml/proxySingleLogoutSOAP;',
'samlSPSSODescriptorWantAssertionsSigned' => 1,
'scrollTop' => 400,
'securedCookie' => 0,
'sfEngine' => '::2F::Engines::Default',
'sfManagerRule' => 1,

View File

@ -3947,6 +3947,10 @@ qr/(?:(?:https?):\/\/(?:(?:(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.]
'default' => 0,
'type' => 'bool'
},
'scrollTop' => {
'default' => 400,
'type' => 'int'
},
'securedCookie' => {
'default' => 0,
'select' => [ {

View File

@ -425,6 +425,11 @@ sub attributes {
default => 1,
documentation => 'Display langs icons',
},
scrollTop => {
type => 'int',
default => 400,
documentation => 'Display back to top button',
},
staticPrefix => {
type => 'text',
documentation => 'Prefix of static files for HTML templates',

View File

@ -55,6 +55,7 @@ sub tree {
'portalMainLogo',
'portalFavicon',
'showLanguages',
'scrollTop',
'portalCustomCss',
'portalSkin',
'portalSkinBackground',

View File

@ -1056,6 +1056,7 @@
"saveReport":"احفظ التقرير",
"savingConfirmation":"حفظ التأكيد",
"scope":"نطاق",
"scrollTop":"Scroll to top button",
"search":"Search...",
"secondFactors":"Second factors",
"securedCookie":"ملفات تعريف الارتباط المضمونة (سسل)",

View File

@ -1056,6 +1056,7 @@
"saveReport":"Save report",
"savingConfirmation":"Saving confirmation",
"scope":"Scope",
"scrollTop":"Scroll to top button",
"search":"Search...",
"secondFactors":"Second factors",
"securedCookie":"Secured Cookie (SSL)",

View File

@ -1056,6 +1056,7 @@
"saveReport":"Salvar informe",
"savingConfirmation":"Salvando confirmación",
"scope":"Ámbito",
"scrollTop":"Scroll to top button",
"search":"Buscar...",
"secondFactors":"Segundos factores",
"securedCookie":"Cookie segura (SSL)",

View File

@ -1056,7 +1056,8 @@
"saveReport":"Rapport de sauvegarde",
"savingConfirmation":"Confirmation de sauvegarde",
"scope":"Scope",
"search":"Rechercher ...",
"scrollTop":"Retour en haut de page",
"search":"Rechercher...",
"secondFactors":"Seconds facteurs",
"securedCookie":"Cookie sécurisé (HTTPS)",
"security":"Sécurité",

View File

@ -1056,6 +1056,7 @@
"saveReport":"שמירת דוח",
"savingConfirmation":"Saving confirmation",
"scope":"היקף",
"scrollTop":"Scroll to top button",
"search":"חיפוש…",
"secondFactors":"Second factors",
"securedCookie":"Secured Cookie (SSL)",

View File

@ -1056,6 +1056,7 @@
"saveReport":"Salva report",
"savingConfirmation":"Salvataggio della conferma",
"scope":"Ambito",
"scrollTop":"Scroll to top button",
"search":"Cerca...",
"secondFactors":"Secondi fattori",
"securedCookie":"Cookie protetti (SSL)",

View File

@ -1056,6 +1056,7 @@
"saveReport":"Zapisz raport",
"savingConfirmation":"Zapisuję potwierdzenie",
"scope":"Zakres",
"scrollTop":"Scroll to top button",
"search":"Szukaj...",
"secondFactors":"Drugi czynnik",
"securedCookie":"Bezpieczne pliki cookie (SSL)",

View File

@ -1056,6 +1056,7 @@
"saveReport":"Raporu kaydet",
"savingConfirmation":"Doğrulama kaydediliyor",
"scope":"Kapsam",
"scrollTop":"Scroll to top button",
"search":"Ara...",
"secondFactors":"İki faktörlü kimlik doğrulama",
"securedCookie":"Güvenli Çerez (SSL)",

View File

@ -1056,6 +1056,7 @@
"saveReport":"Lưu báo cáo",
"savingConfirmation":"Lưu xác nhận",
"scope":"Phạm vi",
"scrollTop":"Scroll to top button",
"search":"Search...",
"secondFactors":"Second factors",
"securedCookie":"Cookie bảo mật (SSL)",

View File

@ -1056,6 +1056,7 @@
"saveReport":"儲存回報",
"savingConfirmation":"正在儲存確認",
"scope":"範圍",
"scrollTop":"Scroll to top button",
"search":"搜尋……",
"secondFactors":"雙因素",
"securedCookie":"安全 Cookie (SSL)",

View File

@ -1056,6 +1056,7 @@
"saveReport":"儲存回報",
"savingConfirmation":"正在儲存確認",
"scope":"範圍",
"scrollTop":"Scroll to top button",
"search":"搜尋……",
"secondFactors":"雙因素",
"securedCookie":"安全 Cookie (SSL)",

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -265,6 +265,7 @@ sub display {
LOGOUT_URL => $self->conf->{portal} . "?logout=1",
APPSLIST_ORDER => $req->{sessionInfo}->{'_appsListOrder'},
PING => $self->conf->{portalPingInterval},
SCROLL_TOP => $self->conf->{scrollTop},
DONT_STORE_PASSWORD => $self->conf->{browsersDontStorePassword},
HIDE_OLDPASSWORD => 0,
PPOLICY_NOPOLICY => !$self->isPP(),

View File

@ -15,7 +15,7 @@ use Lemonldap::NG::Portal::Main::Constants qw(
PE_REGISTERFORMEMPTY
);
our $VERSION = '2.0.14';
our $VERSION = '2.0.15';
extends qw(
Lemonldap::NG::Portal::Main::Plugin
@ -65,14 +65,15 @@ sub display {
# Display form
my $params = {
PORTAL => $self->conf->{portal},
MAIN_LOGO => $self->conf->{portalMainLogo},
SKIN => $self->p->getSkin($req),
LANGS => $self->conf->{showLanguages},
DOWNLOAD => $self->conf->{checkDevOpsDownload},
MSG => 'checkDevOps',
ALERTE => 'alert-info',
TOKEN => (
PORTAL => $self->conf->{portal},
MAIN_LOGO => $self->conf->{portalMainLogo},
SKIN => $self->p->getSkin($req),
LANGS => $self->conf->{showLanguages},
SCROLL_TOP => $self->conf->{scrollTop},
DOWNLOAD => $self->conf->{checkDevOpsDownload},
MSG => 'checkDevOps',
ALERTE => 'alert-info',
TOKEN => (
$self->ottRule->( $req, {} )
? $self->ott->createToken()
: ''

View File

@ -9,7 +9,7 @@ use Lemonldap::NG::Portal::Main::Constants qw(
PE_BADCREDENTIALS
);
our $VERSION = '2.0.14';
our $VERSION = '2.0.15';
extends qw(
Lemonldap::NG::Portal::Main::Plugin
@ -163,6 +163,7 @@ sub display {
MAIN_LOGO => $self->conf->{portalMainLogo},
SKIN => $self->p->getSkin($req),
LANGS => $self->conf->{showLanguages},
SCROLL_TOP => $self->conf->{scrollTop},
MSG => 'checkUser' . $self->merged,
ALERTE => ( $self->merged ? 'alert-warning' : 'alert-info' ),
LOGIN => $req->{userData}->{ $self->conf->{whatToTrace} },
@ -210,14 +211,15 @@ sub check {
}
my $params = {
PORTAL => $self->conf->{portal},
MAIN_LOGO => $self->conf->{portalMainLogo},
SKIN => $self->p->getSkin($req),
LANGS => $self->conf->{showLanguages},
MSG => "PE$msg",
ALERTE => 'alert-warning',
LOGIN => '',
TOKEN => $token,
PORTAL => $self->conf->{portal},
MAIN_LOGO => $self->conf->{portalMainLogo},
SKIN => $self->p->getSkin($req),
LANGS => $self->conf->{showLanguages},
SCROLL_TOP => $self->conf->{scrollTop},
MSG => "PE$msg",
ALERTE => 'alert-warning',
LOGIN => '',
TOKEN => $token,
};
return $self->p->sendJSONresponse( $req, $params )
if $req->wantJSON && $msg;
@ -241,14 +243,15 @@ sub check {
$req,
'checkuser',
params => {
PORTAL => $self->conf->{portal},
MAIN_LOGO => $self->conf->{portalMainLogo},
SKIN => $self->p->getSkin($req),
LANGS => $self->conf->{showLanguages},
MSG => 'PE' . PE_MALFORMEDUSER,
ALERTE => 'alert-warning',
LOGIN => '',
TOKEN => (
PORTAL => $self->conf->{portal},
MAIN_LOGO => $self->conf->{portalMainLogo},
SKIN => $self->p->getSkin($req),
LANGS => $self->conf->{showLanguages},
SCROLL_TOP => $self->conf->{scrollTop},
MSG => 'PE' . PE_MALFORMEDUSER,
ALERTE => 'alert-warning',
LOGIN => '',
TOKEN => (
$self->ottRule->( $req, {} )
? $self->ott->createToken()
: ''
@ -413,6 +416,7 @@ sub check {
MAIN_LOGO => $self->conf->{portalMainLogo},
SKIN => $self->p->getSkin($req),
LANGS => $self->conf->{showLanguages},
SCROLL_TOP => $self->conf->{scrollTop},
MSG => $msg,
ALERTE => ( $msg eq 'checkUser' ? 'alert-info' : 'alert-warning' ),
LOGIN => $user,

View File

@ -20,7 +20,7 @@ use Lemonldap::NG::Portal::Main::Constants qw(
PE_NOTIFICATION
);
our $VERSION = '2.0.10';
our $VERSION = '2.0.15';
extends 'Lemonldap::NG::Portal::Main::Plugin';
@ -193,6 +193,7 @@ sub myNotifs {
MAIN_LOGO => $self->conf->{portalMainLogo},
SKIN => $self->p->getSkin($req),
LANGS => $self->conf->{showLanguages},
SCROLL_TOP => $self->conf->{scrollTop},
NOTIFICATIONS => $_notifications,
MSG => $msg
};

View File

@ -585,3 +585,14 @@ $(window).on 'load', () ->
res = JSON.parse j.responseText if j
if res and res.error
console.log 'Returned error', res
$('#btn-back-to-top').on 'click', () ->
console.log 'Back to top'
document.body.scrollTop = 0
document.documentElement.scrollTop = 0
$(window).on 'scroll', () ->
if datas['scrollTop'] && (document.body.scrollTop > Math.abs(datas['scrollTop']) || document.documentElement.scrollTop > Math.abs(datas['scrollTop']))
$('#btn-back-to-top').css("display","block")
else
$('#btn-back-to-top').css("display","none")

View File

@ -216,3 +216,10 @@ div.input-group > p.form-control > label {
user-select: none;
cursor: pointer;
}
#btn-back-to-top {
position: fixed;
bottom: 70px;
right: 20px;
display: none;
}

View File

@ -1 +1 @@
html,body{height:100%;background:radial-gradient(circle at 50% 0,#fff 0,#ddd 100%) no-repeat scroll 0 0 #ddd}#wrap{min-height:100%;height:auto;margin:0 auto -80px;padding:20px 0 80px}#footer{height:80px;background-color:#fff;background-color:rgba(255,255,255,0.9);text-align:center;padding-top:10px;overflow:hidden}#header img{background-color:#fff;background-color:rgba(255,255,255,0.8);margin-bottom:20px}.card,.navbar-light{background-color:#fff;background-color:rgba(255,255,255,0.9);background-image:none}.login,.password{text-align:center;padding:20px}div.form{margin:0 auto;max-width:330px}div.actions{margin:10px 0 0 0}div.actions a{margin-top:10px}div.actions button{margin-top:10px}.buttons{text-align:center;margin:10px 0 0 0;cursor:pointer}.btn{white-space:normal}.btn span.fa{padding-right:8px}li.ui-state-active{background-color:#fafafa;background-color:rgba(250,250,250,0.9)}#appslist,#password,#loginHistory,#logout,#oidcConsents{margin-top:20px}div.category{margin:10px 0;cursor:grab}div.application{margin:5px 0;overflow:hidden}div.application a,div.application a:hover{text-decoration:none}p.notifCheck label{margin-left:5px;margin-top:3px;display:inline-block}.notif div.form{margin 0 auto;max-width:1024px}.notif .h2,h2{font-size:1.6rem;font-weght:bold;text-align:center}.notif .h3,h3{margin-top:30px;margin-bottom:30px;font-size:1.2rem}.notif .card-title{font-size:1.7rem}img.langicon{cursor:pointer}button.idploop{max-width:300px}button.idploop img{max-height:30px}div.oidc_consent_message>ul{text-align:left;list-style:circle}@media(min-width:768px){div.application{height:80px}div.application h4.appname{margin:0}#wrap{margin:0 auto -60px}#footer{height:60px}}.hiddenFrame{border:0;display:hidden;margin:0}.noborder{border:0}.max{width:100%}.link{cursor:pointer}.nodecor:hover,.nodecor:active,.nodecor:focus{text-decoration:none}.fa.icon-blue{color:blue}.progress-bar-animated{width:100%}input.key{font-family:'password';width:100px}@font-face{font-family:'password';src:url(/static/common/fonts/password.ttf)}.info.table caption{color:black;text-align:center;caption-side:bottom}div.input-group>p.form-control{height:auto}div.input-group>p.form-control>label{display:revert;user-select:none;cursor:pointer}
html,body{height:100%;background:radial-gradient(circle at 50% 0,#fff 0,#ddd 100%) no-repeat scroll 0 0 #ddd}#wrap{min-height:100%;height:auto;margin:0 auto -80px;padding:20px 0 80px}#footer{height:80px;background-color:#fff;background-color:rgba(255,255,255,0.9);text-align:center;padding-top:10px;overflow:hidden}#header img{background-color:#fff;background-color:rgba(255,255,255,0.8);margin-bottom:20px}.card,.navbar-light{background-color:#fff;background-color:rgba(255,255,255,0.9);background-image:none}.login,.password{text-align:center;padding:20px}div.form{margin:0 auto;max-width:330px}div.actions{margin:10px 0 0 0}div.actions a{margin-top:10px}div.actions button{margin-top:10px}.buttons{text-align:center;margin:10px 0 0 0;cursor:pointer}.btn{white-space:normal}.btn span.fa{padding-right:8px}li.ui-state-active{background-color:#fafafa;background-color:rgba(250,250,250,0.9)}#appslist,#password,#loginHistory,#logout,#oidcConsents{margin-top:20px}div.category{margin:10px 0;cursor:grab}div.application{margin:5px 0;overflow:hidden}div.application a,div.application a:hover{text-decoration:none}p.notifCheck label{margin-left:5px;margin-top:3px;display:inline-block}.notif div.form{margin 0 auto;max-width:1024px}.notif .h2,h2{font-size:1.6rem;font-weght:bold;text-align:center}.notif .h3,h3{margin-top:30px;margin-bottom:30px;font-size:1.2rem}.notif .card-title{font-size:1.7rem}img.langicon{cursor:pointer}button.idploop{max-width:300px}button.idploop img{max-height:30px}div.oidc_consent_message>ul{text-align:left;list-style:circle}@media(min-width:768px){div.application{height:80px}div.application h4.appname{margin:0}#wrap{margin:0 auto -60px}#footer{height:60px}}.hiddenFrame{border:0;display:hidden;margin:0}.noborder{border:0}.max{width:100%}.link{cursor:pointer}.nodecor:hover,.nodecor:active,.nodecor:focus{text-decoration:none}.fa.icon-blue{color:blue}.progress-bar-animated{width:100%}input.key{font-family:'password';width:100px}@font-face{font-family:'password';src:url(/static/common/fonts/password.ttf)}.info.table caption{color:black;text-align:center;caption-side:bottom}div.input-group>p.form-control{height:auto}div.input-group>p.form-control>label{display:revert;user-select:none;cursor:pointer}#btn-back-to-top{position:fixed;bottom:70px;right:20px;display:none}

View File

@ -550,7 +550,6 @@ LemonLDAP::NG Portal jQuery scripts
if (datas['dontStorePassword']) {
$(".toggle-password").mousedown(function() {
field = $(this).attr('id');
console.log('Display****', field);
field = field.replace(/^toggle_/, '');
console.log('Display', field);
$(this).toggleClass("fa-eye fa-eye-slash");
@ -565,7 +564,6 @@ LemonLDAP::NG Portal jQuery scripts
} else {
$(".toggle-password").mousedown(function() {
field = $(this).attr('id');
console.log('Display***', field);
field = field.replace(/^toggle_/, '');
console.log('Display', field);
$(this).toggleClass("fa-eye fa-eye-slash");
@ -626,7 +624,7 @@ LemonLDAP::NG Portal jQuery scripts
console.log('Clear modal');
return $('#finduserForm').trigger('reset');
});
return $('#finduserbutton').on('click', function(event) {
$('#finduserbutton').on('click', function(event) {
var str;
event.preventDefault();
document.body.style.cursor = 'progress';
@ -668,6 +666,18 @@ LemonLDAP::NG Portal jQuery scripts
}
});
});
$('#btn-back-to-top').on('click', function() {
console.log('Back to top');
document.body.scrollTop = 0;
return document.documentElement.scrollTop = 0;
});
return $(window).on('scroll', function() {
if (datas['scrollTop'] && (document.body.scrollTop > Math.abs(datas['scrollTop']) || document.documentElement.scrollTop > Math.abs(datas['scrollTop']))) {
return $('#btn-back-to-top').css("display", "block");
} else {
return $('#btn-back-to-top').css("display", "none");
}
});
});
}).call(this);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,11 @@
</div>
<TMPL_IF NAME="SCROLL_TOP">
<button type="button" class="btn btn-danger btn-floating btn-lg" id="btn-back-to-top">
<i class="fa fa-arrow-circle-up"></i>
</button>
</TMPL_IF>
<div id="footer">
<div class="row">
<div class="col-md-2"></div>

View File

@ -39,6 +39,7 @@
},</TMPL_IF>
"enablePasswordDisplay":<TMPL_VAR NAME="ENABLE_PASSWORD_DISPLAY" DEFAULT="0">,
"dontStorePassword":<TMPL_VAR NAME="DONT_STORE_PASSWORD" DEFAULT="0">,
"scrollTop":<TMPL_VAR NAME="SCROLL_TOP" DEFAULT="0">,
"sameSite":"<TMPL_VAR NAME="SAMESITE">"
}
</script>