From 6d909d5883af0b388cbc0e19242c5af0d85f3ae3 Mon Sep 17 00:00:00 2001 From: Thomas Rusiecki Date: Thu, 5 Dec 2024 18:31:30 -0300 Subject: [PATCH] stylish new popup for state change --- device/templates/details.html | 85 +++++++++++++++++++++++++++++++++-- device/views.py | 2 + 2 files changed, 83 insertions(+), 4 deletions(-) diff --git a/device/templates/details.html b/device/templates/details.html index 0bc6e84..7d89989 100644 --- a/device/templates/details.html +++ b/device/templates/details.html @@ -2,11 +2,30 @@ {% load i18n %} {% block content %} -
-
-

{{ object.shortid }}

-
+ +
+
+

{{ object.shortid }}

+
+ + + +
+
@@ -294,6 +313,64 @@
+ + +{% for state in state_definitions %} + +{% endfor %} + + {% endblock %} {% block extrascript %} diff --git a/device/views.py b/device/views.py index 98fcd0f..4ea0f0b 100644 --- a/device/views.py +++ b/device/views.py @@ -14,6 +14,7 @@ from django.views.generic.edit import ( DeleteView, ) from django.views.generic.base import TemplateView +from action.models import StateDefinition from dashboard.mixins import DashboardView, Http403 from evidence.models import UserProperty, SystemProperty, Property from lot.models import LotTag @@ -112,6 +113,7 @@ class DetailsView(DashboardView, TemplateView): 'object': self.object, 'snapshot': self.object.get_last_evidence(), 'lot_tags': lot_tags, + "state_definitions": StateDefinition.objects.filter(institution=self.request.user.institution).order_by('order'), }) return context