login.html 1.3 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>
  23. <h2>Log in</h2>
  24. <p id="login-error" class="error" hidden></p>
  25. <form stm-action="page.login">
  26. <div class="form-row">
  27. <label for="login-username">Username</label>
  28. <input id="login-username" name="username" required autocomplete="username" autofocus>
  29. </div>
  30. <div class="form-row">
  31. <label for="login-password">Password</label>
  32. <input id="login-password" type="password" name="password" required autocomplete="current-password">
  33. </div>
  34. <button type="submit">Log in</button>
  35. </form>
  36. <p>No account yet? <a href="/register">Register</a>.</p>
  37. </section>
  38. </body>
  39. </html>