Browse Source

Plural and cotisations

pull/1/head
Yoann Piétri 7 years ago
parent
commit
feec35b0b2
  1. 6
      preferences/models.py
  2. 2
      preferences/templates/preferences/cotisations_index.html

6
preferences/models.py

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

2
preferences/templates/preferences/cotisations_index.html

@ -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>

Loading…
Cancel
Save