Files
DevSuite/templates/notifications/notification_list.html
T
sankalp a4cdaea4fe feat(notifications): add notification dashboard and detail views
This commit introduces a comprehensive notification management system with three new templates for displaying and managing notifications.

**New Features**
- Added `dashboard.html` with a notification overview featuring:
  - Summary statistics for pending, sent, and failed notifications
  - A table of recent notifications with status indicators
  - Navigation links to view all notifications
- Added `notification_list.html` for displaying all notifications in a paginated table format
- Added `notification_detail.html` for viewing individual notification details including:
  - Recipient information
  - Subject and message content
  - Status with visual indicators
  - Timestamps for creation and delivery
  - Related object information when available

**Enhancements & Refinements**
- Consistent styling across all notification templates using the existing design system
- Status badges with color coding (success for sent, error for failed, warning for pending)
- Responsive table layouts for better mobile viewing
- Empty state handling for when no notifications exist
```
2025-12-18 21:28:26 +05:45

64 lines
2.8 KiB
HTML

{% extends "shared/base.html" %}
{% load static %}
{% block content %}
{% include "shared/navbar.html" %}
<div class="pt-20 min-h-screen flex flex-col pb-10">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 w-full">
<div class="flex justify-between items-center mb-8">
<h1 class="text-3xl font-bold text-heading">All Notifications</h1>
<a href="{% url 'notifications_dashboard' %}" class="btn btn-ghost btn-sm">Back to Dashboard</a>
</div>
<div class="bg-neutral-secondary-soft rounded-lg shadow-sm border border-default p-6">
<div class="overflow-x-auto">
<table class="table w-full">
<thead>
<tr class="text-body border-b border-default">
<th>Recipient</th>
<th>Subject</th>
<th>Status</th>
<th>Created</th>
<th>Sent At</th>
</tr>
</thead>
<tbody>
{% for n in notifications %}
<tr class="hover:bg-neutral-tertiary border-b border-default last:border-0">
<td class="text-body">{{ n.recipient }}</td>
<td class="font-medium text-heading">
<a href="{% url 'notification_detail' n.pk %}" class="link link-hover">
{{ n.subject }}
</a>
</td>
<td>
<span class="badge badge-sm
{% if n.status == 'SENT' %}badge-success
{% elif n.status == 'FAILED' %}badge-error
{% else %}badge-warning{% endif %}">
{{ n.get_status_display }}
</span>
</td>
<td class="text-body-secondary text-sm">
{{ n.created_at|date:"M d, Y H:i" }}
</td>
<td class="text-body-secondary text-sm">
{% if n.sent_at %}{{ n.sent_at|date:"M d, Y H:i" }}{% else %}-{% endif %}
</td>
</tr>
{% empty %}
<tr>
<td colspan="5" class="text-center text-body-secondary py-4">No notifications found.</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
</div>
{% endblock %}