Enhances user experience with dark‑mode detection, responsive layout, and streamlined role selection workflow
43 lines
3.3 KiB
HTML
43 lines
3.3 KiB
HTML
<div class="bg-white dark:bg-gray-950 rounded-xl shadow-lg border border-gray-200 dark:border-gray-600 w-80 overflow-hidden">
|
|
<div class="flex items-center justify-between px-4 py-3 border-b border-gray-200 dark:border-gray-600">
|
|
<h3 class="text-sm font-semibold">Notifications</h3>
|
|
<a href="#"
|
|
hx-get="{% url 'notifications-mark-all-read' %}"
|
|
hx-target="closest .bg-white"
|
|
hx-swap="outerHTML"
|
|
class="text-xs text-blue-600 hover:underline">Mark all as read</a>
|
|
</div>
|
|
<div class="max-h-96 overflow-y-auto">
|
|
{% for notif in notifications %}
|
|
<a href="{% url 'notification-mark-read' notif.id %}?next={% url 'ticket-detail' notif.data.ticket_id %}" class="block px-4 py-3 hover:bg-gray-50 dark:hover:bg-gray-800 border-b border-gray-100 dark:border-gray-600 last:border-0">
|
|
<div class="flex items-start gap-3">
|
|
<span class="mt-0.5 text-gray-400 dark:text-gray-500 flex-shrink-0">
|
|
{% if notif.type == "comment_added" %}
|
|
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"/></svg>
|
|
{% elif notif.type == "status_changed" %}
|
|
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M13 7l5 5m0 0l-5 5m5-5H6"/></svg>
|
|
{% else %}
|
|
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0"/></svg>
|
|
{% endif %}
|
|
</span>
|
|
<div class="flex-1 min-w-0">
|
|
<p class="text-sm font-medium text-gray-900 dark:text-gray-100 truncate">{{ notif.title }}</p>
|
|
{% if notif.message %}
|
|
<p class="text-xs text-gray-500 dark:text-gray-400 truncate">{{ notif.message }}</p>
|
|
{% endif %}
|
|
<p class="text-xs text-gray-400 dark:text-gray-500 mt-1">{{ notif.created_at|timesince }} ago</p>
|
|
</div>
|
|
</div>
|
|
</a>
|
|
{% empty %}
|
|
<div class="px-4 py-8 text-center text-sm text-gray-500 dark:text-gray-400">
|
|
<svg xmlns="http://www.w3.org/2000/svg" class="h-8 w-8 mx-auto mb-2 text-gray-300 dark:text-gray-600" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="1.5"><path stroke-linecap="round" stroke-linejoin="round" d="M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0"/></svg>
|
|
No new notifications
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
<div class="border-t border-gray-200 dark:border-gray-600 px-4 py-2 text-center">
|
|
<a href="{% url 'notifications-list' %}" class="text-sm text-blue-600 hover:underline">View all notifications</a>
|
|
</div>
|
|
</div>
|