mirror of
https://github.com/nanoy42/coope
synced 2024-11-05 01:16:28 +00:00
Plural and cotisations
This commit is contained in:
parent
ed5b4a6fa7
commit
feec35b0b2
2 changed files with 6 additions and 2 deletions
|
@ -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) + "€"
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in a new issue