couleur par défaut: noir

This commit is contained in:
François Poulain 2024-05-14 09:59:11 +02:00
parent ca2ecf04c5
commit 00a8a28cfc
3 changed files with 4 additions and 4 deletions

View File

@ -15,7 +15,7 @@ class Migration(migrations.Migration):
model_name="ingrédient", model_name="ingrédient",
name="couleur", name="couleur",
field=colorfield.fields.ColorField( field=colorfield.fields.ColorField(
default="#FFFFFF", image_field=None, max_length=25, samples=None default="#000000", image_field=None, max_length=25, samples=None
), ),
), ),
] ]

View File

@ -33,7 +33,7 @@ class Ingrédient(models.Model):
nom = models.CharField(max_length=64) nom = models.CharField(max_length=64)
quantité = models.DecimalField(max_digits=6, decimal_places=3) quantité = models.DecimalField(max_digits=6, decimal_places=3)
ordre = models.SmallIntegerField(default=0) ordre = models.SmallIntegerField(default=0)
couleur = ColorField(default='#FFFFFF') couleur = ColorField(default='#000000')
def __str__(self): def __str__(self):
return f"{self.nom} ({self.quantité} kg)" return f"{self.nom} ({self.quantité} kg)"

View File

@ -24,7 +24,7 @@
<tr> <tr>
<th></th> <th></th>
{% for i in ingrédients %} {% for i in ingrédients %}
<th scope="col" style="text-align:center;{% if i.couleur != '#FFFFFF' %} background-color: {{ i.couleur }};{% endif %}">{{ i.nom }}</th> <th scope="col" style="text-align:center;{% if i.couleur != '#000000' %} background-color: {{ i.couleur }};{% endif %}">{{ i.nom }}</th>
{% endfor %} {% endfor %}
</tr> </tr>
</thead> </thead>
@ -48,7 +48,7 @@
<tr> <tr>
<th></th> <th></th>
{% for i, c in ingrédients %} {% for i, c in ingrédients %}
<th scope="col" style="text-align:center;{% if c != '#FFFFFF' %} background-color: {{ c }};{% endif %}">{{ i }}</th> <th scope="col" style="text-align:center;{% if c != '#000000' %} background-color: {{ c }};{% endif %}">{{ i }}</th>
{% endfor %} {% endfor %}
</tr> </tr>
</thead> </thead>