login.html 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <pstm-uri>/login</pstm-uri>
  5. <pstm-template>main</pstm-template>
  6. <script>
  7. // Surface error notifications inline instead of via alert().
  8. if (window.statum) {
  9. statum.onNotifyHandler = function (kind, message) {
  10. var area = document.getElementById('login-error');
  11. if (kind === 'error' && area) {
  12. area.hidden = false;
  13. area.textContent = message;
  14. return;
  15. }
  16. window.alert(message);
  17. };
  18. }
  19. </script>
  20. </head>
  21. <body>
  22. <section class="stack" style="max-width: 26rem;">
  23. <h2>Log in</h2>
  24. <p id="login-error" class="alert alert-danger" hidden></p>
  25. <form stm-action="page.login" class="stack">
  26. <label class="field">
  27. <span class="label">Username</span>
  28. <input class="input" name="username" required autocomplete="username" autofocus>
  29. </label>
  30. <label class="field">
  31. <span class="label">Password</span>
  32. <input class="input" type="password" name="password" required autocomplete="current-password">
  33. </label>
  34. <div><button class="btn btn-primary" type="submit">Log in</button></div>
  35. </form>
  36. <p>No account yet? <a href="/register">Register</a>.</p>
  37. </section>
  38. </body>
  39. </html>