form.hbs 719 B

123456789101112131415161718192021222324252627282930
  1. <form
  2. id="report-form"
  3. hx-post="/api/links/report"
  4. hx-sync="this:abort"
  5. hx-swap="outerHTML"
  6. >
  7. {{#if message}}
  8. <p class="success">{{message}}</p>
  9. {{else}}
  10. <div class="inputs-wrapper">
  11. <label>
  12. URL containing malware/scam:
  13. <input
  14. type="text"
  15. id="link"
  16. name="link"
  17. placeholder="{{default_domain}}/example"
  18. hx-preserve="true"
  19. class="{{#if errors.link}}error{{/if}}"
  20. required
  21. />
  22. </label>
  23. <button type="submit" class="primary">
  24. <span>{{> icons/spinner}}</span>
  25. Send report
  26. </button>
  27. </div>
  28. {{#if error}}<p class="error">{{error}}</p>{{/if}}
  29. {{/if}}
  30. </form>