Created
January 19, 2025 23:56
-
-
Save dharmatech/04ba977296bf1c0254f0bb4a3e41c6cc to your computer and use it in GitHub Desktop.
Revisions
-
dharmatech created this gist
Jan 19, 2025 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,49 @@ <!doctype html> <html lang=""> <head> {# <script src="/static/js/htmx-1.8.0.js"></script> #} <script src="https://unpkg.com/[email protected]/dist/htmx.min.js"></script> </head> <body> <main> <form x-data="{ selected: [] }"> <table> <thead> <tr> <th></th> <th>First</th> <th>Last</th> <th>Phone</th> <th>Email</th> <th></th> </tr> </thead> <tbody> {% for contact in contacts %} <tr> <td><input type="checkbox" name="selected_contact_ids" value="{{ contact.id }}" x-model="selected"></td> <td>{{ contact.first }}</td> <td>{{ contact.last }}</td> <td>{{ contact.phone }}</td> <td>{{ contact.email }}</td> <td> </td> </tr> {% endfor %} </tbody> </table> <button hx-delete="/contacts" hx-confirm="Confirm deletion" hx-target="body"> Delete Selected Contacts </button> </form> </main> </body> </html>