Append an option to customize Manager CSS (#2761)

This commit is contained in:
Christophe Maudoux 2022-06-18 18:48:37 +02:00
parent 7f62ad0469
commit a9941e043f
12 changed files with 28 additions and 11 deletions

View File

@ -40,6 +40,7 @@ viewerAllowDiff = 1
staticPrefix = /static
instanceName = Demo
;customCSS = css/custom.css
languages = fr, en, vi, ar, it, zh, tr, zh_TW, es
templateDir = __pwd__/lemonldap-ng-manager/site/templates

View File

@ -37,6 +37,7 @@ viewerAllowDiff = 1
staticPrefix = /static
instanceName = Demo
;customCSS = css/custom.css
languages = fr, en, vi, ar, it, zh, tr, zh_TW, es
templateDir = __pwd__/lemonldap-ng-manager/site/templates

View File

@ -48,6 +48,7 @@ viewerAllowBrowser = 1
viewerAllowDiff = 1
staticPrefix = /static
;customCSS = css/custom.css
instanceName = Demo
languages = fr, en, vi, ar, it, zh, tr, zh_TW, es
templateDir = __pwd__/lemonldap-ng-manager/site/templates

View File

@ -376,9 +376,12 @@ protection = manager
; staticPrefix: relative (or URL) location of static HTML components
staticPrefix = __MANAGERSTATICDIR__
;
; instanceName: Display current LLNG instance into Manager
;instanceName = Demo
; customCSS: CSS file to customize Manager
;customCSS = css/custom.css
; location of HTML templates directory
templateDir = __MANAGERTEMPLATESDIR__

View File

@ -6,7 +6,7 @@ use JSON;
use Lemonldap::NG::Common::PSGI::Constants;
use Lemonldap::NG::Common::PSGI::Request;
our $VERSION = '2.0.10';
our $VERSION = '2.0.15';
our $_json = JSON->new->allow_nonref;
@ -18,6 +18,7 @@ has logLevel => ( is => 'rw', isa => 'Str', default => 'info' );
has portal => ( is => 'rw', isa => 'Str' );
has staticPrefix => ( is => 'rw', isa => 'Str' );
has instanceName => ( is => 'rw', isa => 'Str', default => '' );
has customCSS => ( is => 'rw', isa => 'Str', default => '' );
has templateDir => ( is => 'rw', isa => 'Str|ArrayRef' );
has links => ( is => 'rw', isa => 'ArrayRef' );
has menuLinks => ( is => 'rw', isa => 'ArrayRef' );
@ -308,6 +309,7 @@ sub sendHtml {
$htpl->param(
STATIC_PREFIX => $sp,
INSTANCE_NAME => $self->instanceName,
CUSTOM_CSS => $self->customCSS,
SCRIPTNAME => $sc,
( $self->can('tplParams') ? ( $self->tplParams($req) ) : () ),
(

View File

@ -93,6 +93,8 @@ site/htdocs/static/bwr/es5-shim/es5-shim.min.js
site/htdocs/static/bwr/file-saver.js/FileSaver.js
site/htdocs/static/bwr/file-saver.js/FileSaver.min.js
site/htdocs/static/bwr/file-saver.js/FileSaver.min.js.map
site/htdocs/static/css/custom.css
site/htdocs/static/css/custom.min.css
site/htdocs/static/css/manager.css
site/htdocs/static/css/manager.min.css
site/htdocs/static/forms/authChoice.html

View File

@ -183,14 +183,12 @@ sub javascript {
return
'var formPrefix=staticPrefix+"forms/";var confPrefix=scriptname+"confs/";var viewPrefix=scriptname+"view/";'
. 'var allowDiff=' . "$res;"
. 'var impPrefix=' . "'"
. $impPrefix . "'" . ';'
. 'var sessionTTL=' . "$ttl;"
. "var allowDiff=$res;"
. "var sessionTTL=$ttl;"
. "var impPrefix='$impPrefix';"
. ( $self->links ? 'var links=' . to_json( $self->links ) . ';' : '' )
. (
$self->menuLinks
? 'var menulinks=' . to_json( $self->menuLinks ) . ';'
$self->menuLinks ? 'var menulinks=' . to_json( $self->menuLinks ) . ';'
: ''
);
}

View File

@ -0,0 +1,3 @@
#navbar {
background-color: #ffb84d;
}

View File

@ -0,0 +1 @@
#navbar{background-color:#ffb84d}

View File

@ -35,4 +35,7 @@
<link rel="stylesheet" type="text/css" href="<TMPL_VAR NAME="STATIC_PREFIX">bwr/bootstrap/dist/css/bootstrap-theme.css" />
<link rel="stylesheet" type="text/css" href="<TMPL_VAR NAME="STATIC_PREFIX">bwr/angular-bootstrap/ui-bootstrap-csp.css" />
<link rel="stylesheet" type="text/css" href="<TMPL_VAR NAME="STATIC_PREFIX">css/manager.css" />
<TMPL_IF NAME="CUSTOM_CSS">
<link rel="stylesheet" type="text/css" href="<TMPL_VAR NAME="STATIC_PREFIX"><TMPL_VAR NAME="CUSTOM_CSS">" />
</TMPL_IF>
<!-- //endif -->

View File

@ -59,8 +59,8 @@ lib/Lemonldap/NG/Portal/Issuer/Get.pm
lib/Lemonldap/NG/Portal/Issuer/OpenID.pm
lib/Lemonldap/NG/Portal/Issuer/OpenIDConnect.pm
lib/Lemonldap/NG/Portal/Issuer/SAML.pm
lib/Lemonldap/NG/Portal/Lib/_tokenRule.pm
lib/Lemonldap/NG/Portal/Lib/2fDevices.pm
lib/Lemonldap/NG/Portal/Lib/_tokenRule.pm
lib/Lemonldap/NG/Portal/Lib/Captcha.pm
lib/Lemonldap/NG/Portal/Lib/CAS.pm
lib/Lemonldap/NG/Portal/Lib/Choice.pm
@ -564,8 +564,8 @@ t/30-Auth-and-issuer-SAML-POST.t
t/30-Auth-and-issuer-SAML-Redirect-IdP-initiated.t
t/30-Auth-and-issuer-SAML-Redirect-MultipleSP-Missing-SLO.t
t/30-Auth-and-issuer-SAML-Redirect-MultipleSP.t
t/30-Auth-and-issuer-SAML-Redirect.t
t/30-Auth-and-issuer-SAML-Redirect-With-Info.t
t/30-Auth-and-issuer-SAML-Redirect.t
t/30-Auth-ResolutionRule.t
t/30-Auth-SAML-with-choice.t
t/30-CDC.t
@ -671,6 +671,7 @@ t/40-Notifications-JSON-Server.t
t/40-Notifications-XML-DBI.t
t/40-Notifications-XML-File.t
t/40-Notifications-XML-Server.t
t/41-Captcha-old-api.t
t/41-Captcha.t
t/41-Token-with-global-storage.t
t/41-Token.t
@ -820,6 +821,7 @@ t/99-Bad-logLevel.t
t/99-Dont-load-Dumper.t
t/99-pod.t
t/AfterDataCustomPlugin.pm
t/CaptchaOldApi.pm
t/CasHookPlugin.pm
t/Custom.pm
t/gpghome/key.asc

View File

@ -101,7 +101,7 @@ sub run {
TOKEN => $token,
};
return $self->p->sendJSONresponse( $req, $params )
if ( $req->wantJSON );
if $req->wantJSON;
return $self->p->sendHtml( $req, 'decryptvalue', params => $params )
if $msg;
}