register.ftl 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <#import "template.ftl" as layout>
  2. <@layout.registrationLayout displayMessage=!messagesPerField.existsError('firstName','lastName','email','username','password','password-confirm'); section>
  3. <#if section = "header">
  4. ${msg("registerTitle")}
  5. <#elseif section = "form">
  6. <form id="kc-register-form" class="${properties.kcFormClass!}" action="${url.registrationAction}" method="post">
  7. <div class="${properties.kcFormGroupClass!}">
  8. <div class="${properties.kcLabelWrapperClass!}">
  9. <label for="firstName" class="${properties.kcLabelClass!}">${msg("firstName")}</label>
  10. </div>
  11. <div class="${properties.kcInputWrapperClass!}">
  12. <input type="text" id="firstName" class="${properties.kcInputClass!}" name="firstName"
  13. value="${(register.formData.firstName!'')}"
  14. aria-invalid="<#if messagesPerField.existsError('firstName')>true</#if>"
  15. />
  16. <#if messagesPerField.existsError('firstName')>
  17. <span id="input-error-firstname" class="${properties.kcInputErrorMessageClass!}" aria-live="polite">
  18. ${kcSanitize(messagesPerField.get('firstName'))?no_esc}
  19. </span>
  20. </#if>
  21. </div>
  22. </div>
  23. <div class="${properties.kcFormGroupClass!}">
  24. <div class="${properties.kcLabelWrapperClass!}">
  25. <label for="lastName" class="${properties.kcLabelClass!}">${msg("lastName")}</label>
  26. </div>
  27. <div class="${properties.kcInputWrapperClass!}">
  28. <input type="text" id="lastName" class="${properties.kcInputClass!}" name="lastName"
  29. value="${(register.formData.lastName!'')}"
  30. aria-invalid="<#if messagesPerField.existsError('lastName')>true</#if>"
  31. />
  32. <#if messagesPerField.existsError('lastName')>
  33. <span id="input-error-lastname" class="${properties.kcInputErrorMessageClass!}" aria-live="polite">
  34. ${kcSanitize(messagesPerField.get('lastName'))?no_esc}
  35. </span>
  36. </#if>
  37. </div>
  38. </div>
  39. <div class="${properties.kcFormGroupClass!}">
  40. <div class="${properties.kcLabelWrapperClass!}">
  41. <label for="email" class="${properties.kcLabelClass!}">${msg("email")}</label>
  42. </div>
  43. <div class="${properties.kcInputWrapperClass!}">
  44. <input type="text" id="email" class="${properties.kcInputClass!}" name="email"
  45. value="${(register.formData.email!'')}" autocomplete="email"
  46. aria-invalid="<#if messagesPerField.existsError('email')>true</#if>"
  47. />
  48. <#if messagesPerField.existsError('email')>
  49. <span id="input-error-email" class="${properties.kcInputErrorMessageClass!}" aria-live="polite">
  50. ${kcSanitize(messagesPerField.get('email'))?no_esc}
  51. </span>
  52. </#if>
  53. </div>
  54. </div>
  55. <#if !realm.registrationEmailAsUsername>
  56. <div class="${properties.kcFormGroupClass!}">
  57. <div class="${properties.kcLabelWrapperClass!}">
  58. <label for="username" class="${properties.kcLabelClass!}">${msg("username")}</label>
  59. </div>
  60. <div class="${properties.kcInputWrapperClass!}">
  61. <input type="text" id="username" class="${properties.kcInputClass!}" name="username"
  62. value="${(register.formData.username!'')}" autocomplete="username"
  63. aria-invalid="<#if messagesPerField.existsError('username')>true</#if>"
  64. />
  65. <#if messagesPerField.existsError('username')>
  66. <span id="input-error-username" class="${properties.kcInputErrorMessageClass!}" aria-live="polite">
  67. ${kcSanitize(messagesPerField.get('username'))?no_esc}
  68. </span>
  69. </#if>
  70. </div>
  71. </div>
  72. </#if>
  73. <#if passwordRequired??>
  74. <div class="${properties.kcFormGroupClass!}">
  75. <div class="${properties.kcLabelWrapperClass!}">
  76. <label for="password" class="${properties.kcLabelClass!}">${msg("password")}</label>
  77. </div>
  78. <div class="${properties.kcInputWrapperClass!}">
  79. <input type="password" id="password" class="${properties.kcInputClass!}" name="password"
  80. autocomplete="new-password"
  81. aria-invalid="<#if messagesPerField.existsError('password','password-confirm')>true</#if>"
  82. />
  83. <#if messagesPerField.existsError('password')>
  84. <span id="input-error-password" class="${properties.kcInputErrorMessageClass!}" aria-live="polite">
  85. ${kcSanitize(messagesPerField.get('password'))?no_esc}
  86. </span>
  87. </#if>
  88. </div>
  89. </div>
  90. <div class="${properties.kcFormGroupClass!}">
  91. <div class="${properties.kcLabelWrapperClass!}">
  92. <label for="password-confirm"
  93. class="${properties.kcLabelClass!}">${msg("passwordConfirm")}</label>
  94. </div>
  95. <div class="${properties.kcInputWrapperClass!}">
  96. <input type="password" id="password-confirm" class="${properties.kcInputClass!}"
  97. name="password-confirm"
  98. aria-invalid="<#if messagesPerField.existsError('password-confirm')>true</#if>"
  99. />
  100. <#if messagesPerField.existsError('password-confirm')>
  101. <span id="input-error-password-confirm" class="${properties.kcInputErrorMessageClass!}" aria-live="polite">
  102. ${kcSanitize(messagesPerField.get('password-confirm'))?no_esc}
  103. </span>
  104. </#if>
  105. </div>
  106. </div>
  107. </#if>
  108. <#if recaptchaRequired??>
  109. <div class="form-group">
  110. <div class="${properties.kcInputWrapperClass!}">
  111. <div class="g-recaptcha" data-size="compact" data-sitekey="${recaptchaSiteKey}"></div>
  112. </div>
  113. </div>
  114. </#if>
  115. <div class="${properties.kcFormGroupClass!}">
  116. <div id="kc-form-options" class="${properties.kcFormOptionsClass!}">
  117. <div class="${properties.kcFormOptionsWrapperClass!}">
  118. <span><a href="${url.loginUrl}">${kcSanitize(msg("backToLogin"))?no_esc}</a></span>
  119. </div>
  120. </div>
  121. <div id="kc-form-buttons" class="${properties.kcFormButtonsClass!}">
  122. <input class="${properties.kcButtonClass!} ${properties.kcButtonPrimaryClass!} ${properties.kcButtonBlockClass!} ${properties.kcButtonLargeClass!}" type="submit" value="${msg("doRegister")}"/>
  123. </div>
  124. </div>
  125. </form>
  126. </#if>
  127. </@layout.registrationLayout>