- Added dedicated route and view for reading individual notifications (/account/notifications/read) - Ensured notification is only marked as read if it hasn't already been - Updated Notification model to use Subject and Body fields - Fixed field references in templates (Title → Subject, Message → Body) - Updated topbar dropdown to use correct field names and display logic - Gracefully handle "notification not found" cases in template output - Ensured consistent template parsing with layout and topbar inclusion - Improved error logging for better diagnosis
13 lines
394 B
HTML
13 lines
394 B
HTML
{{ define "content" }}
|
|
<div class="container py-4">
|
|
{{ if .Notification }}
|
|
<h2>{{ .Notification.Subject }}</h2>
|
|
<p>{{ .Notification.Body }}</p>
|
|
{{ else }}
|
|
<div class="alert alert-danger text-center">
|
|
Notification not found or access denied.
|
|
</div>
|
|
{{ end }}
|
|
<a href="/account/notifications" class="btn btn-secondary mt-4">Back to Notifications</a>
|
|
</div>
|
|
{{ end }} |