Skip to content

Commit

Permalink
remove tailwind 💩
Browse files Browse the repository at this point in the history
  • Loading branch information
scottmckendry committed Nov 5, 2023
1 parent 9c59bd6 commit 0cb7e4c
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 156 deletions.
69 changes: 28 additions & 41 deletions views/dogs.html
Original file line number Diff line number Diff line change
@@ -1,45 +1,32 @@
<div id="dogs">
<div id="processing" class="htmx-indicator">Processing...</div>
<div class="flex flex-col">
<div class="overflow-x-auto sm:-mx-6 lg:-mx-8">
<div class="inline-block min-w-full py-2 sm:px-6 lg:px-8">
<div class="overflow-hidden">
<div class="flex justify-end">
<button
hx-get="/dogs/add"
hx-target="#table-body"
hx-swap="outerHTML"
hx-indicator="#processing"
class="inline-flex items-center h-8 px-4 m-2 text-sm text-blue-100 transition-colors duration-150 bg-blue-700 rounded-lg focus:shadow-outline hover:bg-blue-800"
href=""
>
Add
</button>
</div>
<table class="table-auto">
<thead
class="border-b font-medium dark:border-neutral-500"
>
<tr>
<th scope="col" class="px-6 py-4 hidden">#</th>
<th scope="col" class="px-6 py-4">Name</th>
<th scope="col" class="px-6 py-4">
Owner Name
</th>
<th scope="col" class="px-6 py-4">Address</th>
<th scope="col" class="px-6 py-4">City</th>
<th scope="col" class="px-6 py-4">Email</th>
<th scope="col" class="px-6 py-4">Service</th>
<th scope="col" class="px-6 py-4">Quantity</th>
<th scope="col" class="px-6 py-4">Price</th>
<th scope="col" class="px-6 py-4">Actions</th>
</tr>
</thead>
<tbody id="table-body"></tbody>
{{ range .dogs }} {{ template "row" . }} {{ end }}
</table>
</div>
</div>
</div>
<div>
<button
hx-get="/dogs/add"
hx-target="#table-body"
hx-swap="outerHTML"
hx-indicator="#processing"
href=""
>
Add
</button>
</div>
<table>
<thead>
<tr>
<th>#</th>
<th>Name</th>
<th>Owner Name</th>
<th>Address</th>
<th>City</th>
<th>Email</th>
<th>Service</th>
<th>Quantity</th>
<th>Price</th>
<th>Actions</th>
</tr>
</thead>
<tbody id="table-body"></tbody>
{{ range .dogs }} {{ template "row" . }} {{ end }}
</table>
</div>
3 changes: 1 addition & 2 deletions views/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@
integrity="sha384-FhXw7b6AlE/jyjlZH5iHa/tTe9EpJ1Y55RjcgPbjeWMskSxZt1v9qkxLJWNJaGni"
crossorigin="anonymous"
></script>
<script src="https://cdn.tailwindcss.com"></script>
</head>
<body>
<main>
<div class="md:container md:mx-auto">
<div>
<br />
<h1 class="text-3xl">Invoices</h1>
<div>{{ template "dogs" . }}</div>
Expand Down
92 changes: 19 additions & 73 deletions views/row-add.html
Original file line number Diff line number Diff line change
@@ -1,93 +1,39 @@
<tr id="datarow-add" class="border-b dark:border-neutral-500">
<td class="px-6 py-4 hidden"></td>
<td class="px-6 py-4">
<input
type="text"
class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline"
data-include-add=""
name="name"
value=""
/>
<tr id="datarow-add">
<td></td>
<td>
<input type="text" data-include-add="" name="name" value="" />
</td>
<td class="px-6 py-4">
<input
type="text"
class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline"
data-include-add=""
name="ownerName"
value=""
/>
<td>
<input type="text" data-include-add="" name="ownerName" value="" />
</td>
<td class="px-6 py-4">
<input
type="text"
class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline"
data-include-add=""
name="address"
value=""
/>
<td>
<input type="text" data-include-add="" name="address" value="" />
</td>
<td class="px-6 py-4">
<input
type="text"
class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline"
data-include-add=""
name="city"
value=""
/>
<td>
<input type="text" data-include-add="" name="city" value="" />
</td>
<td class="px-6 py-4">
<input
type="text"
class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline"
data-include-add=""
name="email"
value=""
/>
<td>
<input type="text" data-include-add="" name="email" value="" />
</td>
<td class="px-6 py-4">
<input
type="text"
class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline"
data-include-add=""
name="service"
value=""
/>
<td>
<input type="text" data-include-add="" name="service" value="" />
</td>
<td class="px-6 py-4">
<input
type="text"
class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline"
data-include-add=""
name="quantity"
value=""
/>
<td>
<input type="text" data-include-add="" name="quantity" value="" />
</td>
<td class="px-6 py-4">
<input
type="text"
class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline"
data-include-add=""
name="price"
value=""
/>
<td>
<input type="text" data-include-add="" name="price" value="" />
</td>
<td class="px-1 py-1">
<a
hx-post="/dogs/"
hx-target="#dogs"
hx-indicator="#processing"
hx-include="input[data-include-add]"
class="hover:underline text-blue-700"
href=""
>Save</a
>
<a
hx-get="/dogs/"
hx-target="#dogs"
hx-indicator="#processing"
class="hover:underline text-blue-700"
href=""
<a hx-get="/dogs/" hx-target="#dogs" hx-indicator="#processing" href=""
>Cancel</a
>
</td>
Expand Down
38 changes: 12 additions & 26 deletions views/row-edit.html
Original file line number Diff line number Diff line change
@@ -1,93 +1,79 @@
<tr id="datarow-{{.ID}}" class="border-b dark:border-neutral-500">
<td class="px-6 py-4 hidden">{{.ID}}</td>
<td class="px-6 py-4">
<tr id="datarow-{{.ID}}">
<td>{{.ID}}</td>
<td>
<input
type="text"
class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline"
data-include-edit="{{.ID}}"
name="name"
value="{{.Name}}"
/>
</td>
<td class="px-6 py-4">
<td>
<input
type="text"
class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline"
data-include-edit="{{.ID}}"
name="ownerName"
value="{{.OwnerName}}"
/>
</td>
<td class="px-6 py-4">
<td>
<input
type="text"
class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline"
data-include-edit="{{.ID}}"
name="address"
value="{{.Address}}"
/>
</td>
<td class="px-6 py-4">
<td>
<input
type="text"
class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline"
data-include-edit="{{.ID}}"
name="city"
value="{{.City}}"
/>
</td>
<td class="px-6 py-4">
<td>
<input
type="text"
class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline"
data-include-edit="{{.ID}}"
name="email"
value="{{.Email}}"
/>
</td>
<td class="px-6 py-4">
<td>
<input
type="text"
class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline"
data-include-edit="{{.ID}}"
name="service"
value="{{.Service}}"
/>
</td>
<td class="px-6 py-4">
<td>
<input
type="text"
class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline"
data-include-edit="{{.ID}}"
name="quantity"
value="{{.Quantity}}"
/>
</td>
<td class="px-6 py-4">
<td>
<input
type="text"
class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline"
data-include-edit="{{.ID}}"
name="price"
value="{{.Price}}"
/>
</td>
<td class="px-1 py-1">
<td>
<a
hx-put="/dogs/{{.ID}}"
hx-target="#dogs"
hx-indicator="#processing"
hx-include="input[data-include-edit]"
class="hover:underline text-blue-700"
href=""
>Save</a
>
<a
hx-get="/dogs/"
hx-target="#dogs"
hx-indicator="#processing"
href=""
class="hover:underline text-blue-700"
<a hx-get="/dogs/" hx-target="#dogs" hx-indicator="#processing" href=""
>Cancel</a
>
</td>
Expand Down
25 changes: 11 additions & 14 deletions views/row.html
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
<tr id="datarow-{{.ID}}" class="border-b dark:border-neutral-500">
<td class="px-6 py-4 hidden">{{.ID}}</td>
<td class="px-6 py-4">{{.Name}}</td>
<td class="px-6 py-4">{{.OwnerName}}</td>
<td class="px-6 py-4">{{.Address}}</td>
<td class="px-6 py-4">{{.City}}</td>
<td class="px-6 py-4">{{.Email}}</td>
<td class="px-6 py-4">{{.Service}}</td>
<td class="px-6 py-4">{{.Quantity}}</td>
<td class="px-6 py-4">{{.Price}}</td>
<td class="px-1 py-1">
<tr id="datarow-{{.ID}}">
<td>{{.ID}}</td>
<td>{{.Name}}</td>
<td>{{.OwnerName}}</td>
<td>{{.Address}}</td>
<td>{{.City}}</td>
<td>{{.Email}}</td>
<td>{{.Service}}</td>
<td>{{.Quantity}}</td>
<td>{{.Price}}</td>
<td>
<a
hx-get="/dogs/edit/{{.ID}}"
hx-target="#datarow-{{.ID}}"
hx-swap="outerHTML"
hx-indicator="#processing"
class="hover:underline text-blue-700"
href=""
>
Edit
Expand All @@ -24,7 +23,6 @@
hx-target="#dogs"
hx-confirm="Are you sure you want to delete {{.Name}}?"
hx-indicator="#processing"
class="hover:underline text-blue-700"
href=""
>Delete</a
>
Expand All @@ -39,7 +37,6 @@
hx-post="/invoice/{{.ID}}"
hx-target="#dogs"
hx-indicator="#processing"
class="hover:underline text-blue-700"
href=""
>Send</a
>
Expand Down

0 comments on commit 0cb7e4c

Please sign in to comment.