mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-11 04:19:25 +00:00
Stock admin gestion, items list views, create and edit items
This commit is contained in:
@ -1,15 +1,30 @@
|
||||
{% extends "core/base.jinja" %}
|
||||
|
||||
{% block title %}
|
||||
{% trans s=stock %}{{stock}}{% endtrans %}
|
||||
{{ stock }}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{% if current_tab == "stocks" %}
|
||||
<p><a href="{{ url('stock:new_item', stock_id=stock.id)}}?stock={{stock.id}}">{% trans %}New item{% endtrans %}</a></p>
|
||||
<p><a href="{{ url('stock:new_item', stock_id=stock.id)}}">{% trans %}New item{% endtrans %}</a></p>
|
||||
{% endif %}
|
||||
{% if stock %}
|
||||
<h3>{{ stock }}</h3>
|
||||
{% for t in ProductType.objects.order_by('name') %}
|
||||
<h4>{{ t }}</h4>
|
||||
<ul>
|
||||
{% for i in stock.items.filter(type=t).order_by('name') %}
|
||||
<li><a href="{{ url('stock:edit_item', item_id=i.id)}}">{{ i }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endfor %}
|
||||
<h4>{% trans %}Others{% endtrans %}</h4>
|
||||
<ul>
|
||||
{% for i in stock.items.filter(type=None).order_by('name') %}
|
||||
<li><a href="{{ url('stock:edit_item', item_id=i.id)}}">{{ i }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% else %}
|
||||
{% trans %}There is no items in this stock.{% endtrans %}
|
||||
{% endif %}
|
||||
<h3>{% trans s=stock %}{{stock}}{% endtrans %}</h3>
|
||||
|
||||
|
||||
|
||||
{% endblock %}
|
@ -11,7 +11,7 @@
|
||||
{% for s in stock_list.order_by('name') %}
|
||||
<li>
|
||||
{% if user.can_edit(s) %}
|
||||
<a href="{{ url('stock:items_list', stock_id=s.id)}}?stock={{s.id}}">{{s}}</a>
|
||||
<a href="{{ url('stock:items_list', stock_id=s.id)}}">{{s}}</a>
|
||||
- <a href="{{ url('stock:edit', stock_id=s.id) }}">Edit</a>
|
||||
{% endif %}
|
||||
</li>
|
||||
|
Reference in New Issue
Block a user