Creation of the Stock list, edit, create views and creation StockItem create view

This commit is contained in:
guillaume-renaud
2016-11-09 17:49:19 +01:00
parent ccb339b9bd
commit 887893fb2d
9 changed files with 2972 additions and 14 deletions

View File

@ -31,14 +31,14 @@
{% if user.can_edit(c) %}
<a href="{{ url('counter:admin', counter_id=c.id) }}">{% trans %}Edit{% endtrans %}</a> -
<a href="{{ url('counter:stats', counter_id=c.id) }}">{% trans %}Stats{% endtrans %}</a> -
{%if c.stock %}
<a href="{{ url('stock:main', stock_id=c.stock.id) }}">Stock</a> -
{% else %}
<a href="{{ url('stock:new', counter_id=c.id) }}">{% trans %}Create new stock{% endtrans%}</a> -
{% endif %}
{% endif %}
{% if user.is_owner(c) %}
<a href="{{ url('counter:prop_admin', counter_id=c.id) }}">{% trans %}Props{% endtrans %}</a> -
{%if c.stock %}
<a href="{{ url('stock:main', stock_id=c.stock.id) }}">{{c.stock}}</a>
{% else %}
<a href="{{ url('stock:new', counter_id=c.id) }}">{% trans %}Create new stock{% endtrans%}</a>
{% endif %}
<a href="{{ url('counter:prop_admin', counter_id=c.id) }}">{% trans %}Props{% endtrans %}</a>
{% endif %}
</li>
{% endfor %}

View File

@ -443,6 +443,11 @@ class CounterLogout(RedirectView):
class CounterAdminTabsMixin(TabedViewMixin):
tabs_title = _("Counter administration")
list_of_tabs = [
{
'url': reverse_lazy('stock:list'),
'slug': 'stocks',
'name': _("Stocks"),
},
{
'url': reverse_lazy('counter:admin_list'),
'slug': 'counters',