
- Added Notification model with admin interface for managing notifications. - Created context processor to count unread notifications for the user. - Introduced forms for updating the status of Risk, Control, Incident, and ResidualRisk. - Added views for displaying and managing notifications, including marking them as read. - Updated URLs to include routes for notifications and status updates. - Enhanced templates to support notifications display and status update forms. - Improved CSS for avatar and badge display in the navbar. - Translated various static texts to support internationalization.
7 lines
No EOL
292 B
Python
7 lines
No EOL
292 B
Python
def unread_notifications_count(request):
|
|
if not request.user.is_authenticated:
|
|
return {"notifications_unread_count": 0}
|
|
from .models import Notification
|
|
return {
|
|
"notifications_unread_count": Notification.objects.filter(user=request.user, read=False).count()
|
|
} |