|
| 1 | +<#import "template.ftl" as layout> |
| 2 | +<@layout.registrationLayout displayMessage=!messagesPerField.existsError('username','password') displayInfo=realm.password && realm.registrationAllowed && !registrationDisabled??; section> |
| 3 | + <#if section = "header"> |
| 4 | + ${msg("loginAccountTitle")} |
| 5 | + <#elseif section = "socialProviders" > |
| 6 | + <#if realm.password && social.providers??> |
| 7 | + <div id="kc-social-providers" class="${properties.kcFormSocialAccountSectionClass!}"> |
| 8 | + <h2 class="login-section-title-providers">${msg("identity-provider-login-label")}</h2> |
| 9 | + <ul class="${properties.kcFormSocialAccountListClass!} <#if social.providers?size gt 3>${properties.kcFormSocialAccountListGridClass!}</#if>"> |
| 10 | + <#list social.providers as p> |
| 11 | + <a id="social-${p.alias}" class="${properties.kcFormSocialAccountListButtonClass!} <#if social.providers?size gt 3>${properties.kcFormSocialAccountGridItem!}</#if>" |
| 12 | + type="button" href="${p.loginUrl}"> |
| 13 | + <#if p.iconClasses?has_content> |
| 14 | + <i class="${properties.kcCommonLogoIdP!} ${p.iconClasses!}" aria-hidden="true"></i> |
| 15 | + <span class="${properties.kcFormSocialAccountNameClass!} kc-social-icon-text">${p.displayName!}</span> |
| 16 | + <#else> |
| 17 | + <span class="${properties.kcFormSocialAccountNameClass!}">${p.displayName!}</span> |
| 18 | + </#if> |
| 19 | + </a> |
| 20 | + </#list> |
| 21 | + </ul> |
| 22 | + </div> |
| 23 | + </#if> |
| 24 | + <#elseif section = "form"> |
| 25 | + <div id="kc-form"> |
| 26 | + <div id="kc-form-wrapper"> |
| 27 | + <#if realm.password> |
| 28 | + <h2 class="login-section-title-form">${msg("loginFormLabel")}</h2> |
| 29 | + <form id="kc-form-login" onsubmit="login.disabled = true; return true;" action="${url.loginAction}" method="post"> |
| 30 | + <#if !usernameHidden??> |
| 31 | + <div class="${properties.kcFormGroupClass!}"> |
| 32 | + <label for="username" class="${properties.kcLabelClass!}"><#if !realm.loginWithEmailAllowed>${msg("username")}<#elseif !realm.registrationEmailAsUsername>${msg("usernameOrEmail")}<#else>${msg("email")}</#if></label> |
| 33 | + |
| 34 | + <input tabindex="1" id="username" class="${properties.kcInputClass!}" name="username" value="${(login.username!'')}" type="text" autofocus autocomplete="off" |
| 35 | + aria-invalid="<#if messagesPerField.existsError('username','password')>true</#if>" |
| 36 | + /> |
| 37 | + |
| 38 | + <#if messagesPerField.existsError('username','password')> |
| 39 | + <span id="input-error" class="${properties.kcInputErrorMessageClass!}" aria-live="polite"> |
| 40 | + ${kcSanitize(messagesPerField.getFirstError('username','password'))?no_esc} |
| 41 | + </span> |
| 42 | + </#if> |
| 43 | + |
| 44 | + </div> |
| 45 | + </#if> |
| 46 | + |
| 47 | + <div class="${properties.kcFormGroupClass!}"> |
| 48 | + <label for="password" class="${properties.kcLabelClass!}">${msg("password")}</label> |
| 49 | + |
| 50 | + <input tabindex="2" id="password" class="${properties.kcInputClass!}" name="password" type="password" autocomplete="off" |
| 51 | + aria-invalid="<#if messagesPerField.existsError('username','password')>true</#if>" |
| 52 | + /> |
| 53 | + |
| 54 | + <#if usernameHidden?? && messagesPerField.existsError('username','password')> |
| 55 | + <span id="input-error" class="${properties.kcInputErrorMessageClass!}" aria-live="polite"> |
| 56 | + ${kcSanitize(messagesPerField.getFirstError('username','password'))?no_esc} |
| 57 | + </span> |
| 58 | + </#if> |
| 59 | + |
| 60 | + </div> |
| 61 | + |
| 62 | + <div class="${properties.kcFormGroupClass!} ${properties.kcFormSettingClass!}"> |
| 63 | + <div id="kc-form-options"> |
| 64 | + <#if realm.rememberMe && !usernameHidden??> |
| 65 | + <div class="checkbox"> |
| 66 | + <label> |
| 67 | + <#if login.rememberMe??> |
| 68 | + <input tabindex="3" id="rememberMe" name="rememberMe" type="checkbox" checked> ${msg("rememberMe")} |
| 69 | + <#else> |
| 70 | + <input tabindex="3" id="rememberMe" name="rememberMe" type="checkbox"> ${msg("rememberMe")} |
| 71 | + </#if> |
| 72 | + </label> |
| 73 | + </div> |
| 74 | + </#if> |
| 75 | + </div> |
| 76 | + <div class="${properties.kcFormOptionsWrapperClass!}"> |
| 77 | + <#if realm.resetPasswordAllowed> |
| 78 | + <span><a tabindex="5" href="${url.loginResetCredentialsUrl}">${msg("doForgotPassword")}</a></span> |
| 79 | + </#if> |
| 80 | + </div> |
| 81 | + |
| 82 | + </div> |
| 83 | + |
| 84 | + <div id="kc-form-buttons" class="${properties.kcFormGroupClass!}"> |
| 85 | + <input type="hidden" id="id-hidden-input" name="credentialId" <#if auth.selectedCredential?has_content>value="${auth.selectedCredential}"</#if>/> |
| 86 | + <input tabindex="4" class="${properties.kcButtonClass!} ${properties.kcButtonPrimaryClass!} ${properties.kcButtonBlockClass!} ${properties.kcButtonLargeClass!}" name="login" id="kc-login" type="submit" value="${msg("doLogIn")}"/> |
| 87 | + </div> |
| 88 | + </form> |
| 89 | + </#if> |
| 90 | + </div> |
| 91 | + |
| 92 | + </div> |
| 93 | + <#if realm.password && social.providers??> |
| 94 | + <div id="login-separator"> |
| 95 | + <div class="separator"></div> |
| 96 | + OR |
| 97 | + <div class="separator"></div> |
| 98 | + </div> |
| 99 | + </#if> |
| 100 | + <#elseif section = "info" > |
| 101 | + <#if realm.password && realm.registrationAllowed && !registrationDisabled??> |
| 102 | + <div id="kc-registration-container"> |
| 103 | + <div id="kc-registration"> |
| 104 | + <span>${msg("noAccount")} <a tabindex="6" |
| 105 | + href="${url.registrationUrl}">${msg("doRegister")}</a></span> |
| 106 | + </div> |
| 107 | + </div> |
| 108 | + </#if> |
| 109 | + </#if> |
| 110 | + |
| 111 | +</@layout.registrationLayout> |
0 commit comments