actions.hbs 913 B

123456789101112131415161718192021222324252627282930313233343536
  1. <td class="actions">
  2. <button class="action stats">
  3. {{> icons/chart}}
  4. </button>
  5. <button
  6. class="action edit"
  7. hx-trigger="click queue:none"
  8. hx-ext="path-params"
  9. hx-get="/link/edit/{id}"
  10. hx-vals='{"id":"{{id}}"}'
  11. hx-swap="beforeend"
  12. hx-target="next tr.edit"
  13. hx-indicator="next tr.edit"
  14. hx-on::before-request="
  15. const tr = event.detail.target;
  16. tr.classList.add('show');
  17. if (tr.querySelector('.content')) {
  18. event.preventDefault();
  19. tr.classList.remove('show');
  20. tr.removeChild(tr.querySelector('.content'));
  21. }
  22. "
  23. >
  24. {{> icons/pencil}}
  25. </button>
  26. <button
  27. class="action delete"
  28. hx-on:click='openDialog("link-dialog")'
  29. hx-get="/confirm-link-delete"
  30. hx-target="#link-dialog .content-wrapper"
  31. hx-indicator="#link-dialog"
  32. hx-vals='{"id":"{{id}}"}'
  33. >
  34. {{> icons/trash}}
  35. </button>
  36. </td>