3
0
Fork 0
mirror of https://github.com/nanoy42/coope synced 2024-12-24 16:03:47 +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() history = HistoricalRecords()
def __str__(self): 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> <tbody>
{% for cotisation in cotisations %} {% for cotisation in cotisations %}
<tr> <tr>
<td>{{ cotisation.duration }} jours</td> <td>{{ cotisation.duration }} jour{{ cotisation.duration|pluralize }}</td>
<td>{{ cotisation.amount }} €</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> <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> </tr>