fix for box item parsing issue

This commit is contained in:
2024-03-12 19:38:59 +00:00
parent a601a8308d
commit 4fd0e72a86
8 changed files with 280 additions and 24 deletions

View File

@@ -0,0 +1,3 @@
<tr id="box-item-list">
<td>Hooray!</td>
</tr>

View File

@@ -1,11 +1,12 @@
<tr id="boxrow-{{.ID}}" class="border-b dark:border-neutral-500 hover:bg-slate-300 hover:bg-opacity-20">
<td
hx-get="/box-items?box_id={{ .ID }}"
hx-target="#boxrow-{{ .ID }}"
hx-swap="afterend"
class="whitespace-nowrap px-6 py-4 relative top-0 -left-12 inline-flex items-center h-8 m-2 text-sm text-stone-100 transition-colors duration-150 bg-stone-700 rounded-lg focus:shadow-outline hover:bg-stone-800"
>
&lt;
<td class="whitespace-nowrap px-6 py-4">
<button
hx-get="/box-items?boxid={{ .ID }}"
hx-target="#boxrow-{{ .ID }}"
class="inline-flex items-center h-8 px-4 m-2 text-sm text-stone-100 transition-colors duration-150 bg-stone-700 rounded-lg focus:shadow-outline hover:bg-stone-800"
>
&gt;
</button>
</td>
<td class="whitespace-nowrap px-6 py-4">{{.ID}}</td>
<td class="whitespace-nowrap px-6 py-4">{{.Name}}</td>

View File

@@ -18,7 +18,7 @@
<td class="whitespace-nowrap px-6 py-4">...</td>
{{ end }}
<td class="whitespace-nowrap px-6 py-4">
<td class="flex whitespace-nowrap px-6 py-4">
<button
hx-get="/items/edit/{{ .ID }}"
hx-target="#datarow-{{ .ID }}"
@@ -27,4 +27,15 @@
>
Edit
</button>
<button
hx-delete="/items/delete/{{ .ID }}"
hx-confirm="Are you sure?"
hx-target="#datarow-{{ .ID }}"
hx-swap="delete"
class="inline-flex items-center h-8 px-4 m-2 text-sm text-red-100 transition-colors duration-150 bg-red-700 rounded-lg focus:shadow-outline hover:bg-red-800"
>
Delete
</button>
</td>
</tr>