htmx_examples/templates/partials/edit_row_show_single_row.html

24 lines
817 B
HTML

<tr class="">
<td> {{ contact.name }} </td>
<td> {{ contact.email }} </td>
<td>
<button class="btn btn-danger"
hx-get="/contacts/{{ contact.id }}/edit"
hx-trigger="edit"
_="on click
if .editing is not empty
Swal.fire({title: 'Already Editing',
showCancelButton: true,
confirmButtonText: 'Yep, Edit This Row!',
text:'Hey! You are already editing a row! Do you want to cancel that edit and continue?'})
if the result's isConfirmed is false
halt
end
send cancel to .editing
end
trigger edit">
Edit
</button>
</td>
</tr>