settings.eta 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <% layout("/en/layout", { title: "settings" }) %>
  2. <%~ include("/en/panel/partials/navbar") %>
  3. <% const settingsIcon = `
  4. <svg class="icon" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
  5. <g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2">
  6. <path d="M9.671 4.136a2.34 2.34 0 0 1 4.659 0a2.34 2.34 0 0 0 3.319 1.915a2.34 2.34 0 0 1 2.33 4.033a2.34 2.34 0 0 0 0 3.831a2.34 2.34 0 0 1-2.33 4.033a2.34 2.34 0 0 0-3.319 1.915a2.34 2.34 0 0 1-4.659 0a2.34 2.34 0 0 0-3.32-1.915a2.34 2.34 0 0 1-2.33-4.033a2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915" />
  7. <circle cx="12" cy="12" r="3" />
  8. </g>
  9. </svg>
  10. ` %>
  11. <% const errorIcon = `
  12. <svg class="icon" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
  13. <path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m21.73 18l-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3M12 9v4m0 4h.01" />
  14. </svg>
  15. ` %>
  16. <% const saveIcon = `
  17. <svg class="icon" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
  18. <g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2">
  19. <path d="M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z" />
  20. <path d="M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7M7 3v4a1 1 0 0 0 1 1h7" />
  21. </g>
  22. </svg>
  23. ` %>
  24. <% const deleteIcon = `
  25. <svg class="icon" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
  26. <path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 11v6m4-6v6m5-11v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6M3 6h18M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" />
  27. </svg>
  28. ` %>
  29. <h2><%~ settingsIcon %> settings</h2>
  30. <% const errorValue = it.error?.split('.').reduce((a, b) => a[b], it.lang.settings?.errors)?.(it?.errorDetails) %>
  31. <% if (typeof errorValue === "string") { %>
  32. <div class="message error">
  33. <p class="messageText"><%~ errorIcon %> <%= errorValue %></p>
  34. </div>
  35. <% } %>
  36. <form action="/en/panel/settings" method="post">
  37. <div>
  38. <label for="name">name</label>
  39. <input type="text" id="name" name="name" placeholder="ferris" value="<%= it.user.name ?? "" %>">
  40. </div>
  41. <div>
  42. <label for="email">email</label>
  43. <input type="text" id="email" name="email" placeholder="your@email.com" value="<%= it.user.email %>">
  44. </div>
  45. <div class="cf-turnstile" data-sitekey="<%= it.siteKey %>"></div>
  46. <button type="submit" class="primary"><%~ saveIcon %> save</button>
  47. </form>
  48. <hr>
  49. <div class="container-row">
  50. <a role="button" class="danger" href="/en/panel/deleteAccount"><%~ deleteIcon %> delete account</a>
  51. </div>
  52. <script
  53. src="https://challenges.cloudflare.com/turnstile/v0/api.js"
  54. async
  55. defer
  56. ></script>