64 lines
3.5 KiB
HTML
64 lines
3.5 KiB
HTML
<div class="bg-white rounded-lg shadow-md border border-gray-200 mb-8">
|
|
<div class="p-6 border-b border-gray-200">
|
|
<div class="flex flex-col sm:flex-row sm:items-center sm:justify-between">
|
|
<div>
|
|
<h2 class="text-xl font-semibold text-gray-900 flex items-center">
|
|
<svg class="w-5 h-5 text-blue-600 mr-2"
|
|
fill="none"
|
|
viewBox="0 0 24 24"
|
|
stroke="currentColor">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
|
d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"/>
|
|
<circle cx="9" cy="7" r="4"/>
|
|
<path d="M23 21v-2a4 4 0 0 0-3-3.87"/>
|
|
<path d="M16 3.13a4 4 0 0 1 0 7.75"/>
|
|
</svg>
|
|
Subscribers management
|
|
</h2>
|
|
<p class="text-sm text-gray-600 mt-1">View and manage your subscribers.</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div id="subscribers-list" class="py-6 space-y-6">
|
|
{% block subs %}
|
|
{% if subscribers.is_empty() %}
|
|
<div class="bg-gray-50 rounded-lg p-8 border-2 border-dashed border-gray-300 text-center">
|
|
<div class="w-16 h-16 bg-gray-200 rounded-full flex items-center justify-center mx-auto mb-4">
|
|
<svg class="w-8 h-8 text-gray-500"
|
|
fill="none"
|
|
viewBox="0 0 24 24"
|
|
stroke="currentColor">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
|
d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"/>
|
|
</svg>
|
|
</div>
|
|
<h3 class="text-lg font-medium text-gray-900 mb-2">No data available</h3>
|
|
<p class="text-gray-600">Content may have shifted due to recent updates or list is empty.</p>
|
|
</div>
|
|
{% else %}
|
|
<div class="divide-y divide-gray-200">
|
|
{% for subscriber in subscribers %}
|
|
{% include "dashboard/subscribers/card.html" %}
|
|
{% endfor %}
|
|
</div>
|
|
{% endif %}
|
|
<div class="flex items-center justify-center space-x-2">
|
|
<button hx-get="/admin/subscribers?page={{ current_page - 1 }}"
|
|
hx-target="#subscribers-list"
|
|
hx-swap="innerHTML"
|
|
hx-trigger="click"
|
|
class="px-3 py-1 text-sm font-medium text-gray-500 rounded-md hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 {% if current_page <= 1 %}opacity-50 cursor-not-allowed{% endif %}"
|
|
{% if current_page <= 1 %}disabled{% endif %}><</button>
|
|
<span class="px-3 py-1 text-sm font-medium text-gray-700 bg-gray-100 rounded-md">Page: {{ current_page }}</span>
|
|
<button hx-get="/admin/subscribers?page={{ current_page + 1 }}"
|
|
hx-target="#subscribers-list"
|
|
hx-swap="innerHTML"
|
|
hx-trigger="click"
|
|
class="px-3 py-1 text-sm font-medium text-gray-500 rounded-md hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 {% if current_page >= max_page %}opacity-50 cursor-not-allowed{% endif %}"
|
|
{% if current_page>= max_page %}disabled{% endif %}>>
|
|
</button>
|
|
</div>
|
|
{% endblock %}
|
|
</div>
|
|
</div>
|