form.hbs 808 B

123456789101112131415161718192021222324252627282930313233
  1. <form
  2. id="report-form"
  3. hx-post="/api/links/{id}/protected"
  4. hx-sync="this:abort"
  5. hx-ext="path-params"
  6. hx-vals='{"id":"{{id}}"}'
  7. hx-swap="outerHTML"
  8. >
  9. {{#if message}}
  10. <p class="success">{{message}}</p>
  11. {{else}}
  12. <div class="inputs-wrapper">
  13. <label>
  14. Password:
  15. <input
  16. type="password"
  17. id="protected-link-password"
  18. name="password"
  19. placeholder="Password..."
  20. hx-preserve="true"
  21. class="{{#if errors.link}}error{{/if}}"
  22. required
  23. />
  24. </label>
  25. <button type="submit" class="primary">
  26. <span>{{> icons/spinner}}</span>
  27. <span>{{> icons/key}}</span>
  28. Unlock & Go
  29. </button>
  30. </div>
  31. {{#if error}}<p class="error">{{error}}</p>{{/if}}
  32. {{/if}}
  33. </form>