le badge accorde au singulier ou pluriel suivant nb_drafts
This commit is contained in:
parent
c93f97047f
commit
851102a86d
@ -1,6 +1,7 @@
|
||||
from django import template
|
||||
from django.utils.safestring import mark_safe
|
||||
from django.urls import reverse_lazy
|
||||
from django.template.defaultfilters import pluralize
|
||||
|
||||
|
||||
from agenda_culturel.models import Event
|
||||
@ -43,7 +44,6 @@ def show_badges_events():
|
||||
# TODO: seulement ceux dans le futur ?
|
||||
nb_drafts = nb_draft_events()
|
||||
if nb_drafts != 0:
|
||||
return mark_safe('<a href="' + reverse_lazy("view_all_events") + '?status=draft" class="badge" data-tooltip="' + str(nb_drafts) + ' brouillons à valider">' + str(nb_drafts) + '</a>')
|
||||
|
||||
return mark_safe('<a href="' + reverse_lazy("view_all_events") + '?status=draft" class="badge" data-tooltip="' + str(nb_drafts) + ' brouillon' + pluralize(nb_drafts) + ' à valider">' + str(nb_drafts) + '</a>')
|
||||
else:
|
||||
return ""
|
Loading…
Reference in New Issue
Block a user