2017-05-20 13:57:21 +02:00
|
|
|
{% extends 'kfet/base_col_2.html' %}
|
2016-08-04 08:23:34 +02:00
|
|
|
|
2016-08-12 10:03:39 +02:00
|
|
|
{% block title %}Articles{% endblock %}
|
2017-05-20 13:57:21 +02:00
|
|
|
{% block header-title %}Articles{% endblock %}
|
2016-08-04 08:23:34 +02:00
|
|
|
|
2017-06-12 01:51:10 +02:00
|
|
|
{% block fixed %}
|
2016-08-04 08:23:34 +02:00
|
|
|
|
2017-06-12 01:51:10 +02:00
|
|
|
<aside>
|
|
|
|
<div class="heading">
|
2018-03-22 15:25:03 +01:00
|
|
|
{{ nb_articles }}
|
|
|
|
<span class="sub">article{{ nb_articles|pluralize }}</span>
|
|
|
|
</div>
|
|
|
|
<div class="heading">
|
|
|
|
<span class="sub">dont {{ articles|length }} en vente</span>
|
2017-06-12 01:51:10 +02:00
|
|
|
</div>
|
|
|
|
</aside>
|
|
|
|
|
|
|
|
<div class="buttons">
|
|
|
|
<a class="btn btn-primary" href="{% url 'kfet.article.create' %}">
|
2017-05-30 20:44:30 +02:00
|
|
|
<span class="glyphicon glyphicon-plus"></span>
|
|
|
|
<span>Nouvel article</span>
|
2017-05-20 13:57:21 +02:00
|
|
|
</a>
|
2017-06-12 01:51:10 +02:00
|
|
|
<a class="btn btn-primary" href="{% url 'kfet.category' %}">
|
2017-05-20 13:57:21 +02:00
|
|
|
Catégories
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
{% endblock %}
|
|
|
|
|
2017-06-12 01:51:10 +02:00
|
|
|
{% block main %}
|
2018-03-22 15:25:03 +01:00
|
|
|
<h2>Article{{ articles|length|pluralize}} en vente</h2>
|
2017-06-12 01:51:10 +02:00
|
|
|
<div class="table-responsive">
|
kfet -- Tables are sortable
Many tables in kfet app templates become sortable:
account list, negative account list, article list, article inventory
list, article supplier list, article category list, checkout list,
checkout statement list, inventory list, inventory details, order list,
order creation, order details.
This is achieved thanks to the jQuery plugin 'tablesorter':
https://mottie.github.io/tablesorter/docs/
- Affected tables also got sticky headers (it stays visible on scroll).
- Dates format are modified in order to ease the date sorting with the
plugin (it avoids writing a custom parser, or an extractor from
additional hidden element in the table cells).
- Tables whose content is classified by category (of articles) now uses
several tbodies. This has minor effects on the tables style.
- Tags of the header help signs become 'i', instead of 'span', in order
to avoid weird spacing.
2017-11-27 18:24:22 +01:00
|
|
|
<table
|
|
|
|
class="table table-hover table-condensed sortable"
|
2018-04-07 13:42:19 +02:00
|
|
|
{# Initial sort: [(is_sold,desc), (name,asc)] #}
|
kfet -- Tables are sortable
Many tables in kfet app templates become sortable:
account list, negative account list, article list, article inventory
list, article supplier list, article category list, checkout list,
checkout statement list, inventory list, inventory details, order list,
order creation, order details.
This is achieved thanks to the jQuery plugin 'tablesorter':
https://mottie.github.io/tablesorter/docs/
- Affected tables also got sticky headers (it stays visible on scroll).
- Dates format are modified in order to ease the date sorting with the
plugin (it avoids writing a custom parser, or an extractor from
additional hidden element in the table cells).
- Tables whose content is classified by category (of articles) now uses
several tbodies. This has minor effects on the tables style.
- Tags of the header help signs become 'i', instead of 'span', in order
to avoid weird spacing.
2017-11-27 18:24:22 +01:00
|
|
|
data-sortlist="[[3,1], [0,0]]">
|
2017-06-12 01:51:10 +02:00
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<td>Nom</td>
|
|
|
|
<td class="text-right">Prix</td>
|
|
|
|
<td class="text-right">Stock</td>
|
kfet -- Tables are sortable
Many tables in kfet app templates become sortable:
account list, negative account list, article list, article inventory
list, article supplier list, article category list, checkout list,
checkout statement list, inventory list, inventory details, order list,
order creation, order details.
This is achieved thanks to the jQuery plugin 'tablesorter':
https://mottie.github.io/tablesorter/docs/
- Affected tables also got sticky headers (it stays visible on scroll).
- Dates format are modified in order to ease the date sorting with the
plugin (it avoids writing a custom parser, or an extractor from
additional hidden element in the table cells).
- Tables whose content is classified by category (of articles) now uses
several tbodies. This has minor effects on the tables style.
- Tags of the header help signs become 'i', instead of 'span', in order
to avoid weird spacing.
2017-11-27 18:24:22 +01:00
|
|
|
<td class="text-right" data-sorter="article__is_sold">En vente</td>
|
|
|
|
<td class="text-right" data-sorter="article__hidden">Affiché</td>
|
|
|
|
<td class="text-right" data-sorter="shortDate">Dernier inventaire</td>
|
2017-06-12 01:51:10 +02:00
|
|
|
</tr>
|
|
|
|
</thead>
|
kfet -- Tables are sortable
Many tables in kfet app templates become sortable:
account list, negative account list, article list, article inventory
list, article supplier list, article category list, checkout list,
checkout statement list, inventory list, inventory details, order list,
order creation, order details.
This is achieved thanks to the jQuery plugin 'tablesorter':
https://mottie.github.io/tablesorter/docs/
- Affected tables also got sticky headers (it stays visible on scroll).
- Dates format are modified in order to ease the date sorting with the
plugin (it avoids writing a custom parser, or an extractor from
additional hidden element in the table cells).
- Tables whose content is classified by category (of articles) now uses
several tbodies. This has minor effects on the tables style.
- Tags of the header help signs become 'i', instead of 'span', in order
to avoid weird spacing.
2017-11-27 18:24:22 +01:00
|
|
|
{% regroup articles by category as category_list %}
|
|
|
|
|
|
|
|
{% for category in category_list %}
|
|
|
|
<tbody class="tablesorter-no-sort">
|
|
|
|
<tr class="section">
|
|
|
|
<td colspan="6">{{ category.grouper }}</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
<tbody>
|
|
|
|
{% for article in category.list %}
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
<a href="{% url 'kfet.article.read' article.pk %}">
|
|
|
|
{{ article.name }}
|
|
|
|
</a>
|
|
|
|
</td>
|
|
|
|
<td class="text-right">{{ article.price }}€</td>
|
|
|
|
<td class="text-right">{{ article.stock }}</td>
|
|
|
|
<td class="text-right">{{ article.is_sold | yesno:"En vente,Non vendu"}}</td>
|
|
|
|
<td class="text-right">{{ article.hidden | yesno:"Caché,Affiché" }}</td>
|
|
|
|
{% with last_inventory=article.inventory.0 %}
|
|
|
|
<td class="text-right" title="{{ last_inventory.at }}">
|
|
|
|
{{ last_inventory.at|date:'d/m/Y H:i' }}
|
|
|
|
</td>
|
|
|
|
{% endwith %}
|
|
|
|
</tr>
|
|
|
|
{% endfor %}
|
|
|
|
</tbody>
|
|
|
|
{% endfor %}
|
2017-06-12 01:51:10 +02:00
|
|
|
</table>
|
|
|
|
</div>
|
2018-03-22 15:25:03 +01:00
|
|
|
|
|
|
|
<h2>Article{{ not_sold_articles|length|pluralize }} non vendu{{ nots_sold_article|length|pluralize }}</h2>
|
|
|
|
<div class="table-responsive">
|
2018-04-07 14:20:41 +02:00
|
|
|
<table
|
|
|
|
class="table table-hover table-condensed sortable"
|
|
|
|
{# Initial sort: [(is_sold,desc), (name,asc)] #}
|
|
|
|
data-sortlist="[[3,1], [0,0]]">
|
2018-03-22 15:25:03 +01:00
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<td>Nom</td>
|
|
|
|
<td class="text-right">Prix</td>
|
|
|
|
<td class="text-right">Stock</td>
|
2018-04-07 14:20:41 +02:00
|
|
|
<td class="text-right" data-sorter="article__is_sold">En vente</td>
|
|
|
|
<td class="text-right" data-sorter="article__hidden">Affiché</td>
|
|
|
|
<td class="text-right" data-sorter="shortDate">Dernier inventaire</td>
|
2018-03-22 15:25:03 +01:00
|
|
|
</tr>
|
|
|
|
</thead>
|
2018-04-07 14:20:41 +02:00
|
|
|
{% regroup not_sold_articles by category as not_sold_category_list %}
|
|
|
|
|
|
|
|
{% for category in not_sold_category_list %}
|
|
|
|
<tbody class="tablesorter-no-sort">
|
|
|
|
<tr class="section">
|
|
|
|
<td colspan="6">{{ category.grouper }}</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
<tbody>
|
|
|
|
{% for article in category.list %}
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
<a href="{% url 'kfet.article.read' article.pk %}">
|
|
|
|
{{ article.name }}
|
|
|
|
</a>
|
|
|
|
</td>
|
|
|
|
<td class="text-right">{{ article.price }}€</td>
|
|
|
|
<td class="text-right">{{ article.stock }}</td>
|
|
|
|
<td class="text-right">{{ article.is_sold | yesno:"En vente,Non vendu"}}</td>
|
|
|
|
<td class="text-right">{{ article.hidden | yesno:"Caché,Affiché" }}</td>
|
|
|
|
{% with last_inventory=article.inventory.0 %}
|
|
|
|
<td class="text-right" title="{{ last_inventory.at }}">
|
|
|
|
{{ last_inventory.at|date:'d/m/Y H:i' }}
|
|
|
|
</td>
|
|
|
|
{% endwith %}
|
|
|
|
</tr>
|
|
|
|
{% endfor %}
|
|
|
|
</tbody>
|
|
|
|
{% endfor %}
|
2018-03-22 15:25:03 +01:00
|
|
|
</table>
|
|
|
|
</div>
|
2016-08-12 10:03:39 +02:00
|
|
|
</div>
|
2016-08-04 08:23:34 +02:00
|
|
|
|
|
|
|
{% endblock %}
|