Skip to content

Instantly share code, notes, and snippets.

@dharmatech
Created January 19, 2025 23:56
Show Gist options
  • Select an option

  • Save dharmatech/04ba977296bf1c0254f0bb4a3e41c6cc to your computer and use it in GitHub Desktop.

Select an option

Save dharmatech/04ba977296bf1c0254f0bb4a3e41c6cc to your computer and use it in GitHub Desktop.

Revisions

  1. dharmatech created this gist Jan 19, 2025.
    49 changes: 49 additions & 0 deletions contact-app-original-minimal.html
    Original 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>