From a4cdaea4fec6d6bc16357cb08d85f0086b3e3055 Mon Sep 17 00:00:00 2001 From: S4NKALP Date: Thu, 18 Dec 2025 21:28:26 +0545 Subject: [PATCH] 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 ``` --- templates/notifications/dashboard.html | 89 +++++++++++++++++++ .../notifications/notification_detail.html | 71 +++++++++++++++ .../notifications/notification_list.html | 63 +++++++++++++ 3 files changed, 223 insertions(+) create mode 100644 templates/notifications/dashboard.html create mode 100644 templates/notifications/notification_detail.html create mode 100644 templates/notifications/notification_list.html diff --git a/templates/notifications/dashboard.html b/templates/notifications/dashboard.html new file mode 100644 index 0000000..3425fbd --- /dev/null +++ b/templates/notifications/dashboard.html @@ -0,0 +1,89 @@ +{% extends "shared/base.html" %} +{% load static %} + +{% block content %} +{% include "shared/navbar.html" %} + +
+
+
+

Notifications

+ View All +
+ + +
+
+
Pending
+
{{ pending_count }}
+
Waiting to be sent
+
+ +
+
Sent
+
{{ sent_count }}
+
Successfully delivered
+
+ +
+
Failed
+
{{ failed_count }}
+
Need attention
+
+
+ + +
+
+

Recent Notifications

+ View All +
+
+ + + + + + + + + + + + {% for n in recent_notifications %} + + + + + + + + {% empty %} + + + + {% endfor %} + +
RecipientSubjectStatusCreatedSent At
{{ n.recipient }} + + {{ n.subject }} + + + + {{ n.get_status_display }} + + + {{ n.created_at|date:"M d, Y H:i" }} + + {% if n.sent_at %}{{ n.sent_at|date:"M d, Y H:i" }}{% else %}-{% endif %} +
No notifications yet.
+
+
+
+
+{% endblock %} + + diff --git a/templates/notifications/notification_detail.html b/templates/notifications/notification_detail.html new file mode 100644 index 0000000..71b4aa1 --- /dev/null +++ b/templates/notifications/notification_detail.html @@ -0,0 +1,71 @@ +{% extends "shared/base.html" %} +{% load static %} + +{% block content %} +{% include "shared/navbar.html" %} + +
+
+
+

Notification Detail

+
+ +
+
+

Recipient

+

{{ notification.recipient }}

+
+ +
+

Subject

+

{{ notification.subject }}

+
+ +
+

Status

+ + {{ notification.get_status_display }} + +
+ +
+
+

Created At

+

+ {{ notification.created_at|date:"M d, Y H:i" }} +

+
+
+

Sent At

+

+ {% if notification.sent_at %}{{ notification.sent_at|date:"M d, Y H:i" }}{% else %}-{% endif %} +

+
+
+ +
+

Message

+
{{ notification.message }}
+
+ + {% if notification.content_object %} +
+

Related Object

+

+ {{ notification.content_type }} — ID {{ notification.object_id }} +

+
+ {% endif %} + + +
+
+
+{% endblock %} + + diff --git a/templates/notifications/notification_list.html b/templates/notifications/notification_list.html new file mode 100644 index 0000000..96bd326 --- /dev/null +++ b/templates/notifications/notification_list.html @@ -0,0 +1,63 @@ +{% extends "shared/base.html" %} +{% load static %} + +{% block content %} +{% include "shared/navbar.html" %} + +
+
+
+

All Notifications

+ Back to Dashboard +
+ +
+
+ + + + + + + + + + + + {% for n in notifications %} + + + + + + + + {% empty %} + + + + {% endfor %} + +
RecipientSubjectStatusCreatedSent At
{{ n.recipient }} + + {{ n.subject }} + + + + {{ n.get_status_display }} + + + {{ n.created_at|date:"M d, Y H:i" }} + + {% if n.sent_at %}{{ n.sent_at|date:"M d, Y H:i" }}{% else %}-{% endif %} +
No notifications found.
+
+
+
+
+{% endblock %} + +