Ajout page péremptions

This commit is contained in:
Ambulance Clerc
2022-11-26 10:06:01 +01:00
parent 7ddf6d19b9
commit 760b60d5a6
3 changed files with 67 additions and 0 deletions

View File

@@ -0,0 +1,56 @@
<!DOCTYPE html>
{% load static %}
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<link rel="stylesheet" href="{% static 'vehicles/style.css' %}">
</head>
<body>
<div class="main_container">
{% for vhc in list_vhc %}
{% with 'vehicles/images/ocvs_rtw_'|add:vhc.nStatus|add:'.png' as image_static %}
<div class="child">
<div style="height: 25%;display: flex;padding-top: 10px;" >
<a href="/admin/vehicles/vehicles/{{vhc.id}}/change/" target="_blank" style="font-weight: bold;">{{vhc.sName}}</a><br>
<img height="100px" src="{% static image_static %}" ><br>
{% if vhc.bLucas %}
<span style="align-self: flex-end; padding: 20px;color:orange">Lucas</span>
{% endif %}
</div>
<div class="child_box" style="height: 70%;">
<div style="width: 350px;height: var(--main-child-container-height); ">
<b>Péremptions</b>
<div class="child_box">
<div style="width: 350px;margin-top: 15px">
{% for info in vhc.get_all_infos_perempt_perma %}
<a href="/admin/vehicles/vehicles_infos/{{info.id}}" target="_blank">{{info.sDesc}}</a><br>
{% endfor %}
</div>
<div style="width: 350px;margin-top: 15px">
{% for info in vhc.get_all_infos_perempt %}
<a href="/admin/vehicles/vehicles_infos/{{info.id}}" target="_blank">{{info.sDesc}}</a> <br>
{% endfor %}
</div>
</div>
</div>
</div>
</div>
{% endwith %}
{% endfor %}
</div>
</body>
</html>

View File

@@ -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'),

View File

@@ -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))