Changement de champ rainbow du modèle : Bool > Choice
This commit is contained in:
parent
45fdd4683b
commit
079e0d1c3f
2 changed files with 2 additions and 2 deletions
|
@ -7,7 +7,7 @@ class Actu(models.Model):
|
||||||
text = models.TextField(_("Info"), null=True, blank=False)
|
text = models.TextField(_("Info"), null=True, blank=False)
|
||||||
text_en = models.TextField(("Info en anglais"), null=True, blank=True)
|
text_en = models.TextField(("Info en anglais"), null=True, blank=True)
|
||||||
order = models.IntegerField(verbose_name=_("ordre"))
|
order = models.IntegerField(verbose_name=_("ordre"))
|
||||||
rainbow = models.BooleanField(_("Actu en arc-en-ciel"), default=False)
|
rainbow = models.CharField(verbose_name = _("Actu en arc-en-ciel"), max_length=1, choices = (('y', 'Oui'), ('n', 'Non')), default='n', blank = False)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.text
|
return self.text
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
<h4> <span class="ernestocouleur">{% blocktrans count counter=actu|length %}Actualité des chef·fe·s:{% plural %}Actualités des chef·fe·s:{% endblocktrans %}</span></h4>
|
<h4> <span class="ernestocouleur">{% blocktrans count counter=actu|length %}Actualité des chef·fe·s:{% plural %}Actualités des chef·fe·s:{% endblocktrans %}</span></h4>
|
||||||
<ul>
|
<ul>
|
||||||
{% for a in actu %}
|
{% for a in actu %}
|
||||||
<li>{% if a.rainbow %}<span class="ernestocouleur font-weight-bold">{% endif %}{% autotranslate current_language a.text a.text_en %}{% if a.rainbow %}</span>{% endif %}</li>
|
<li>{% if a.rainbow == 'y' %}<span class="ernestocouleur font-weight-bold">{% endif %}{% autotranslate current_language a.text a.text_en %}{% if a.rainbow %}</span>{% endif %}</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue