Sith/stock/templates/stock/shopping_list_items.jinja

51 lines
1.2 KiB
Django/Jinja

{% extends "core/base.jinja" %}
{% block title %}
{% trans %}{{ shoppinglist }}'s items{% endtrans %}
{% endblock %}
{% block content %}
{% if current_tab == "stocks" %}
<a href="{{ url('stock:shoppinglist_list', stock_id=shoppinglist.stock_owner.id)}}">{% trans %}Back{% endtrans %}</a>
{% endif %}
<h3>{{ shoppinglist.name }}</h3>
{% for t in ProductType.objects.order_by('name').all() %}
{% if shoppinglist.shopping_items_to_buy.filter(type=t) %}
<h4>{{ t }}</h4>
<br>
<table>
<thead>
<tr>
<td>{% trans %}Name{% endtrans %}</td>
<td>{% trans %}Quantity asked{% endtrans %}</td>
<td>{% trans %}Quantity bought{% endtrans %}</td>
</tr>
</thead>
<tbody>
{% for i in shoppinglist.shopping_items_to_buy.filter(type=t).order_by('name').all() %}
<tr>
<td>{{ i.name }}</td>
<td>{{ i.tobuy_quantity }}</td>
<td>{{ i.bought_quantity }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endif %}
{% endfor %}
<h4>{% trans %}Other{% endtrans %}</h4>
<br>
<table>
<thead>
<tr>
<td>{% trans %}Comments{% endtrans %}</td>
</tr>
</thead>
<tbody>
<tr>
<td>{{ shoppinglist.comment }}</td>
</tr>
</tbody>
</table>
{% endblock %}