login.html 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. {{ define "title"}}{{ t "page.login.title" }}{{ end }}
  2. {{ define "page_header"}}{{ end }}
  3. {{ define "content"}}
  4. <section class="login-form">
  5. <form action="{{ route "checkLogin" }}" method="post">
  6. <input type="hidden" name="csrf" value="{{ .csrf }}">
  7. {{ if .errorMessage }}
  8. <div role="alert" class="alert alert-error">{{ .errorMessage }}</div>
  9. {{ end }}
  10. <label for="form-username">{{ t "form.user.label.username" }}</label>
  11. <input type="text" name="username" id="form-username" value="{{ .form.Username }}" autocomplete="username" required autofocus>
  12. <label for="form-password">{{ t "form.user.label.password" }}</label>
  13. <input type="password" name="password" id="form-password" value="{{ .form.Password }}" autocomplete="current-password" required>
  14. <div class="buttons">
  15. <button type="submit" class="button button-primary" data-label-loading="{{ t "form.submit.loading" }}">{{ t "action.login" }}</button>
  16. </div>
  17. </form>
  18. {{ if .webAuthnEnabled }}
  19. <div class="webauthn">
  20. <div role="alert" class="alert alert-error hidden" id="webauthn-error">
  21. {{ t "page.login.webauthn_login.error" }}
  22. </div>
  23. <div class="buttons">
  24. <button class="button button-primary" id="webauthn-login" disabled>{{ t "page.login.webauthn_login" }}</button>
  25. </div>
  26. </div>
  27. {{ end }}
  28. {{ if hasOAuth2Provider "google" }}
  29. <div class="oauth2">
  30. <a href="{{ route "oauth2Redirect" "provider" "google" }}">{{ t "page.login.google_signin" }}</a>
  31. </div>
  32. {{ else if hasOAuth2Provider "oidc" }}
  33. <div class="oauth2">
  34. <a href="{{ route "oauth2Redirect" "provider" "oidc" }}">{{ t "page.login.oidc_signin" }}</a>
  35. </div>
  36. {{ end }}
  37. </section>
  38. <footer id="prompt-home-screen">
  39. <button id="btn-add-to-home-screen">{{ icon "home" }}<span class="icon-label">{{ t "action.home_screen" }}</span></button>
  40. </footer>
  41. {{ end }}