Browse Source

Change string of draft product

pull/1/head
Yoann Piétri 7 years ago
parent
commit
ed5b4a6fa7
  1. 6
      gestion/models.py
  2. 6
      gestion/templates/gestion/manage.html

6
gestion/models.py

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

6
gestion/templates/gestion/manage.html

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

Loading…
Cancel
Save