Enabling shorter import paths [automatic]
This commit is contained in:
113
bin/build-keycloak-theme/generateFtl/ftl2js.ftl
Normal file
113
bin/build-keycloak-theme/generateFtl/ftl2js.ftl
Normal file
@ -0,0 +1,113 @@
|
||||
<script>const _=
|
||||
{
|
||||
"url": {
|
||||
"loginAction": "${url.loginAction}",
|
||||
"resourcesPath": "${url.resourcesPath}",
|
||||
"resourcesCommonPath": "${url.resourcesCommonPath}",
|
||||
"loginRestartFlowUrl": "${url.loginRestartFlowUrl}"
|
||||
},
|
||||
"realm": {
|
||||
"displayName": "${realm.displayName!''}" || undefined,
|
||||
"displayNameHtml": "${realm.displayNameHtml!''}" || undefined,
|
||||
"internationalizationEnabled": ${realm.internationalizationEnabled?c}
|
||||
},
|
||||
"locale": (function (){
|
||||
|
||||
<#if realm.internationalizationEnabled>
|
||||
|
||||
return {
|
||||
"supported": (function(){
|
||||
|
||||
<#if realm.internationalizationEnabled>
|
||||
|
||||
var out= [];
|
||||
|
||||
<#list locale.supported as lng>
|
||||
out.push({
|
||||
"url": "${lng.url}",
|
||||
"label": "${lng.label}",
|
||||
"languageTag": "${lng.languageTag}"
|
||||
});
|
||||
</#list>
|
||||
|
||||
return out;
|
||||
|
||||
</#if>
|
||||
|
||||
return undefined;
|
||||
|
||||
})(),
|
||||
"current": "${locale.current}"
|
||||
};
|
||||
|
||||
</#if>
|
||||
|
||||
return undefined;
|
||||
|
||||
})(),
|
||||
"auth": (function (){
|
||||
|
||||
|
||||
<#if auth?has_content>
|
||||
|
||||
var out= {
|
||||
"showUsername": ${auth.showUsername()?c},
|
||||
"showResetCredentials": ${auth.showResetCredentials()?c},
|
||||
"showTryAnotherWayLink": ${auth.showTryAnotherWayLink()?c}
|
||||
};
|
||||
|
||||
<#if auth.showUsername() && !auth.showResetCredentials()>
|
||||
Object.assign(
|
||||
out,
|
||||
{
|
||||
"attemptedUsername": "${auth.attemptedUsername}"
|
||||
}
|
||||
);
|
||||
</#if>
|
||||
|
||||
return out;
|
||||
|
||||
</#if>
|
||||
|
||||
|
||||
return undefined;
|
||||
|
||||
})(),
|
||||
"scripts": (function(){
|
||||
|
||||
var out = [];
|
||||
|
||||
<#if scripts??>
|
||||
<#list scripts as script>
|
||||
out.push("${script}");
|
||||
</#list>
|
||||
</#if>
|
||||
|
||||
return out;
|
||||
|
||||
})(),
|
||||
"message": (function (){
|
||||
|
||||
<#if message?has_content>
|
||||
|
||||
return {
|
||||
"type": "${message.type}",
|
||||
"summary": "${kcSanitize(message.summary)?no_esc}"
|
||||
};
|
||||
|
||||
</#if>
|
||||
|
||||
return undefined;
|
||||
|
||||
})(),
|
||||
"isAppInitiatedAction": (function (){
|
||||
|
||||
<#if isAppInitiatedAction??>
|
||||
return true;
|
||||
</#if>
|
||||
return false;
|
||||
|
||||
})()
|
||||
|
||||
}
|
||||
</script>
|
Reference in New Issue
Block a user