diff --git a/osinaweb/db.sqlite3 b/osinaweb/db.sqlite3 index 61dd0268..936c4312 100644 Binary files a/osinaweb/db.sqlite3 and b/osinaweb/db.sqlite3 differ diff --git a/osinaweb/input.css b/osinaweb/input.css index 37ce3665..cb4514ca 100644 --- a/osinaweb/input.css +++ b/osinaweb/input.css @@ -54,6 +54,7 @@ @media (max-width: 1200px) { #scrollPart { margin-left: 0; + width: 100%; } .fixedSideHeader { diff --git a/osinaweb/osinacore/__pycache__/custom_context.cpython-311.pyc b/osinaweb/osinacore/__pycache__/custom_context.cpython-311.pyc index 5505fa59..a82f7dad 100644 Binary files a/osinaweb/osinacore/__pycache__/custom_context.cpython-311.pyc and b/osinaweb/osinacore/__pycache__/custom_context.cpython-311.pyc differ diff --git a/osinaweb/osinacore/__pycache__/views.cpython-311.pyc b/osinaweb/osinacore/__pycache__/views.cpython-311.pyc index 3f1a7d37..165247bd 100644 Binary files a/osinaweb/osinacore/__pycache__/views.cpython-311.pyc and b/osinaweb/osinacore/__pycache__/views.cpython-311.pyc differ diff --git a/osinaweb/osinacore/custom_context.py b/osinaweb/osinacore/custom_context.py index e4d05acb..32e43357 100644 --- a/osinaweb/osinacore/custom_context.py +++ b/osinaweb/osinacore/custom_context.py @@ -1,6 +1,7 @@ from .models import * from django.contrib.auth.models import AnonymousUser from datetime import datetime, timedelta +from django.shortcuts import get_object_or_404 def calculate_time_ago(status): @@ -42,18 +43,27 @@ def utilities(request): total_tasks = open_task_count + working_on_task_count - latest_statuses = Status.objects.all().order_by('-id')[:12] - + + # Get the current time + current_time = timezone.now() + + # Calculate the datetime of 24 hours ago + twenty_four_hours_ago = current_time - timezone.timedelta(hours=24) + + # Fetch the latest statuses from the last 24 hours + latest_statuses = Status.objects.filter(date__gte=twenty_four_hours_ago).order_by('-id') + # Calculate time ago for each status and store it in a dictionary latest_statuses_time_ago = [{'status': status, 'time_ago': calculate_time_ago(status)} for status in latest_statuses] - - - return {'total_tasks': total_tasks, 'latest_statuses' : latest_statuses, 'latest_statuses_time_ago': latest_statuses_time_ago, 'notes' : notes, 'recent_note' : recent_note,} - - + return {'total_tasks': total_tasks, + 'latest_statuses' : latest_statuses, + 'latest_statuses_time_ago': latest_statuses_time_ago, + 'notes' : notes, + 'recent_note' : recent_note, +} def last_status(request): diff --git a/osinaweb/osinacore/views.py b/osinaweb/osinacore/views.py index 7843a778..71a23e86 100644 --- a/osinaweb/osinacore/views.py +++ b/osinaweb/osinacore/views.py @@ -527,7 +527,38 @@ def status_mobile_modal (request, *args, **kwargs): context = { } - return render(request, 'popup_modals/status-on-mobile-modal.html', context) + return render(request, 'popup_modals/status-on-mobile-modal.html', context) + + + +def user_recent_activities_modal(request, user_id): + current_time = timezone.now() + + # Calculate the datetime of 24 hours ago + twenty_four_hours_ago = current_time - timezone.timedelta(hours=24) + + if user_id: + specific_user = get_object_or_404(User, id=user_id) + + # Fetch the specific user's statuses from the last 24 hours + user_statuses = Status.objects.filter(staff__user=specific_user, date__gte=twenty_four_hours_ago).order_by('-id') + + # Calculate time ago for each user status and store it in a dictionary + user_statuses_time_ago = [{'status': status, 'time_ago': calculate_time_ago(status)} for status in user_statuses] + else: + # No specific user ID provided, fetch statuses for all users in the last 24 hours + all_user_statuses = Status.objects.filter(date__gte=twenty_four_hours_ago).order_by('-id') + + # Calculate time ago for each user status and store it in a dictionary + user_statuses_time_ago = [{'status': status, 'time_ago': calculate_time_ago(status)} for status in all_user_statuses] + + context = { + 'user_statuses_time_ago': user_statuses_time_ago, + } + + return render(request, 'user-recent-activities.html', context) + + @@ -1517,9 +1548,16 @@ def get_latest_activities(request): total_tasks = open_task_count + working_on_task_count - latest_statuses = Status.objects.all().order_by('-id')[:12] + # Get the current time + current_time = timezone.now() + + # Calculate the datetime of 24 hours ago + twenty_four_hours_ago = current_time - timezone.timedelta(hours=24) + + # Fetch the latest statuses from the last 24 hours + latest_statuses = Status.objects.filter(date__gte=twenty_four_hours_ago).order_by('-id') - # Calculate time ago for each status and store it in a list of dictionaries + # Calculate time ago for each status and store it in a dictionary latest_statuses_time_ago = [{'status': status, 'time_ago': calculate_time_ago(status)} for status in latest_statuses] response_data = { diff --git a/osinaweb/osinaweb/__pycache__/urls.cpython-311.pyc b/osinaweb/osinaweb/__pycache__/urls.cpython-311.pyc index 7b0c1c5c..6f9c63bd 100644 Binary files a/osinaweb/osinaweb/__pycache__/urls.cpython-311.pyc and b/osinaweb/osinaweb/__pycache__/urls.cpython-311.pyc differ diff --git a/osinaweb/osinaweb/urls.py b/osinaweb/osinaweb/urls.py index 386d3cea..541e3b8f 100644 --- a/osinaweb/osinaweb/urls.py +++ b/osinaweb/osinaweb/urls.py @@ -85,6 +85,7 @@ urlpatterns = [ path('add-businesscustomer/', views.add_business_modal, name='addbusinesscustomer'), path('add-staffposition/', views.staff_position_modal, name='addstaffposition'), path('statusmobilemodal/', views.status_mobile_modal, name='statusmobilemodal'), + path('userrecentativities/', views.user_recent_activities_modal, name='userrecentativities'), #Save Urls diff --git a/osinaweb/static/dist/output.css b/osinaweb/static/dist/output.css index 7bc9615d..97a8ac35 100644 --- a/osinaweb/static/dist/output.css +++ b/osinaweb/static/dist/output.css @@ -717,6 +717,10 @@ video { top: 0.25rem; } +.top-10 { + top: 2.5rem; +} + .top-3 { top: 0.75rem; } @@ -866,10 +870,6 @@ video { height: 150px; } -.h-\[18px\] { - height: 18px; -} - .h-\[25px\] { height: 25px; } @@ -910,6 +910,10 @@ video { height: 70px; } +.h-\[800px\] { + height: 800px; +} + .h-\[80px\] { height: 80px; } @@ -935,10 +939,6 @@ video { width: 12rem; } -.w-\[100\%\] { - width: 100%; -} - .w-\[100px\] { width: 100px; } @@ -967,10 +967,6 @@ video { width: 160px; } -.w-\[18px\] { - width: 18px; -} - .w-\[20\%\] { width: 20%; } @@ -1515,6 +1511,16 @@ video { background-color: rgb(107 114 128 / var(--tw-bg-opacity)); } +.bg-gray-600 { + --tw-bg-opacity: 1; + background-color: rgb(75 85 99 / var(--tw-bg-opacity)); +} + +.bg-gray-700 { + --tw-bg-opacity: 1; + background-color: rgb(55 65 81 / var(--tw-bg-opacity)); +} + .bg-green-200 { --tw-bg-opacity: 1; background-color: rgb(187 247 208 / var(--tw-bg-opacity)); @@ -2166,6 +2172,7 @@ video { @media (max-width: 1200px) { #scrollPart { margin-left: 0; + width: 100%; } .fixedSideHeader { @@ -2316,6 +2323,10 @@ video { height: 50px; } + .s\:w-\[300px\] { + width: 300px; + } + .s\:w-\[500px\] { width: 500px; } @@ -2361,10 +2372,6 @@ video { display: none; } - .md\:h-\[150px\] { - height: 150px; - } - .md\:h-\[70px\] { height: 70px; } @@ -2416,10 +2423,6 @@ video { } @media (min-width: 1110px) { - .lg\:block { - display: block; - } - .lg\:grid { display: grid; } @@ -2449,10 +2452,6 @@ video { .xlg1\:w-\[74\.5\%\] { width: 74.5%; } - - .xlg1\:w-\[75\%\] { - width: 75%; - } } @media (min-width: 1300px) { @@ -2470,6 +2469,10 @@ video { } @media (min-width: 1350px) { + .xxlg1\:block { + display: block; + } + .xxlg1\:flex { display: flex; } @@ -2478,6 +2481,10 @@ video { display: none; } + .xxlg1\:w-\[75\%\] { + width: 75%; + } + .xxlg1\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } diff --git a/osinaweb/static/images/AZIZ_ALHUMAIDHI_KUWAIT_261116_0812.jpeg b/osinaweb/static/images/AZIZ_ALHUMAIDHI_KUWAIT_261116_0812.jpeg new file mode 100644 index 00000000..69113e93 Binary files /dev/null and b/osinaweb/static/images/AZIZ_ALHUMAIDHI_KUWAIT_261116_0812.jpeg differ diff --git a/osinaweb/static/images/banner.png b/osinaweb/static/images/banner.png new file mode 100644 index 00000000..bd164f4f Binary files /dev/null and b/osinaweb/static/images/banner.png differ diff --git a/osinaweb/static/js/pop-modals.js b/osinaweb/static/js/pop-modals.js index eae5993a..1b7d03d2 100644 --- a/osinaweb/static/js/pop-modals.js +++ b/osinaweb/static/js/pop-modals.js @@ -59,8 +59,10 @@ document.addEventListener("DOMContentLoaded", function () { addButtonClickListener("addTagButton", "fit-content", "160px"); addButtonClickListener("addBusinessButton", "550px", "500px"); addButtonClickListener("addStaffPositionButton", "fit-content", "160px"); - addButtonClickListener("usersActivityIcon", "500px", "600px"); + addButtonClickListener("usersActivityIcon", "400px", "600px"); addButtonClickListener("addStatusButtonMobile", "500px", "80px"); + addButtonClickListener("userRecentActivitiesButton", "400px", "600px"); + diff --git a/osinaweb/templates/.DS_Store b/osinaweb/templates/.DS_Store index 12f47f4d..1ee323e7 100644 Binary files a/osinaweb/templates/.DS_Store and b/osinaweb/templates/.DS_Store differ diff --git a/osinaweb/templates/index.html b/osinaweb/templates/index.html index 983f9eb8..babdbae8 100644 --- a/osinaweb/templates/index.html +++ b/osinaweb/templates/index.html @@ -3,7 +3,8 @@ {% block content %} -
+
Users
@@ -80,7 +81,7 @@
-
+
-