Add an option to change the doc URL prefix (#2285)

This commit is contained in:
Maxime Besson 2020-08-20 00:26:55 +02:00
parent b0c53126ee
commit ee46c5c6a7
17 changed files with 12 additions and 15 deletions

View File

@ -65,6 +65,7 @@ MANAGERSITEDIR=$(MANAGERDIR)/htdocs
MANAGERAPIDIR=$(MANAGERDIR)/api
MANAGERSTATICDIR=$(MANAGERSITEDIR)/static
MANAGERRELATIVESTATICDIR=/static
MANAGERRELATIVEDOCDIR=/doc
MANAGERTEMPLATESDIR=$(MANAGERSITEDIR)/templates
DOCDIR=$(DOCUMENTROOT)
DEFDOCDIR=$(DOCUMENTROOT)/doc
@ -806,6 +807,7 @@ install_manager_site: install_conf_dir
@rm -rf $$(find ${RMANAGERSTATICDIR} \
$(RMANAGERTEMPLATESDIR) $(RCONFDIR) -type d -name .svn)
@$(PERL) -i -pe 's#__MANAGERSTATICDIR__#$(MANAGERRELATIVESTATICDIR)#g' $(RCONFDIR)/$(CONFFILENAME)
@$(PERL) -i -pe 's#__MANAGERDOCDIR__#$(MANAGERRELATIVEDOCDIR)#g' $(RCONFDIR)/$(CONFFILENAME)
@$(PERL) -i -pe 's#__MANAGERTEMPLATESDIR__#$(MANAGERTEMPLATESDIR)#g' $(RCONFDIR)/$(CONFFILENAME)
install_portal_site: install_conf_dir

View File

@ -376,6 +376,8 @@ protection = manager
; staticPrefix: relative (or URL) location of static HTML components
staticPrefix = __MANAGERSTATICDIR__
; docPrefix: relative (or URL) location of embedded documentation
docPrefix = __MANAGERDOCDIR__
; instanceName: Display current LLNG instance into Manager
;instanceName = Demo

View File

@ -167,7 +167,11 @@ sub tplParams {
my $res = eval {
$self->hLoadedPlugins->{viewer}->brwRule->( $req, $req->{userData} );
} || 0;
return ( VERSION => $VERSION, ALLOWBROWSER => $res );
return (
VERSION => $VERSION,
ALLOWBROWSER => $res,
DOC_PREFIX => ( $self->{docPrefix} || '/doc' ),
);
}
sub javascript {

View File

@ -1,5 +1,4 @@
{
"/doc/":"/doc/",
"2faSessions":"2ndFA sessions explorer",
"2ndFA":"Second Factors",
"ADPwdExpireWarning":"تحذير انتهاء صلاحية كلمة المرور",

View File

@ -1,5 +1,4 @@
{
"/doc/":"/doc/",
"2faSessions":"2ndFA sessions explorer",
"2ndFA":"Second Factors",
"ADPwdExpireWarning":"Password expire warning",

View File

@ -1,5 +1,4 @@
{
"/doc/":"/doc/",
"2faSessions":"Explorador de sesiones 2snFA",
"2ndFA":"Segundos Factores",
"ADPwdExpireWarning":"Alerta de caducidad de la contraseña",

View File

@ -1,5 +1,4 @@
{
"/doc/":"/doc/",
"2faSessions":"Explorateur sessions 2ndFA",
"2ndFA":"Seconds Facteurs",
"ADPwdExpireWarning":"Avertissement avant expiration du mot de passe",

View File

@ -1,5 +1,4 @@
{
"/doc/":"/doc/",
"2faSessions":"חוקר הפעלות אימות דו־שלבי",
"2ndFA":"גורמים נוספים",
"ADPwdExpireWarning":"אזהרת תפוגת סיסמה",

View File

@ -1,5 +1,4 @@
{
"/doc/":"/doc/",
"2faSessions":"Esploratore di sessioni 2ndFA",
"2ndFA":"Secondi fattori",
"ADPwdExpireWarning":"Avviso di scadenza password",

View File

@ -1,5 +1,4 @@
{
"/doc/":"/doc/",
"2faSessions":"Eksplorator sesji 2ndFA",
"2ndFA":"Drugie czynniki",
"ADPwdExpireWarning":"Ostrzeżenie o wygaśnięciu hasła",

View File

@ -1,5 +1,4 @@
{
"/doc/":"/doc/",
"2faSessions":"2ndFA oturumları gezgini",
"2ndFA":"İki Faktörlü Kimlik Doğrulama",
"ADPwdExpireWarning":"Parola kullanım süresi uyarısı",

View File

@ -1,5 +1,4 @@
{
"/doc/":"/doc/",
"2faSessions":"2ndFA sessions explorer",
"2ndFA":"Second Factors",
"ADPwdExpireWarning":"Cảnh báo mật khẩu hết hạn",

View File

@ -1,5 +1,4 @@
{
"/doc/":"/zh-doc/",
"2faSessions":"雙因素驗證工作階段探索程式",
"2ndFA":"雙因素",
"ADPwdExpireWarning":"密码过期警告",

View File

@ -1,5 +1,4 @@
{
"/doc/":"/doc/",
"2faSessions":"雙因素驗證工作階段探索程式",
"2ndFA":"雙因素",
"ADPwdExpireWarning":"密碼過期警告",

View File

@ -7,7 +7,7 @@
<div class="container text-center">
<h1>LemonLDAP::NG Manager API</h1>
<hr />
<a href="/doc/pages/manager-api/index.html" class="btn btn-lg btn-primary">API Reference</a>
<a href="<TMPL_VAR NAME="DOC_PREFIX">/pages/manager-api/index.html" class="btn btn-lg btn-primary">API Reference</a>
</div>
</body>
</html>

View File

@ -61,7 +61,7 @@
<div id="bottom" ng-if="showH" class="hidden-xs">
<div class="panel panel-default">
<div class="panel-body">
<iframe id="helpframe" width="100%" height="100%" ng-src="{{translate('/doc/')+'pages/documentation/current/'+helpUrl}}" frameborder="0"></iframe>
<iframe id="helpframe" width="100%" height="100%" ng-src="{{'<TMPL_VAR NAME="DOC_PREFIX">/pages/documentation/current/'+helpUrl}}" frameborder="0"></iframe>
</div>
</div>
</div>

View File

@ -59,7 +59,7 @@
<div id="bottom" ng-if="showH" class="hidden-xs">
<div class="panel panel-default">
<div class="panel-body">
<iframe id="helpframe" width="100%" height="100%" ng-src="{{translate('/doc/')+'pages/documentation/current/'+helpUrl}}" frameborder="0"></iframe>
<iframe id="helpframe" width="100%" height="100%" ng-src="{{'<TMPL_VAR NAME="DOC_PREFIX">/pages/documentation/current/'+helpUrl}}" frameborder="0"></iframe>
</div>
</div>
</div>