schimbare history in dashboard
This commit is contained in:
@@ -50,3 +50,9 @@ docker compose exec web python manage.py migrate
|
|||||||
docker compose exec web python manage.py import_access
|
docker compose exec web python manage.py import_access
|
||||||
|
|
||||||
docker compose exec web python manage.py clear_database
|
docker compose exec web python manage.py clear_database
|
||||||
|
|
||||||
|
git add .
|
||||||
|
git commit -m " -- comentariu -- "
|
||||||
|
git push
|
||||||
|
|
||||||
|
git pull
|
||||||
|
|||||||
@@ -63,7 +63,9 @@
|
|||||||
<span class="text-danger">șters</span>
|
<span class="text-danger">șters</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<br>
|
<br>
|
||||||
<span class="text-dark">{{ record.equipment_code }}</span>
|
<span class="text-dark fw-bold">
|
||||||
|
{{ record.equipment_code|default:record.name }}
|
||||||
|
</span>
|
||||||
</li>
|
</li>
|
||||||
{% empty %}
|
{% empty %}
|
||||||
<li class="list-group-item text-muted text-center py-4">Nu există acțiuni recente.</li>
|
<li class="list-group-item text-muted text-center py-4">Nu există acțiuni recente.</li>
|
||||||
|
|||||||
+4
-1
@@ -568,10 +568,13 @@ def dashboard_view(request):
|
|||||||
pc_hist = Computer.history.all()[:10]
|
pc_hist = Computer.history.all()[:10]
|
||||||
mon_hist = Monitor.history.all()[:10]
|
mon_hist = Monitor.history.all()[:10]
|
||||||
per_hist = Peripheral.history.all()[:10]
|
per_hist = Peripheral.history.all()[:10]
|
||||||
|
emp_hist = Employee.history.all()[:10]
|
||||||
|
|
||||||
# Combinăm listele și le sortăm descrescător după data acțiunii (history_date)
|
# Combinăm listele și le sortăm descrescător după data acțiunii (history_date)
|
||||||
activity_log = sorted(
|
activity_log = sorted(
|
||||||
chain(pc_hist, mon_hist, per_hist), key=attrgetter("history_date"), reverse=True
|
chain(pc_hist, mon_hist, per_hist, emp_hist),
|
||||||
|
key=attrgetter("history_date"),
|
||||||
|
reverse=True,
|
||||||
)[
|
)[
|
||||||
:10
|
:10
|
||||||
] # Păstrăm doar ultimele 10 cele mai recente acțiuni în total
|
] # Păstrăm doar ultimele 10 cele mai recente acțiuni în total
|
||||||
|
|||||||
Reference in New Issue
Block a user