Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 2 additions & 31 deletions lib/auth/bento-theme/login/template.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@
<script type="importmap">
{
"imports": {
"alpinejs": "${url.resourcesCommonPath}/node_modules/alpinejs/dist/module.esm.js",
"rfc4648": "${url.resourcesCommonPath}/node_modules/rfc4648/lib/rfc4648.js"
"rfc4648": "${url.resourcesCommonPath}/vendor/rfc4648/rfc4648.js"
}
}
</script>
Expand Down Expand Up @@ -57,30 +56,7 @@

<body id="keycloak-bg" class="${properties.kcBodyClass!}">

<div class="pf-v5-c-login"
x-data="{
open: false,
toggle() {
if (this.open) {
return this.close()
}

this.$refs.button.focus()

this.open = true
},
close(focusAfter) {
if (! this.open) return

this.open = false

focusAfter && focusAfter.focus()
}
}"
x-on:keydown.escape.prevent.stop="close($refs.button)"
x-on:focusin.window="! $refs.panel?.contains($event.target) && close()"
x-id="['language-select']"
>
<div class="pf-v5-c-login">
<div id="kc-header" class="${properties.kcHeaderClass!}">
<div class="kc-logo-text">
<img src="${url.resourcesPath}/img/branding.png" alt="${kcSanitize(msg("loginTitleHtml",(realm.displayNameHtml!'')))?no_esc}" />
Expand Down Expand Up @@ -211,11 +187,6 @@
</main>
</div>
</div>
<script type="module">
import Alpine from "alpinejs";

Alpine.start();
</script>
<img src="${url.resourcesPath}/img/Bento_logo_blk.png" alt="Bento Logo" class="bento-logo" />
</body>
</html>
Expand Down
66 changes: 23 additions & 43 deletions lib/auth/bento-theme/login/user-profile-commons.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,7 @@
</#if>

<#nested "beforeField" attribute>
<div class="${properties.kcFormGroupClass!}" x-data="{
values: [{ value: '${(attribute.value!'')}' }],
kcMultivalued: ${attribute.html5DataAnnotations?keys?seq_contains('kcMultivalued')?string('true', 'false')}
}"
>
<div class="${properties.kcFormGroupClass!}">
<label for="${attribute.name}" class="${properties.kcLabelClass!}">
<span class="pf-v5-c-form__label-text">
${advancedMsg(attribute.displayName!'')}
Expand All @@ -48,41 +44,20 @@
</#if>
</span>
</label>
<template x-for="(item, index) in values">
<div :class="kcMultivalued ? 'pf-v5-c-input-group' : ''">
<div :class="kcMultivalued ? 'pf-v5-c-input-group__item pf-m-fill' : ''">
<span class="${properties.kcInputClass!}" >
<#if attribute.annotations.inputHelperTextBefore??>
<div class="${properties.kcInputHelperTextBeforeClass!}" id="form-help-text-before-${attribute.name}" aria-live="polite">${kcSanitize(advancedMsg(attribute.annotations.inputHelperTextBefore))?no_esc}</div>
</#if>
<@inputFieldByType attribute=attribute/>
<#if messagesPerField.existsError('${attribute.name}')>
<span id="input-error-${attribute.name}" class="${properties.kcInputErrorMessageClass!}" aria-live="polite">
${kcSanitize(messagesPerField.get('${attribute.name}'))?no_esc}
</span>
</#if>
<#if attribute.annotations.inputHelperTextAfter??>
<div class="${properties.kcInputHelperTextAfterClass!}" id="form-help-text-after-${attribute.name}" aria-live="polite">${kcSanitize(advancedMsg(attribute.annotations.inputHelperTextAfter))?no_esc}</div>
</#if>
<span class="${properties.kcInputClass!}">
<#if attribute.annotations.inputHelperTextBefore??>
<div class="${properties.kcInputHelperTextBeforeClass!}" id="form-help-text-before-${attribute.name}" aria-live="polite">${kcSanitize(advancedMsg(attribute.annotations.inputHelperTextBefore))?no_esc}</div>
</#if>
<@inputFieldByType attribute=attribute/>
<#if messagesPerField.existsError('${attribute.name}')>
<span id="input-error-${attribute.name}" class="${properties.kcInputErrorMessageClass!}" aria-live="polite">
${kcSanitize(messagesPerField.get('${attribute.name}'))?no_esc}
</span>
</div>
<div class="pf-v5-c-input-group__item" x-show="kcMultivalued">
<button
class="pf-v5-c-button pf-m-control"
type="button"
:id="$id('add-name-${attribute.name}')"
x-bind:disabled="index == 0 && values.length == 1"
x-on:click="values.splice(index, 1); $dispatch('bind')"
>
<svg fill="currentColor" height="1em" width="1em" viewBox="0 0 512 512" aria-hidden="true" role="img" style="vertical-align: -0.125em;"><path d="M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zM124 296c-6.6 0-12-5.4-12-12v-56c0-6.6 5.4-12 12-12h264c6.6 0 12 5.4 12 12v56c0 6.6-5.4 12-12 12H124z"></path></svg>
</button>
</div>
</div>
</template>
<button type="button" class="pf-v5-c-button pf-m-link" x-show="kcMultivalued" x-on:click="values.push({ value: '' }); $dispatch('bind')">
<svg fill="currentColor" height="1em" width="1em" viewBox="0 0 512 512" aria-hidden="true" role="img" style="vertical-align: -0.125em;"><path d="M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm144 276c0 6.6-5.4 12-12 12h-92v92c0 6.6-5.4 12-12 12h-56c-6.6 0-12-5.4-12-12v-92h-92c-6.6 0-12-5.4-12-12v-56c0-6.6 5.4-12 12-12h92v-92c0-6.6 5.4-12 12-12h56c6.6 0 12 5.4 12 12v92h92c6.6 0 12 5.4 12 12v56z"></path></svg>
Add ${advancedMsg(attribute.displayName!'')}
</button>
</#if>
<#if attribute.annotations.inputHelperTextAfter??>
<div class="${properties.kcInputHelperTextAfterClass!}" id="form-help-text-after-${attribute.name}" aria-live="polite">${kcSanitize(advancedMsg(attribute.annotations.inputHelperTextAfter))?no_esc}</div>
</#if>
</span>
</div>
<#nested "afterField" attribute>
</#list>
Expand All @@ -106,12 +81,18 @@
<@inputTagSelects attribute=attribute/>
<#break>
<#default>
<@inputTag attribute=attribute/>
<#if attribute.multivalued && attribute.values?has_content>
<#list attribute.values as value>
<@inputTag attribute=attribute value=value!''/>
</#list>
<#else>
<@inputTag attribute=attribute value=(attribute.value!attribute.defaultValue!'')/>
</#if>
</#switch>
</#macro>

<#macro inputTag attribute>
<input type="<@inputTagType attribute=attribute/>" :id="$id('name-${attribute.name}')" name="${attribute.name}" class="${properties.kcInputClass!}"
<#macro inputTag attribute value>
<input type="<@inputTagType attribute=attribute/>" id="${attribute.name}" name="${attribute.name}" value="${value}" class="${properties.kcInputClass!}"
aria-invalid="<#if messagesPerField.existsError('${attribute.name}')>true</#if>"
<#if attribute.readOnly>disabled</#if>
<#if attribute.autocomplete??>autocomplete="${attribute.autocomplete}"</#if>
Expand All @@ -123,7 +104,6 @@
<#if attribute.annotations.inputTypeMax??>max="${attribute.annotations.inputTypeMax}"</#if>
<#if attribute.annotations.inputTypeMin??>min="${attribute.annotations.inputTypeMin}"</#if>
<#if attribute.annotations.inputTypeStep??>step="${attribute.annotations.inputTypeStep}"</#if>
<#if attribute.annotations.inputTypeStep??>step="${attribute.annotations.inputTypeStep}"</#if>
<#list attribute.html5DataAnnotations as key, value>
data-${key}="${value}"
</#list>
Expand Down
Loading