template.ftl 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. <#macro registrationLayout bodyClass="" displayInfo=false displayMessage=true displayRequiredFields=false showAnotherWayIfPresent=true>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml" class="${properties.kcHtmlClass!}">
  4. <head>
  5. <meta charset="utf-8">
  6. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  7. <meta name="robots" content="noindex, nofollow">
  8. <#if properties.meta?has_content>
  9. <#list properties.meta?split(' ') as meta>
  10. <meta name="${meta?split('==')[0]}" content="${meta?split('==')[1]}"/>
  11. </#list>
  12. </#if>
  13. <title>${msg("loginTitle",(realm.displayName!''))}</title>
  14. <link rel="icon" href="${url.resourcesPath}/img/favicon.ico" />
  15. <#if properties.stylesCommon?has_content>
  16. <#list properties.stylesCommon?split(' ') as style>
  17. <link href="${url.resourcesCommonPath}/${style}" rel="stylesheet" />
  18. </#list>
  19. </#if>
  20. <#if properties.styles?has_content>
  21. <#list properties.styles?split(' ') as style>
  22. <link href="${url.resourcesPath}/${style}" rel="stylesheet" />
  23. </#list>
  24. </#if>
  25. <#if properties.scripts?has_content>
  26. <#list properties.scripts?split(' ') as script>
  27. <script src="${url.resourcesPath}/${script}" type="text/javascript"></script>
  28. </#list>
  29. </#if>
  30. <#if scripts??>
  31. <#list scripts as script>
  32. <script src="${script}" type="text/javascript"></script>
  33. </#list>
  34. </#if>
  35. </head>
  36. <body class="${properties.kcBodyClass!}">
  37. <div class="${properties.kcLoginClass!}">
  38. <div id="kc-header" class="${properties.kcHeaderClass!}">
  39. <div id="kc-header-wrapper"
  40. class="${properties.kcHeaderWrapperClass!}">${kcSanitize(msg("loginTitleHtml",(realm.displayNameHtml!'')))?no_esc}</div>
  41. </div>
  42. <div class="${properties.kcFormCardClass!}">
  43. <header class="${properties.kcFormHeaderClass!}">
  44. <#if realm.internationalizationEnabled && locale.supported?size gt 1>
  45. <div class="${properties.kcLocaleMainClass!}" id="kc-locale">
  46. <div id="kc-locale-wrapper" class="${properties.kcLocaleWrapperClass!}">
  47. <div id="kc-locale-dropdown" class="${properties.kcLocaleDropDownClass!}">
  48. <a href="#" id="kc-current-locale-link">${locale.current}</a>
  49. <ul class="${properties.kcLocaleListClass!}">
  50. <#list locale.supported as l>
  51. <li class="${properties.kcLocaleListItemClass!}">
  52. <a class="${properties.kcLocaleItemClass!}" href="${l.url}">${l.label}</a>
  53. </li>
  54. </#list>
  55. </ul>
  56. </div>
  57. </div>
  58. </div>
  59. </#if>
  60. <#if !(auth?has_content && auth.showUsername() && !auth.showResetCredentials())>
  61. <#if displayRequiredFields>
  62. <div class="${properties.kcContentWrapperClass!}">
  63. <div class="${properties.kcLabelWrapperClass!} subtitle">
  64. <span class="subtitle"><span class="required">*</span> ${msg("requiredFields")}</span>
  65. </div>
  66. <div class="col-md-10">
  67. <h1 id="kc-page-title"><#nested "header"></h1>
  68. </div>
  69. </div>
  70. <#else>
  71. <h1 id="kc-page-title"><#nested "header"></h1>
  72. </#if>
  73. <#else>
  74. <#if displayRequiredFields>
  75. <div class="${properties.kcContentWrapperClass!}">
  76. <div class="${properties.kcLabelWrapperClass!} subtitle">
  77. <span class="subtitle"><span class="required">*</span> ${msg("requiredFields")}</span>
  78. </div>
  79. <div class="col-md-10">
  80. <#nested "show-username">
  81. <div id="kc-username" class="${properties.kcFormGroupClass!}">
  82. <label id="kc-attempted-username">${auth.attemptedUsername}</label>
  83. <a id="reset-login" href="${url.loginRestartFlowUrl}">
  84. <div class="kc-login-tooltip">
  85. <i class="${properties.kcResetFlowIcon!}"></i>
  86. <span class="kc-tooltip-text">${msg("restartLoginTooltip")}</span>
  87. </div>
  88. </a>
  89. </div>
  90. </div>
  91. </div>
  92. <#else>
  93. <#nested "show-username">
  94. <div id="kc-username" class="${properties.kcFormGroupClass!}">
  95. <label id="kc-attempted-username">${auth.attemptedUsername}</label>
  96. <a id="reset-login" href="${url.loginRestartFlowUrl}">
  97. <div class="kc-login-tooltip">
  98. <i class="${properties.kcResetFlowIcon!}"></i>
  99. <span class="kc-tooltip-text">${msg("restartLoginTooltip")}</span>
  100. </div>
  101. </a>
  102. </div>
  103. </#if>
  104. </#if>
  105. </header>
  106. <div id="kc-content">
  107. <div id="kc-content-wrapper">
  108. <#-- App-initiated actions should not see warning messages about the need to complete the action -->
  109. <#-- during login. -->
  110. <#if displayMessage && message?has_content && (message.type != 'warning' || !isAppInitiatedAction??)>
  111. <div class="alert-${message.type} ${properties.kcAlertClass!} pf-m-<#if message.type = 'error'>danger<#else>${message.type}</#if>">
  112. <div class="pf-c-alert__icon">
  113. <#if message.type = 'success'><span class="${properties.kcFeedbackSuccessIcon!}"></span></#if>
  114. <#if message.type = 'warning'><span class="${properties.kcFeedbackWarningIcon!}"></span></#if>
  115. <#if message.type = 'error'><span class="${properties.kcFeedbackErrorIcon!}"></span></#if>
  116. <#if message.type = 'info'><span class="${properties.kcFeedbackInfoIcon!}"></span></#if>
  117. </div>
  118. <span class="${properties.kcAlertTitleClass!}">${kcSanitize(message.summary)?no_esc}</span>
  119. </div>
  120. </#if>
  121. <#nested "form">
  122. <#if auth?has_content && auth.showTryAnotherWayLink() && showAnotherWayIfPresent>
  123. <form id="kc-select-try-another-way-form" action="${url.loginAction}" method="post">
  124. <div class="${properties.kcFormGroupClass!}">
  125. <input type="hidden" name="tryAnotherWay" value="on"/>
  126. <a href="#" id="try-another-way"
  127. onclick="document.forms['kc-select-try-another-way-form'].submit();return false;">${msg("doTryAnotherWay")}</a>
  128. </div>
  129. </form>
  130. </#if>
  131. <#if displayInfo>
  132. <div id="kc-info" class="${properties.kcSignUpClass!}">
  133. <div id="kc-info-wrapper" class="${properties.kcInfoAreaWrapperClass!}">
  134. <#nested "info">
  135. </div>
  136. </div>
  137. </#if>
  138. </div>
  139. </div>
  140. </div>
  141. </div>
  142. </body>
  143. </html>
  144. </#macro>