Dashboard subscribers widget
Some checks failed
Rust / Test (push) Has been cancelled
Rust / Rustfmt (push) Has been cancelled
Rust / Clippy (push) Has been cancelled
Rust / Code coverage (push) Has been cancelled

This commit is contained in:
Alphonse Paix
2025-09-26 01:54:48 +02:00
parent 4cb1d2b6fd
commit 0f6b479af9
11 changed files with 246 additions and 9 deletions

View File

@@ -0,0 +1,24 @@
<div id="subscriber-{{ subscriber.id }}"
class="bg-gray-50 rounded-lg p-4 border border-gray-200 {% if subscriber.confirmed() %}border-l-4 border-l-green-500{% else %}border-l-4 border-l-yellow-500{% endif %}">
<div class="flex flex-col sm:flex-row sm:items-start sm:justify-between">
<div class="flex-1">
<div class="text-md font-medium text-gray-900 break-all">{{ subscriber.email }}</div>
<div class="text-sm text-gray-500 mt-1">{{ subscriber.formatted_date() }}</div>
</div>
<div class="mt-3 sm:mt-0 sm:ml-4">
<button hx-delete="/admin/subscribers/{{ subscriber.id }}"
hx-target="#subscriber-{{ subscriber.id }}"
hx-swap="outerHTML"
hx-confirm="Are you sure you want to delete this subscriber?"
class="inline-flex items-center py-1 px-2 text-sm font-medium text-red-500 bg-red-50 border-2 border-dashed border-red-300 rounded-md hover:bg-red-100 hover:border-red-400 hover:text-red-600 transition-all duration-200 group">
<svg class="w-4 h-4 mr-2 group-hover:scale-110 transition-transform"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16" />
</svg>
Delete
</button>
</div>
</div>
</div>