login.html 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <pstm-uri>/login</pstm-uri>
  7. <pstm-title>ClankerSaddle — Log in</pstm-title>
  8. <script pstm-res-src="statum.js"></script>
  9. <link rel="stylesheet" pstm-res-href="spry.css">
  10. <link rel="stylesheet" pstm-res-href="spry-theme-airy.css">
  11. <link rel="stylesheet" pstm-res-href="spry-theme-dwarf.css">
  12. <link rel="stylesheet" pstm-res-href="spry-theme-formal.css">
  13. <link rel="stylesheet" pstm-res-href="spry-theme-glassy.css">
  14. <link rel="stylesheet" pstm-res-href="spry-theme-h2o.css">
  15. <link rel="stylesheet" pstm-res-href="spry-theme-living-sky.css">
  16. <link rel="stylesheet" pstm-res-href="spry-theme-modern.css">
  17. <link rel="stylesheet" pstm-res-href="app.css">
  18. <link rel="icon" type="image/png" pstm-res-href="clanker-saddle.png">
  19. <link rel="apple-touch-icon" type="image/png" pstm-res-href="clanker-saddle.png">
  20. <script pstm-res-src="app.js"></script>
  21. <script>
  22. // Surface error notifications inline instead of as toasts so a
  23. // failed login is shown next to the form; other kinds toast.
  24. if (window.statum) {
  25. statum.onNotifyHandler = function (kind, message) {
  26. var area = document.getElementById('login-error');
  27. if (kind === 'error' && area) {
  28. area.hidden = false;
  29. area.textContent = message;
  30. return;
  31. }
  32. if (window.showToast) showToast(message, kind);
  33. };
  34. }
  35. </script>
  36. </head>
  37. <body>
  38. <main class="login">
  39. <div class="card login-card">
  40. <img class="login-emblem" alt="" pstm-res-src="clanker-saddle-emblem.png">
  41. <h1>ClankerSaddle</h1>
  42. <p class="text-muted">The agent works while you sleep.</p>
  43. <p stm-if="auth != null">Welcome <strong stm-text="auth.display_name">user</strong>!</p>
  44. <form stm-if="auth == null" stm-action="page.login" stm-busy-class="is-busy" class="stack">
  45. <div class="field">
  46. <label for="login-username">Username</label>
  47. <input id="login-username" type="text" name="username" required autocomplete="username" autofocus>
  48. </div>
  49. <div class="field">
  50. <label for="login-password">Password</label>
  51. <input id="login-password" type="password" name="password" required autocomplete="current-password">
  52. </div>
  53. <button type="submit" class="btn-primary btn-block">Log in</button>
  54. </form>
  55. <p class="text-danger" id="login-error" hidden></p>
  56. </div>
  57. </main>
  58. </body>
  59. </html>