diff --git a/routes/__pycache__/main.cpython-313.pyc b/routes/__pycache__/main.cpython-313.pyc index 599ff98..fcba5ca 100644 Binary files a/routes/__pycache__/main.cpython-313.pyc and b/routes/__pycache__/main.cpython-313.pyc differ diff --git a/routes/__pycache__/room_files.cpython-313.pyc b/routes/__pycache__/room_files.cpython-313.pyc index 68acc76..6167f99 100644 Binary files a/routes/__pycache__/room_files.cpython-313.pyc and b/routes/__pycache__/room_files.cpython-313.pyc differ diff --git a/routes/main.py b/routes/main.py index 02e419b..0a049f8 100644 --- a/routes/main.py +++ b/routes/main.py @@ -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): diff --git a/templates/components/notification_overview.html b/templates/components/notification_overview.html new file mode 100644 index 0000000..f358002 --- /dev/null +++ b/templates/components/notification_overview.html @@ -0,0 +1,48 @@ +{% macro notification_overview(unread_count, recent_notifications) %} +