Sith/counter/templates/counter/product_list.jinja

35 lines
990 B
Plaintext
Raw Normal View History

{% extends "core/base.jinja" %}
2016-07-27 15:23:02 +00:00
{% block title %}
{% trans %}Product list{% endtrans %}
{% endblock %}
{% block content %}
2016-09-08 00:09:17 +00:00
{% if current_tab == "products" %}
2016-07-27 15:23:02 +00:00
<p><a href="{{ url('counter:new_product') }}">{% trans %}New product{% endtrans %}</a></p>
{% endif %}
2016-07-27 15:23:02 +00:00
{% if product_list %}
<h3>{% trans %}Product list{% endtrans %}</h3>
{% for t in ProductType.objects.all().order_by('name') %}
<h4>{{ t }}</h4>
2016-07-27 15:23:02 +00:00
<ul>
{% for p in product_list.filter(product_type=t).all().order_by('name') %}
2016-10-03 22:41:08 +00:00
<li><a href="{{ url('counter:product_edit', product_id=p.id) }}">{{ p }} ({{ p.code }})</a></li>
2016-07-27 15:23:02 +00:00
{% endfor %}
</ul>
{% endfor %}
2016-09-29 14:19:05 +00:00
<h4>{% trans %}Uncategorized{% endtrans %}</h4>
<ul>
{% for p in product_list.filter(product_type=None).all().order_by('name') %}
2016-10-03 22:41:08 +00:00
<li><a href="{{ url('counter:product_edit', product_id=p.id) }}">{{ p }} ({{ p.code }})</a></li>
2016-09-29 14:19:05 +00:00
{% endfor %}
</ul>
2016-07-27 15:23:02 +00:00
{% else %}
{% trans %}There is no products in this website.{% endtrans %}
{% endif %}
{% endblock %}