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

Change string of draft product

This commit is contained in:
Yoann Pétri 2019-06-10 01:26:54 +02:00
parent f715726a1e
commit ed5b4a6fa7
2 changed files with 8 additions and 4 deletions

View file

@ -98,7 +98,11 @@ class Product(models.Model):
history = HistoricalRecords()
def __str__(self):
return self.name
if self.draft_category == self.DRAFT_NONE:
return self.name + "(" + str(self.amount) + " €)"
else:
return self.name + " (" + str(self.amount) + " €, " + str(self.deg) + "°)"
def user_ranking(self, pk):
"""

View file

@ -133,7 +133,7 @@
{% if forloop.counter0|divisibleby:4 %}
<tr style="text-align:center">
{% endif %}
<td><button class="product {% if product.adherentRequired %}special{% endif%}" target="{{product.pk}}">{{product.name}}</button></td>
<td><button class="product {% if product.adherentRequired %}special{% endif%}" target="{{product.pk}}">{{product}}</button></td>
{% if forloop.counter|divisibleby:4 %}
</tr>
{% endif %}
@ -148,7 +148,7 @@
{% if forloop.counter0|divisibleby:4 %}
<tr style="text-align:center">
{% endif %}
<td><button class="product {% if product.adherentRequired %}special{% endif%}" target="{{product.pk}}">{{product.name}}</button></td>
<td><button class="product {% if product.adherentRequired %}special{% endif%}" target="{{product.pk}}">{{product}}</button></td>
{% if forloop.counter|divisibleby:4 %}
</tr>
{% endif %}
@ -164,7 +164,7 @@
{% if forloop.counter0|divisibleby:4 %}
<tr style="text-align:center">
{% endif %}
<td><button class="menu {% if product.adherent_required %}special{% endif%}" target="{{product.pk}}">{{product.name}}</button></td>
<td><button class="menu {% if product.adherent_required %}special{% endif%}" target="{{product.pk}}">{{product}}</button></td>
{% if forloop.counter|divisibleby:4 %}
</tr>
{% endif %}