From 760b60d5a6ea6582b5d123b56b877e66273eebdf Mon Sep 17 00:00:00 2001 From: Ambulance Clerc Date: Sat, 26 Nov 2022 10:06:01 +0100 Subject: [PATCH] =?UTF-8?q?Ajout=20page=20p=C3=A9remptions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vehicles/templates/vhc/peremptions.html | 56 +++++++++++++++++++++++++ vehicles/urls.py | 1 + vehicles/views.py | 10 +++++ 3 files changed, 67 insertions(+) create mode 100644 vehicles/templates/vhc/peremptions.html diff --git a/vehicles/templates/vhc/peremptions.html b/vehicles/templates/vhc/peremptions.html new file mode 100644 index 0000000..ed778be --- /dev/null +++ b/vehicles/templates/vhc/peremptions.html @@ -0,0 +1,56 @@ + +{% load static %} + + + + Title + + + +
+{% for vhc in list_vhc %} + {% with 'vehicles/images/ocvs_rtw_'|add:vhc.nStatus|add:'.png' as image_static %} +
+
+ {{vhc.sName}}
+ +
+ {% if vhc.bLucas %} + Lucas + {% endif %} + +
+
+ +
+ Péremptions +
+ +
+ {% for info in vhc.get_all_infos_perempt_perma %} + {{info.sDesc}}
+ {% endfor %} +
+ +
+ {% for info in vhc.get_all_infos_perempt %} + {{info.sDesc}}
+ {% endfor %} +
+ +
+ +
+
+ + + + +
+ {% endwith %} +{% endfor %} +
+ + + + diff --git a/vehicles/urls.py b/vehicles/urls.py index e4815ff..455c0bc 100644 --- a/vehicles/urls.py +++ b/vehicles/urls.py @@ -8,6 +8,7 @@ from . import views app_name = "vehicles" urlpatterns = [ path('vhc', views.view_vhc, name='view_vhc'), + path('peremptions', views.view_peremptions, name='view_peremptions'), diff --git a/vehicles/views.py b/vehicles/views.py index d50abb9..93c2895 100644 --- a/vehicles/views.py +++ b/vehicles/views.py @@ -15,4 +15,14 @@ def view_vhc(request): print("passs 1 ligne 12") + return HttpResponse(template.render(context,request)) + +@xframe_options_exempt +def view_peremptions(request): + template = loader.get_template("vhc/peremptions.html") + a_vhc = Vehicles.objects.all().order_by("nStatus","nOrder") + context = {'list_vhc': a_vhc} + print("passs 1 ligne 12") + + return HttpResponse(template.render(context,request))