change_email.hbs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <section id="change-email-wrapper">
  2. <h2>
  3. Change email
  4. </h2>
  5. <p>Enter your password and a new email address to change your email address.</p>
  6. <form
  7. id="change-email"
  8. hx-post="/api/auth/change-email"
  9. hx-select="form"
  10. hx-swap="outerHTML"
  11. hx-sync="this:abort"
  12. >
  13. <div class="inputs">
  14. <label class="{{#if errors.password}}error{{/if}}">
  15. Passwod:
  16. <input
  17. id="password-for-change-email"
  18. name="password"
  19. type="password"
  20. placeholder="Password..."
  21. hx-preserve="true"
  22. />
  23. {{#if errors.password}}<p class="error">{{errors.password}}</p>{{/if}}
  24. </label>
  25. <label class="{{#if errors.email}}error{{/if}}">
  26. New email address:
  27. <input
  28. id="email-for-change-email"
  29. name="email"
  30. type="email"
  31. placeholder="john@example.com"
  32. hx-preserve="true"
  33. />
  34. {{#if errors.email}}<p class="error">{{errors.email}}</p>{{/if}}
  35. </label>
  36. </div>
  37. <button type="submit" class="primary">
  38. <span>{{> icons/reload}}</span>
  39. <span>{{> icons/spinner}}</span>
  40. Update
  41. </button>
  42. {{#if error}}
  43. {{#unless errors}}
  44. <p class="error">{{error}}</p>
  45. {{/unless}}
  46. {{else if success}}
  47. <p class="success">{{success}}</p>
  48. {{/if}}
  49. </form>
  50. </section>