Ce serveur Gitlab sera éteint le 30 juin 2020, pensez à migrer vos projets vers les serveurs gitlab-research.centralesupelec.fr et gitlab-student.centralesupelec.fr !

Commit 3777ec0f authored by Grizzly's avatar Grizzly

prise en compte des type non booléens

parent b8c50385
......@@ -28,14 +28,12 @@ register = template.Library()
@register.filter(needs_autoescape=False)
def tick(valeur, autoescape=False):
if autoescape:
esc = conditional_escape
else:
esc = lambda x: x
if isinstance(valeur,bool):
if valeur == True:
result = '<i style="color: #1ECA18;" class="fas fa-check"></i>'
else:
result = '<i style="color: #D10115;" class="fas fa-times"></i>'
return mark_safe(result)
if valeur == True:
result = '<i style="color: #1ECA18;" class="fas fa-check"></i>'
else:
result = '<i style="color: #D10115;" class="fas fa-times"></i>'
return mark_safe(result)
else: # if the value is not a boolean, display it as if tick was not called
return valeur
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment