From d80de241a4fa3b4cc7ded445463f2a52c7f9a2a1 Mon Sep 17 00:00:00 2001 From: emile Date: Thu, 21 Mar 2024 10:38:12 +0200 Subject: [PATCH] New --- .../custom_context.cpython-310.pyc | Bin 2434 -> 2666 bytes osinaweb/osinacore/custom_context.py | 7 +- osinaweb/osinacore/templates/index.html | 142 +----------------- .../__pycache__/middleware.cpython-310.pyc | Bin 1202 -> 1202 bytes 4 files changed, 14 insertions(+), 135 deletions(-) diff --git a/osinaweb/osinacore/__pycache__/custom_context.cpython-310.pyc b/osinaweb/osinacore/__pycache__/custom_context.cpython-310.pyc index 3353e4582ec68f1de0a5650a59ed252a50d8ca42..9208d6a218d546cf5602861dd6325e3bc45c97ac 100644 GIT binary patch delta 804 zcmYjN&ui2`6wb?!NjBL{yY1F02v#qW{?aN~P+F9hLThb>s+3+r>|`}zP3mM;#3mH1 z-rUpRMLcx>1o5bUfOl_m^QZ^Gb3vTR#_GWPnD>3(d-LAB9R1O9(?-Kq#CiAYIBYaO zxL?$Rx=2kCOCqurP!y`f5UUul+JhqvYki1yYGC~ku+f7UVGSc}_S6EXDV;fBs|SUO zl|mDt=SpnFHL^hMQWY7liB1l-`+ybfyjIT$=U?@plI#6{rQ2nT2HB==IZC}8Wk@)T zifNoMC^=s}*d1tPHjL}o?Wsrq)l_`rghz>vhl&G30LqOVjVpyon@1z!87sGFGakjm zxY>i#N>QV&a+ew&DK{DILt*0<9($$a_Ofyag_E1PojbXf>$!?gy+>P$H@?BqX3~k0 z&;!yE-^t#*t8I zNH}^Hbh=^2tsqHKD&FAQo!~il2DIOaGRo^)vgO@DM>4@SjI(UtxPP(EO%gs8)pTd5 z8ak^MBC}#rGA&_-eKV%PV=nU0q$H-;0=i&b6W2*_HMWapkqYRTtbBZn_Tk)w^vp}R zDdDn&ISGpruCq(l)RkNEdRqXmJx;qM^MgkzS(oIRgjK0H;v;A`^J(-XB+KlLHDySC WjeWM}V3qx}9-x)d%+_l2aP<$PK;3iz delta 571 zcmZ8d%W4!s6s_v6M_11)!9Wr)gt$;UlMFG4fiMs?Dk!20A>b-ZtTIWH%xHD>Mym<< zSWY&zm5>2{KwP?X;}^K-KTtRBbz$9hP_f_~>Yj7Yy;OajdU2*XXf$HvkNWmQowVLH zKLtlnGmlM=td0?qsK6e9MJYj*0OrwID+G*Xd zVV0R%+K@uVLp*~DZkp9oxU5wVsgH268OerhzCt#-fnMT5SZX6HEVhAcy`c|KGI1}# zCCM|TpV4L6GwKWcR!QzZQT+t#DPOo_@&T{AJ9H6Km(#l>Y3VuFW@jh(U?)|NOjfeT z`v*p8cZ+RJ#wFM4X|6J(6Q9-K+8ZKpvyojZd$Zg*Wh~1Qz`Zaxz4tGy90e4#H&CX;M6kHGkLac_79a_cSf`+ X=r`S4aS3m@&ti*pt7f+vui?%wx95tk diff --git a/osinaweb/osinacore/custom_context.py b/osinaweb/osinacore/custom_context.py index 32e43357..668e144b 100644 --- a/osinaweb/osinacore/custom_context.py +++ b/osinaweb/osinacore/custom_context.py @@ -21,6 +21,10 @@ def calculate_time_ago(status): def utilities(request): + user_ids_online = Connection.objects.filter(status='Online').values('user_id').annotate(last_online=Max('date')).values_list('user_id', flat=True) + + # Now, filter StaffProfile objects associated with these user ids + online_staff_profiles = StaffProfile.objects.filter(user_id__in=user_ids_online) notes = None recent_note = None if request.user.is_authenticated: @@ -63,6 +67,7 @@ def utilities(request): 'latest_statuses_time_ago': latest_statuses_time_ago, 'notes' : notes, 'recent_note' : recent_note, + 'online_staff_profiles' : online_staff_profiles, } @@ -99,7 +104,7 @@ def last_status(request): - return {'last_status' : last_status, 'current_date' : current_date, 'minutes_ago' : minutes_ago, 'hours_minutes_ago': hours_minutes_ago,} + return {'last_status' : last_status, 'current_date' : current_date, 'minutes_ago' : minutes_ago, 'hours_minutes_ago': hours_minutes_ago} diff --git a/osinaweb/osinacore/templates/index.html b/osinaweb/osinacore/templates/index.html index 412e1d66..6d7eddd1 100644 --- a/osinaweb/osinacore/templates/index.html +++ b/osinaweb/osinacore/templates/index.html @@ -598,151 +598,25 @@

14 - Connected User

+ class="text-green-700"> + Connected Users

+ + {% for online in online_staff_profiles %}
-
- User Image -
-
-
- -
- User Image -
-
-
- -
- User Image -
-
-
- -
- User Image -
-
-
- -
- User Image -
-
-
- -
- User Image -
-
-
- -
- User Image -
-
-
- -
- User Image -
-
-
- -
- User Image -
-
-
- -
- User Image -
-
-
- -
- User Image -
-
-
- -
- User Image -
-
-
- -
- User Image -
-
-
-
- User Image
+ {% endfor %} +
diff --git a/osinaweb/osinaweb/__pycache__/middleware.cpython-310.pyc b/osinaweb/osinaweb/__pycache__/middleware.cpython-310.pyc index 6b08a6a559040bc56df41e03ed3693781990815e..c97daa4f5d4282db2e561daa74ba64c2d6e4fb00 100644 GIT binary patch delta 18 YcmdnQxrviApO=@50SK0F