From feec35b0b21ad69b17d7b3bcd45a4e445a4e1c77 Mon Sep 17 00:00:00 2001 From: nanoy Date: Mon, 10 Jun 2019 01:35:48 +0200 Subject: [PATCH] Plural and cotisations --- preferences/models.py | 6 +++++- preferences/templates/preferences/cotisations_index.html | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/preferences/models.py b/preferences/models.py index 31409dd..e854bd7 100644 --- a/preferences/models.py +++ b/preferences/models.py @@ -129,4 +129,8 @@ class Cotisation(models.Model): history = HistoricalRecords() def __str__(self): - return "Cotisation de " + str(self.duration) + " jours pour le prix de " + str(self.amount) + "€" + if self.duration == 1: + jour = "jour" + else: + jour = "jours" + return "Cotisation de " + str(self.duration) + " " + jour + " pour le prix de " + str(self.amount) + "€" diff --git a/preferences/templates/preferences/cotisations_index.html b/preferences/templates/preferences/cotisations_index.html index 8ede5a4..bc52519 100644 --- a/preferences/templates/preferences/cotisations_index.html +++ b/preferences/templates/preferences/cotisations_index.html @@ -25,7 +25,7 @@ {% for cotisation in cotisations %} - {{ cotisation.duration }} jours + {{ cotisation.duration }} jour{{ cotisation.duration|pluralize }} {{ cotisation.amount }} € {% if perms.preferences.change_cotisation %} Modifier {% endif %}{% if perms.preferences.delete_cotisation %} Supprimer{% endif %}