change_password.hbs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <section id="change-password-wrapper">
  2. <h2>
  3. Change password
  4. </h2>
  5. <p>Enter your current password and a new password to change it to.</p>
  6. <form
  7. id="change-password"
  8. hx-post="/api/auth/change-password"
  9. hx-select="form"
  10. hx-swap="outerHTML"
  11. hx-sync="this:abort"
  12. >
  13. <div class="inputs">
  14. <label class="{{#if errors.currentpassword}}error{{/if}}">
  15. Current passwod:
  16. <input
  17. id="currentpassword"
  18. name="currentpassword"
  19. type="password"
  20. placeholder="Current password..."
  21. hx-preserve="true"
  22. />
  23. {{#if errors.currentpassword}}<p class="error">{{errors.currentpassword}}</p>{{/if}}
  24. </label>
  25. <label class="{{#if errors.newpassword}}error{{/if}}">
  26. New passwod:
  27. <input
  28. id="newpassword"
  29. name="newpassword"
  30. type="password"
  31. placeholder="New password..."
  32. hx-preserve="true"
  33. />
  34. {{#if errors.newpassword}}<p class="error">{{errors.newpassword}}</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>