3
0
Fork 0
mirror of https://github.com/nanoy42/coope synced 2024-07-04 21:04:04 +00:00

Merge branch 'add-features-categories' into 'dev'

Add features categories

See merge request coope/coopev3!15
This commit is contained in:
Nanoy 2019-05-06 08:42:37 +02:00
commit 6792c0e099
2 changed files with 6 additions and 2 deletions

View file

@ -19,6 +19,7 @@
<tr>
<th>Nom</th>
<th>Ordre</th>
<th>Nombre de produits (dont actifs)</th>
<th>Administrer</th>
</tr>
</thead>
@ -27,6 +28,7 @@
<tr>
<td><a href="{% url 'gestion:categoryProfile' category.pk %}">{{ category }}</a></td>
<td>{% if category.order == 0 %}0 (non affichéé){% else %}{{category.order}}{% endif %}</td>
<td>{{category.product_set.count}} ({{category.active_products.count}})</td>
<td><a href="{% url 'gestion:categoryProfile' category.pk %}" class="button small"><i class="fa fa-eye"></i> Profil</a> {% if perms.gestion.change_category %}<a href="{% url 'gestion:editCategory' category.pk %}" class="button small"><i class="fa fa-pencil-alt"></i> Modifier</a>{% endif %}</td>
</tr>
{% endfor %}

View file

@ -142,15 +142,17 @@
</tr>
{% endif %}
{% for category in categories %}
{% if category.active_products.count > 0 %}
<tr style="text-align:center; font-weight:bold;"><td colspan="4">{{category}}</td></tr>
{% for product in category.active_products %}
{% if forloop.counter0|divisibleby:4 %}
<tr style="text-align:center">
{% endif %}
{% endif %}
<td><button class="product {% if product.adherentRequired %}special{% endif%}" target="{{product.pk}}">{{product.name}}</button></td>
{% if forloop.counter|divisibleby:4 %}
{% if forloop.counter|divisibleby:4 %}
</tr>
{% endif %}
{% endif %}
{% endfor %}
{% if not category.active_products|divisibleby:4 %}
</tr>