notifications on dashboard

This commit is contained in:
2025-06-04 11:01:06 +02:00
parent 7f97d90f04
commit e948a9e55f
5 changed files with 83 additions and 15 deletions

View File

@@ -57,6 +57,9 @@ def init_routes(main_bp):
active_count = User.query.filter_by(is_active=True).count()
inactive_count = User.query.filter_by(is_active=False).count()
# Get recent notifications
recent_notifications = Notif.query.filter_by(user_id=current_user.id).order_by(Notif.timestamp.desc()).limit(5).all()
# Get recent events (last 7)
if current_user.is_admin:
recent_events = Event.query.order_by(Event.timestamp.desc()).limit(7).all()
@@ -314,7 +317,8 @@ def init_routes(main_bp):
message_count=message_count,
attachment_count=attachment_count,
conversation_total_size=conversation_total_size, # Conversation storage size
recent_conversations=recent_conversations)
recent_conversations=recent_conversations,
recent_notifications=recent_notifications)
UPLOAD_FOLDER = os.path.join(os.getcwd(), 'uploads', 'profile_pics')
if not os.path.exists(UPLOAD_FOLDER):