Skip to content
Extraits de code Groupes Projets
Valider 6a6a9627 rédigé par Jamesie Pic's avatar Jamesie Pic
Parcourir les fichiers

Added templatetags extracted from memopol

parent 181fa000
Branches
Étiquettes
Aucune requête de fusion associée trouvée
from django import template
from django.utils.safestring import mark_safe
from django.contrib.humanize.templatetags.humanize import naturalday
register = template.Library()
@register.filter
def country_flag(country):
return mark_safe(
'<span class="flag-icon flag-icon-{code}"></span> {name}'.format(
name=country.name,
code=country.code.lower()))
@register.filter
def mandate_date(date, arg=None):
if date.year == 9999:
return 'present'
else:
return naturalday(date, arg)
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter