Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update register page #1

Merged
merged 5 commits into from
Jan 14, 2025
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Je kan de componenten die gebruikt worden selecteren per realm via het admin pan

## Publiceren


Om deze keycloak theme te bouwen kan men de volgende commandos uitvoeren. De commandos gaan er vanuit dat je [node](https://nodejs.org/en/download) en [java](https://www.azul.com/downloads/?package=jdk#zulu) geinstalleerd hebt.

```shell
Expand Down
2 changes: 1 addition & 1 deletion theme/nl-design-system/login/login.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<form id="kc-form-login" onsubmit="login.disabled = true; return true;" action="${url.loginAction}" method="post">
<div class="rvo-layout-column rvo-layout-gap--md">
<div class="utrecht-form-fieldset rvo-form-fieldset">
<fieldset class="utrecht-form-fieldset__fieldset utrecht-form-fieldset--html-fieldset">
<fieldset class="utrecht-form-fieldset__fieldset utrecht-form-fieldset--html-fieldset rvo-layout-gap--md">

<#if !usernameHidden??>
<div role="group" aria-labelledby="username-label" class="utrecht-form-field utrecht-form-field--text rvo-form-field">
Expand Down
14 changes: 14 additions & 0 deletions theme/nl-design-system/login/messages/messages_en.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
backToLogin=Back to login
doForgotPassword=Forgot password
doLogIn=Log in
doRegister=Register
email=Email
loginAccountTitle=Sign in to your account
noAccount=No account yet?
password=Password
passwordConfirm=Confirm password
registerTitle=Register
rememberMe=Remember me
showPassword=Show password
username=Username
usernameOrEmail=Username or email
14 changes: 14 additions & 0 deletions theme/nl-design-system/login/messages/messages_nl.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
backToLogin=Terug naar login
doForgotPassword=Wachtwoord vergeten
doLogIn=Inloggen
doRegister=Registreren
email=E-mailadres
loginAccountTitle=Inloggen op je account
noAccount=Geen account?
password=Wachtwoord
passwordConfirm=Bevestig wachtwoord
registerTitle=Registreren
rememberMe=Onthoud mij
showPassword=Wachtwoord tonen
username=Gebruikersnaam
usernameOrEmail=Gebruikersnaam of e-mailadres
119 changes: 119 additions & 0 deletions theme/nl-design-system/login/register.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
<#import "template.ftl" as layout>
<#import "user-profile-commons.ftl" as userProfileCommons>
<#import "register-commons.ftl" as registerCommons>

<@layout.registrationLayout displayMessage=messagesPerField.exists('global') displayRequiredFields=false; section>
<#if section = "header">
<#if messageHeader??>
${kcSanitize(msg("${messageHeader}"))?no_esc}
<#else>
${msg("registerTitle")}
</#if>
<#elseif section = "form">
<div class="rvo-layout-column rvo-layout-gap--xl">
<div class="rvo-form">
<form id="kc-register-form" action="${url.registrationAction}" method="post">
<div class="rvo-layout-column rvo-layout-gap--md">
<div class="utrecht-form-fieldset rvo-form-fieldset">
<fieldset class="utrecht-form-fieldset__fieldset utrecht-form-fieldset--html-fieldset">
<legend class="utrecht-form-fieldset__legend utrecht-form-fieldset__legend--html-legend">
${msg("")}
</legend>

<div class="rvo-layout-column rvo-layout-gap--md">
<@userProfileCommons.userProfileFormFields; callback, attribute>
<#if callback = "beforeField">
<div class="rvo-form-field">
</#if>

<#if callback = "afterField">
</div>
<#if passwordRequired?? && (attribute.name == 'username' || (attribute.name == 'email' && realm.registrationEmailAsUsername))>
<div class="rvo-form-field">
<div class="rvo-form-field__label">
<label for="password" class="rvo-label">
${msg("password")}
<span class="rvo-required-asterisk" aria-hidden="true">&#42;</span>
</label>
</div>
<input type="password"
id="password"
name="password"
class="utrecht-textbox utrecht-textbox--html-input utrecht-textbox--lg"
autocomplete="new-password"
aria-invalid="<#if messagesPerField.existsError('password','password-confirm')>true</#if>"/>
<#if messagesPerField.existsError('password')>
<div class="utrecht-form-field-description utrecht-form-field-description--invalid rvo-form-feedback rvo-form-feedback--error">
<span class="utrecht-icon rvo-icon rvo-icon-foutmelding rvo-icon--md" role="img" aria-label="Error"></span>
${kcSanitize(messagesPerField.get('password'))?no_esc}
</div>
</#if>
</div>

<div class="rvo-form-field">
<div class="rvo-form-field__label">
<label for="password-confirm" class="rvo-label">
${msg("passwordConfirm")}
<span class="rvo-required-asterisk" aria-hidden="true">&#42;</span>
</label>
</div>
<input type="password"
id="password-confirm"
name="password-confirm"
class="utrecht-textbox utrecht-textbox--html-input utrecht-textbox--lg"
aria-invalid="<#if messagesPerField.existsError('password-confirm')>true</#if>"/>
<#if messagesPerField.existsError('password-confirm')>
<div class="utrecht-form-field-description utrecht-form-field-description--invalid rvo-form-feedback rvo-form-feedback--error">
<span class="utrecht-icon rvo-icon rvo-icon-foutmelding rvo-icon--md" role="img" aria-label="Error"></span>
${kcSanitize(messagesPerField.get('password-confirm'))?no_esc}
</div>
</#if>
</div>
</#if>
</#if>
</@userProfileCommons.userProfileFormFields>
</div>
</fieldset>
</div>

<@registerCommons.termsAcceptance/>

<#if recaptchaRequired??>
<div class="rvo-form-field">
<div class="rvo-form-field__label">
<div class="g-recaptcha" data-size="compact" data-sitekey="${recaptchaSiteKey}"></div>
</div>
</div>
</#if>

<p class="utrecht-button-group">
<input type="hidden" id="id-hidden-input" name="credentialId"
<#if auth.selectedCredential?has_content>value="${auth.selectedCredential}"</#if>/>
<input class="utrecht-button utrecht-button--primary-action utrecht-button--rvo-md"
name="login"
id="kc-login"
type="submit"
value="${msg("doRegister")}"/>
</p>

<div class="rvo-form-footer">
<div id="kc-form-options-container">
<div id="kc-form-options">
<span>
<a tabindex="8" class="rvo-link rvo-link--with-icon rvo-link--no-underline" href="${url.loginUrl}">
<span class="utrecht-icon rvo-icon rvo-icon-delta-naar-links rvo-icon--sm rvo-icon--hemelblauw rvo-link__icon--before"
role="img" aria-label="Back">
</span>
${msg("backToLogin")}
</a>
</span>
</div>
</div>
</div>
</div>
</form>
</div>
</div>
<script type="module" src="${url.resourcesPath}/js/passwordVisibility.js"></script>
</#if>
</@layout.registrationLayout>
138 changes: 138 additions & 0 deletions theme/nl-design-system/login/user-profile-commons.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
<#macro userProfileFormFields>
<#assign currentGroup="">

<#list profile.attributes as attribute>
<#assign group = (attribute.group)!"">
<#if group != currentGroup>
<#assign currentGroup=group>
<#if currentGroup != "">
<div class="rvo-form-field"
<#list group.html5DataAnnotations as key, value>
data-${key}="${value}"
</#list>
>
<#assign groupDisplayHeader=group.displayHeader!"">
<#if groupDisplayHeader != "">
<#assign groupHeaderText=advancedMsg(groupDisplayHeader)!group>
<#else>
<#assign groupHeaderText=group.name!"">
</#if>
<div class="rvo-form-field__label">
<label id="header-${attribute.group.name}" class="rvo-label">${groupHeaderText}</label>
</div>

<#assign groupDisplayDescription=group.displayDescription!"">
<#if groupDisplayDescription != "">
<#assign groupDescriptionText=advancedMsg(groupDisplayDescription)!"">
<div class="rvo-form-field__description">
<label id="description-${group.name}" class="rvo-label">${groupDescriptionText}</label>
</div>
</#if>
</div>
</#if>
</#if>

<#nested "beforeField" attribute>

<div class="rvo-form-field">
<div class="rvo-form-field__label">
<label for="${attribute.name}" class="rvo-label">
${advancedMsg(attribute.displayName!'')}
<#if attribute.required>
<span class="rvo-required-asterisk" aria-hidden="true">&#42;</span>
</#if>
</label>
</div>

<#if attribute.annotations.inputHelperTextBefore??>
<div class="utrecht-form-field-description" 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}')>
<div class="utrecht-form-field-description utrecht-form-field-description--invalid rvo-form-feedback rvo-form-feedback--error">
<span class="utrecht-icon rvo-icon rvo-icon-foutmelding rvo-icon--md" role="img" aria-label="Error"></span>
${kcSanitize(messagesPerField.get('${attribute.name}'))?no_esc}
</div>
</#if>

<#if attribute.annotations.inputHelperTextAfter??>
<div class="utrecht-form-field-description" id="form-help-text-after-${attribute.name}" aria-live="polite">
${kcSanitize(advancedMsg(attribute.annotations.inputHelperTextAfter))?no_esc}
</div>
</#if>

<#if attribute.html5DataAnnotations?keys?seq_contains('kcMultivalued')>
<button type="button" class="utrecht-button utrecht-button--secondary-action utrecht-button--rvo-md"
onclick="this.parentElement.querySelector('[name=\'${attribute.name}\']').value=''">
<span class="utrecht-icon rvo-icon rvo-icon-prullenbak rvo-icon--md" role="img" aria-label="Clear"></span>
</button>
</#if>
</div>

<#nested "afterField" attribute>

</#list>
</#macro>

<#macro inputFieldByType attribute>
<#switch attribute.annotations.inputType!''>
<#case 'textarea'>
<textarea id="${attribute.name}"
name="${attribute.name}"
class="utrecht-textbox utrecht-textbox--html-input utrecht-textbox--lg"
aria-invalid="<#if messagesPerField.existsError('${attribute.name}')>true</#if>"
<#if attribute.readOnly>disabled</#if>
<#if attribute.annotations.inputTypeCols??>cols="${attribute.annotations.inputTypeCols}"</#if>
<#if attribute.annotations.inputTypeRows??>rows="${attribute.annotations.inputTypeRows}"</#if>
<#if attribute.annotations.inputTypeMaxlength??>maxlength="${attribute.annotations.inputTypeMaxlength}"</#if>
>${(attribute.value!'')}</textarea>
<#break>
<#case 'select'>
<#case 'multiselect'>
<select id="${attribute.name}"
name="${attribute.name}"
class="utrecht-select utrecht-select--html-select utrecht-select--lg"
aria-invalid="<#if messagesPerField.existsError('${attribute.name}')>true</#if>"
<#if attribute.readOnly>disabled</#if>
<#if attribute.annotations.inputType=='multiselect'>multiple</#if>
>
<option value=""></option>
<#list attribute.options.options as option>
<option value="${option}" <#if attribute.value == option>selected</#if>>${option}</option>
</#list>
</select>
<#break>
<#default>
<input type="<@inputTagType attribute=attribute/>"
id="${attribute.name}"
name="${attribute.name}"
value="${(attribute.value!'')}"
class="utrecht-textbox utrecht-textbox--html-input utrecht-textbox--lg"
aria-invalid="<#if messagesPerField.existsError('${attribute.name}')>true</#if>"
<#if attribute.readOnly>disabled</#if>
<#if attribute.autocomplete??>autocomplete="${attribute.autocomplete}"</#if>
<#if attribute.annotations.inputTypePlaceholder??>placeholder="${advancedMsg(attribute.annotations.inputTypePlaceholder)}"</#if>
<#list attribute.html5DataAnnotations as key, value>
data-${key}="${value}"
</#list>
/>
</#switch>
</#macro>

<#macro inputTagType attribute>
<#compress>
<#if attribute.annotations.inputType??>
<#if attribute.annotations.inputType?starts_with("html5-")>
${attribute.annotations.inputType[6..]}
<#else>
${attribute.annotations.inputType}
</#if>
<#else>
text
</#if>
</#compress>
</#macro>
Loading