3
0
Fork 0
mirror of https://github.com/nanoy42/coope synced 2024-11-25 12:53:11 +00:00

Plural and cotisations

This commit is contained in:
Yoann Pétri 2019-06-10 01:35:48 +02:00
parent ed5b4a6fa7
commit feec35b0b2
2 changed files with 6 additions and 2 deletions

View file

@ -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) + ""

View file

@ -25,7 +25,7 @@
<tbody>
{% for cotisation in cotisations %}
<tr>
<td>{{ cotisation.duration }} jours</td>
<td>{{ cotisation.duration }} jour{{ cotisation.duration|pluralize }}</td>
<td>{{ cotisation.amount }} €</td>
<td>{% if perms.preferences.change_cotisation %}<a class="button small" href="{% url 'preferences:editCotisation' cotisation.pk %}"><i class="fa fa-pencil-alt"></i> Modifier</a> {% endif %}{% if perms.preferences.delete_cotisation %}<a class="button small" href="{% url 'preferences:deleteCotisation' cotisation.pk %}"><i class="fa fa-trash"></i> Supprimer</a>{% endif %}</td>
</tr>