recovering from problematic changes

This commit is contained in:
2024-03-09 14:14:10 +00:00
parent 9b2caddeb4
commit 8c187a310e
4 changed files with 52 additions and 11 deletions

View File

@@ -25,6 +25,7 @@
<th scope="col" class="px-6 py-4">Category</th>
<th scope="col" class="px-6 py-4">Description</th>
<th scope="col" class="px-6 py-4">Notes</th>
<th scope="col" class="px-6 py-4"></th>
</tr>
</thead>
<tbody id="table-body">

View File

@@ -3,6 +3,26 @@
<td class="whitespace-nowrap px-6 py-4">{{.Name}}</td>
<td class="whitespace-nowrap px-6 py-4">{{.Stage}}</td>
<td class="whitespace-nowrap px-6 py-4">{{.Category}}</td>
{{ if .Description }}
<td class="whitespace-nowrap px-6 py-4">{{.Description}}</td>
{{ else }}
<td class="whitespace-nowrap px-6 py-4">...</td>
{{ end }}
{{ if .Notes }}
<td class="whitespace-nowrap px-6 py-4">{{.Notes}}</td>
{{ else }}
<td class="whitespace-nowrap px-6 py-4">...</td>
{{ end }}
<td class="whitespace-nowrap px-6 py-4">
<button
hx-get="/items/edit/{{.ID}}"
hx-target="#datarow-{{.ID}}"
hx-swap="outerHTML"
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"
>
Edit
</button>
</tr>

View File

@@ -4,9 +4,9 @@
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>Mikayla's Move Manager</title>
<script src="https://unpkg.com/htmx.org@1.9.2"></script>
<link href="/css/output.css" rel="stylesheet" />
<title>Go + HTMX + Tailwind</title>
<script src="https://cdn.tailwindcss.com"></script>
</head>
<body>
<main>

View File

@@ -5,8 +5,8 @@
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="company"
value="{{.Company}}"
name="name"
value="{{.Name}}"
/>
</td>
<td class="whitespace-nowrap px-6 py-4">
@@ -14,8 +14,8 @@
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="contact"
value="{{.Contact}}"
name="stage"
value="{{.Stage}}"
/>
</td>
<td class="whitespace-nowrap px-6 py-4">
@@ -23,13 +23,33 @@
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="country"
value="{{.Country}}"
name="category"
value="{{.Category}}"
/>
</td>
<td class="whitespace-nowrap 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-edit="{{.ID}}"
name="description"
value="{{.Description}}"
/>
</td>
<td class="whitespace-nowrap 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-edit="{{.ID}}"
name="notes"
value="{{.Notes}}"
/>
<td class="whitespace-nowrap px-1 py-1">
<a
hx-put="/company/{{.ID}}"
hx-put="/items/{{.ID}}"
hx-target="#datarow-{{.ID}}"
hx-swap="outerHTML"
hx-indicator="#processing"