Files
zero2prod/templates/dashboard/subscribers/card.html
Alphonse Paix de44564ba0
All checks were successful
Rust / Test (push) Successful in 5m34s
Rust / Rustfmt (push) Successful in 22s
Rust / Clippy (push) Successful in 1m13s
Rust / Code coverage (push) Successful in 3m33s
Templates and TLS requests
Refactored HTML templates and added TLS back to issue HTTP requests
2025-09-29 02:39:53 +02:00

25 lines
1.6 KiB
HTML

<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>