Update the admin panel to show the article counters.
This commit is contained in:
+13
-2
@@ -8,7 +8,12 @@
|
|||||||
<div class="flex-1 flex items-center space-x-2">
|
<div class="flex-1 flex items-center space-x-2">
|
||||||
<h5>
|
<h5>
|
||||||
<span class="text-gray-500">All articles:</span>
|
<span class="text-gray-500">All articles:</span>
|
||||||
<span class="dark:text-white">123456</span>
|
<span class="dark:text-white"
|
||||||
|
x-data="{ count: document.getElementById('articles').children.length }"
|
||||||
|
x-on:htmx:load.window="count = document.getElementById('articles').children.length"
|
||||||
|
@delete_row.window="count = document.getElementById('articles').children.length"
|
||||||
|
x-text="count">
|
||||||
|
</span>
|
||||||
</h5>
|
</h5>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -60,7 +65,12 @@
|
|||||||
<nav class="flex flex-col md:flex-row justify-between items-start md:items-center space-y-3 md:space-y-0 p-4" aria-label="Table navigation">
|
<nav class="flex flex-col md:flex-row justify-between items-start md:items-center space-y-3 md:space-y-0 p-4" aria-label="Table navigation">
|
||||||
<span class="text-sm font-normal text-gray-500 dark:text-gray-400">
|
<span class="text-sm font-normal text-gray-500 dark:text-gray-400">
|
||||||
Showing
|
Showing
|
||||||
<span class="font-semibold text-gray-900 dark:text-white">123456</span>
|
<span class="font-semibold text-gray-900 dark:text-white"
|
||||||
|
x-data="{ count: document.getElementById('articles').children.length }"
|
||||||
|
x-on:htmx:load.window="count = document.getElementById('articles').children.length"
|
||||||
|
@delete_row.window="count = document.getElementById('articles').children.length"
|
||||||
|
x-text="count">
|
||||||
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</nav>
|
</nav>
|
||||||
</div>
|
</div>
|
||||||
@@ -107,6 +117,7 @@
|
|||||||
<h3 class="mb-5 text-lg font-normal text-gray-500 dark:text-gray-400">Are you sure you want to delete this article?</h3>
|
<h3 class="mb-5 text-lg font-normal text-gray-500 dark:text-gray-400">Are you sure you want to delete this article?</h3>
|
||||||
<button id="confirmDeleteButton"
|
<button id="confirmDeleteButton"
|
||||||
x-init="$watch('deleteId', () => htmx.process(htmx.find('#confirmDeleteButton')))"
|
x-init="$watch('deleteId', () => htmx.process(htmx.find('#confirmDeleteButton')))"
|
||||||
|
@click="$dispatch('delete_row');"
|
||||||
hx-swap="outerHTML"
|
hx-swap="outerHTML"
|
||||||
x-bind:hx-delete="`/htmx/admin/rows/article/${deleteId}`"
|
x-bind:hx-delete="`/htmx/admin/rows/article/${deleteId}`"
|
||||||
x-bind:hx-target="`#row-${deleteId}`"
|
x-bind:hx-target="`#row-${deleteId}`"
|
||||||
|
|||||||
Reference in New Issue
Block a user