Repository navigation
Unify login theme actions and styling hooks #52724
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| <#-- Wrap related actions with <@buttons.actionGroup horizontal=true>; group=false omits the field-group wrapper. --> | ||
| <#macro actionGroup horizontal=false id="" group=true> | ||
| <#if group><div class="${properties.kcFormGroupClass!}"></#if> | ||
| <div<#if id?has_content> id="${id}"</#if> class="${properties.kcFormActionGroupClass!(properties.kcFormButtonsClass!'')}<#if horizontal> ${properties.kcFormActionGroupHorizontalClass!}<#else> ${properties.kcFormActionGroupVerticalClass!}</#if>"> | ||
| <#nested> | ||
| </div> | ||
| <#if group></div></#if> | ||
| </#macro> | ||
|
|
||
| <#-- Use <@buttons.button label="doContinue"/>; type selects the style, and extra attributes are forwarded. --> | ||
| <#macro button label id="" name="" type="primary" fullWidth=true class=[] className="" labelText="" attributes={} extra...> | ||
| <#local variantClass = properties['kcButton' + type?cap_first + 'Class']!> | ||
| <#if type == "secondary" && !properties.kcButtonSecondaryClass??> | ||
| <#local variantClass = properties.kcButtonDefaultClass!> | ||
| </#if> | ||
| <button class="${properties.kcButtonClass!} ${variantClass}<#if fullWidth> ${properties.kcButtonBlockClass!}</#if><#list class as c> ${properties[c]!}</#list><#if className?has_content> ${className}</#if>"<#if name?has_content> name="${name}"</#if><#if id?has_content> id="${id}"</#if> | ||
| type="submit" <#list attributes as attrName, attrVal>${attrName}="${attrVal}" </#list><#list extra as attrName, attrVal>${attrName}="${attrVal}" </#list>> | ||
| <#if labelText?has_content>${labelText}<#else>${msg(label)}</#if> | ||
| </button> | ||
| </#macro> | ||
|
|
||
| <#-- Use <@buttons.buttonLink href=url.loginUrl label="backToLogin"/>; class lists theme-property names. --> | ||
| <#macro buttonLink href label id="" class=["kcButtonSecondaryClass", "kcButtonBlockClass"]> | ||
| <a<#if id?has_content> id="${id}"</#if> href="${href}" class="${properties.kcButtonClass!}<#list class as c> <#if c == "kcButtonSecondaryClass">${properties[c]!(properties.kcButtonDefaultClass!'')}<#else>${properties[c]!}</#if></#list>">${msg(label)}</a> | ||
| </#macro> | ||
|
|
||
| <#-- Use <@buttons.loginButton/> for the standard login action and its action-group wrapper. --> | ||
| <#macro loginButton> | ||
| <@buttons.actionGroup> | ||
| <@buttons.button id="kc-login" name="login" label="doLogIn" /> | ||
| </@buttons.actionGroup> | ||
| </#macro> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,32 +1,39 @@ | ||
| <#import "template.ftl" as layout> | ||
| <#import "buttons.ftl" as buttons> | ||
|
|
||
| <@layout.registrationLayout; section> | ||
| <!-- template: delete-account-confirm.ftl --> | ||
|
|
||
| <#if section = "header"> | ||
| ${msg("deleteAccountConfirm")} | ||
| ${msg("deleteAccountConfirm")} | ||
|
|
||
| <#elseif section = "form"> | ||
|
|
||
| <form action="${url.loginAction}" class="form-vertical" method="post"> | ||
|
|
||
| <div class="alert alert-warning kc-alert-delete-account"> | ||
| <span class="pficon pficon-warning-triangle-o"></span> | ||
| ${msg("irreversibleAction")} | ||
| </div> | ||
|
|
||
| <p>${msg("deletingImplies")}</p> | ||
| <ul class="kc-delete-account-list"> | ||
| <li>${msg("loggingOutImmediately")}</li> | ||
| <li>${msg("errasingData")}</li> | ||
| </ul> | ||
|
|
||
| <p class="delete-account-text">${msg("finalDeletionConfirmation")}</p> | ||
|
|
||
| <div id="kc-form-buttons"> | ||
| <input class="${properties.kcButtonClass!} ${properties.kcButtonPrimaryClass!} ${properties.kcButtonLargeClass!}" type="submit" value="${msg("doConfirmDelete")}" /> | ||
| <#if triggered_from_aia> | ||
| <button class="${properties.kcButtonClass!} ${properties.kcButtonDefaultClass!} ${properties.kcButtonLargeClass!} kc-delete-account-cancel" type="submit" name="cancel-aia" value="true">${msg("doCancel")}</button> | ||
| </#if> | ||
| </div> | ||
| <form action="${url.loginAction}" class="${properties.kcFormClass!}" id="kc-deleteaccount-form" method="post"> | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As the
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ... And yes I thought about it as well but wasn't sure if I could flip the whole table. The best case scenario would be for people not to overwrite template.ftl.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @kathari00 There will be probably some follow-ups, so it can be done later.
Yep, it could be good to make the |
||
|
|
||
| <div class="${properties.kcAlertClass!} ${properties.kcAlertWarningClass!}"> | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could we also introduce a macro for alerts? Could be also nice if our macros would contain some comments on how to use them (briefly). WDYT?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There will be probably some follow-ups, so it can be done later. |
||
| <div class="${properties.kcAlertIconClass!}"> | ||
| <i class="${properties.kcFeedbackWarningIcon!}" aria-hidden="true"></i> | ||
| </div> | ||
| <span class="${properties.kcAlertTitleClass!}"> | ||
| ${msg("irreversibleAction")} | ||
| </span> | ||
| </div> | ||
|
|
||
| <p>${msg("deletingImplies")}</p> | ||
| <ul class="${properties.kcListClass!}" role="list"> | ||
| <li>${msg("loggingOutImmediately")}</li> | ||
| <li>${msg("errasingData")}</li> | ||
| </ul> | ||
|
|
||
| <p class="delete-account-text">${msg("finalDeletionConfirmation")}</p> | ||
|
|
||
| <@buttons.actionGroup> | ||
| <@buttons.button id="kc-submit" label="doConfirmDelete"/> | ||
| <#if triggered_from_aia> | ||
| <@buttons.button id="kc-cancel" name="cancel-aia" label="doCancel" type="secondary"/> | ||
| </#if> | ||
| </@buttons.actionGroup> | ||
| </form> | ||
| </#if> | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,15 +1,20 @@ | ||
| <#import "template.ftl" as layout> | ||
| <#import "buttons.ftl" as buttons> | ||
|
|
||
| <@layout.registrationLayout displayMessage=false; section> | ||
| <!-- template: delete-credential.ftl --> | ||
|
|
||
| <#if section = "header"> | ||
| ${msg("deleteCredentialTitle", credentialLabel)} | ||
| <#elseif section = "form"> | ||
| <div id="kc-delete-text"> | ||
| ${msg("deleteCredentialMessage", credentialLabel)} | ||
| </div> | ||
| <form class="form-actions" action="${url.loginAction}" method="POST"> | ||
| <input class="${properties.kcButtonClass!} ${properties.kcButtonPrimaryClass!} ${properties.kcButtonLargeClass!}" name="accept" id="kc-accept" type="submit" value="${msg("doConfirmDelete")}"/> | ||
| <input class="${properties.kcButtonClass!} ${properties.kcButtonDefaultClass!} ${properties.kcButtonLargeClass!}" name="cancel-aia" value="${msg("doCancel")}" id="kc-decline" type="submit" /> | ||
| </form> | ||
| <div class="clearfix"></div> | ||
| <form class="${properties.kcFormClass!}" action="${url.loginAction}" method="POST"> | ||
| <p id="kc-delete-text"> | ||
| ${msg("deleteCredentialMessage", credentialLabel)} | ||
| </p> | ||
| <@buttons.actionGroup horizontal=true> | ||
| <@buttons.button name="accept" id="kc-accept" label="doConfirmDelete"/> | ||
| <@buttons.button name="cancel-aia" id="kc-decline" label="doDecline" type="secondary"/> | ||
| </@buttons.actionGroup> | ||
| </form> | ||
| </#if> | ||
| </@layout.registrationLayout> |
Uh oh!
There was an error while loading. Please reload this page.