Test refont grahpique véhicules

This commit is contained in:
Ambulance Clerc
2022-11-10 17:31:49 +01:00
parent 4fa883235b
commit 93842a9b63
7 changed files with 11 additions and 7 deletions

View File

@@ -4,8 +4,8 @@ from vehicles.models import *
class _vhc_admin(admin.ModelAdmin):
list_display = ('sName', 'nBases', 'nStatus')
list_display = ('sName', 'nBases', 'nStatus', "bLucas")
ordering = ["nOrder"]
search_fields = ['sName']

View File

@@ -10,9 +10,9 @@ BASES_CHOICES = [
]
STATUS_CHOICES = [
('1', 'Opérationnel'),
('2', 'Hors Service'),
('3', 'Réserve'),
('4', 'Utilisation altérée'),
('2', 'Réserve'),
('3', 'Utilisation altérée'),
('4', 'Hors Service'),
]
TYPES_CHOICES = [
('1', 'Technique'),
@@ -25,6 +25,8 @@ class Vehicles(models.Model):
sName = models.CharField("Indicatif", max_length=250)
nBases = models.CharField('Basé à ', max_length=1, choices=BASES_CHOICES, default=1)
nStatus = models.CharField('Statut', max_length=1, choices=STATUS_CHOICES, default=1)
bLucas = models.BooleanField("Lucas", default=0)
nOrder = models.IntegerField("Ordre", default=0)
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 452 KiB

After

Width:  |  Height:  |  Size: 507 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 507 KiB

After

Width:  |  Height:  |  Size: 478 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 478 KiB

After

Width:  |  Height:  |  Size: 452 KiB

View File

@@ -12,10 +12,12 @@
{% with 'vehicles/images/ocvs_rtw_'|add:vhc.nStatus|add:'.png' as image_static %}
<div class="child">
<div style="height: 25%;display: flex;" >
<b>{{vhc.sName}}</b><br>
<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;">Lucas</span>
{% endif %}
</div>
<div class="child_box" style="height: 70%;">

View File

@@ -10,7 +10,7 @@ from vehicles.models import *
@xframe_options_exempt
def view_vhc(request):
template = loader.get_template("vhc/vhc.html")
a_vhc = Vehicles.objects.all()
a_vhc = Vehicles.objects.all().order_by("nStatus","nOrder")
context = {'list_vhc': a_vhc}
print("passs 1 ligne 12")