register-user-profile.ftl 4.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <#import "template.ftl" as layout>
  2. <#import "user-profile-commons.ftl" as userProfileCommons>
  3. <@layout.registrationLayout displayMessage=messagesPerField.exists('global') displayRequiredFields=true; section>
  4. <#if section = "header">
  5. ${msg("registerTitle")}
  6. <#elseif section = "form">
  7. <form id="kc-register-form" class="${properties.kcFormClass!}" action="${url.registrationAction}" method="post">
  8. <@userProfileCommons.userProfileFormFields; callback, attribute>
  9. <#if callback = "afterField">
  10. <#-- render password fields just under the username or email (if used as username) -->
  11. <#if passwordRequired?? && (attribute.name == 'username' || (attribute.name == 'email' && realm.registrationEmailAsUsername))>
  12. <div class="${properties.kcFormGroupClass!}">
  13. <div class="${properties.kcLabelWrapperClass!}">
  14. <label for="password" class="${properties.kcLabelClass!}">${msg("password")}</label> *
  15. </div>
  16. <div class="${properties.kcInputWrapperClass!}">
  17. <input type="password" id="password" class="${properties.kcInputClass!}" name="password"
  18. autocomplete="new-password"
  19. aria-invalid="<#if messagesPerField.existsError('password','password-confirm')>true</#if>"
  20. />
  21. <#if messagesPerField.existsError('password')>
  22. <span id="input-error-password" class="${properties.kcInputErrorMessageClass!}" aria-live="polite">
  23. ${kcSanitize(messagesPerField.get('password'))?no_esc}
  24. </span>
  25. </#if>
  26. </div>
  27. </div>
  28. <div class="${properties.kcFormGroupClass!}">
  29. <div class="${properties.kcLabelWrapperClass!}">
  30. <label for="password-confirm"
  31. class="${properties.kcLabelClass!}">${msg("passwordConfirm")}</label> *
  32. </div>
  33. <div class="${properties.kcInputWrapperClass!}">
  34. <input type="password" id="password-confirm" class="${properties.kcInputClass!}"
  35. name="password-confirm"
  36. aria-invalid="<#if messagesPerField.existsError('password-confirm')>true</#if>"
  37. />
  38. <#if messagesPerField.existsError('password-confirm')>
  39. <span id="input-error-password-confirm" class="${properties.kcInputErrorMessageClass!}" aria-live="polite">
  40. ${kcSanitize(messagesPerField.get('password-confirm'))?no_esc}
  41. </span>
  42. </#if>
  43. </div>
  44. </div>
  45. </#if>
  46. </#if>
  47. </@userProfileCommons.userProfileFormFields>
  48. <#if recaptchaRequired??>
  49. <div class="form-group">
  50. <div class="${properties.kcInputWrapperClass!}">
  51. <div class="g-recaptcha" data-size="compact" data-sitekey="${recaptchaSiteKey}"></div>
  52. </div>
  53. </div>
  54. </#if>
  55. <div class="${properties.kcFormGroupClass!}">
  56. <div id="kc-form-options" class="${properties.kcFormOptionsClass!}">
  57. <div class="${properties.kcFormOptionsWrapperClass!}">
  58. <span><a href="${url.loginUrl}">${kcSanitize(msg("backToLogin"))?no_esc}</a></span>
  59. </div>
  60. </div>
  61. <div id="kc-form-buttons" class="${properties.kcFormButtonsClass!}">
  62. <input class="${properties.kcButtonClass!} ${properties.kcButtonPrimaryClass!} ${properties.kcButtonBlockClass!} ${properties.kcButtonLargeClass!}" type="submit" value="${msg("doRegister")}"/>
  63. </div>
  64. </div>
  65. </form>
  66. </#if>
  67. </@layout.registrationLayout>