diff --git a/kfet/templates/kfet/article.html b/kfet/templates/kfet/article.html
index 7966e797..8cec4279 100644
--- a/kfet/templates/kfet/article.html
+++ b/kfet/templates/kfet/article.html
@@ -7,8 +7,11 @@
@@ -25,6 +28,7 @@
{% endblock %}
{% block main %}
+
Article{{ articles|length|pluralize}} en vente
+
+Articles non vendus
+Article{{ not_sold_articles|length|pluralize }} non vendu{{ nots_sold_article|length|pluralize }}
+
+
+
+
+ Nom |
+ Prix |
+ Stock |
+ En vente |
+ Affiché |
+ Dernier inventaire |
+
+
+
+ {% for article in not_sold_articles %}
+ {% ifchanged article.category %}
+
+ {{ article.category.name }} |
+
+ {% endifchanged %}
+
+
+
+ {{ article.name }}
+
+ |
+ {{ article.price }}€ |
+ {{ article.stock }} |
+ {{ article.is_sold | yesno:"En vente,Non vendu"}} |
+ {{ article.hidden | yesno:"Caché,Affiché" }} |
+ {{ article.inventory.0.at }} |
+
+ {% endfor %}
+
+
+
{% endblock %}
diff --git a/kfet/views.py b/kfet/views.py
index 2b69684d..63bd280c 100644
--- a/kfet/views.py
+++ b/kfet/views.py
@@ -706,6 +706,14 @@ class ArticleList(ListView):
)
template_name = 'kfet/article.html'
context_object_name = 'articles'
+
+ def get_context_data(self, **kwargs):
+ context = super().get_context_data(**kwargs)
+ articles = context[self.context_object_name]
+ context['nb_articles'] = len(articles)
+ context[self.context_object_name] = articles.filter(is_sold=True)
+ context['not_sold_articles'] = articles.filter(is_sold=False)
+ return context
# Article - Create