Sith/counter/templates/counter/counter_list.jinja

69 lines
2.5 KiB
Django/Jinja

{% extends "core/base.jinja" %}
{% block title %}
{% trans %}Counter admin list{% endtrans %}
{% endblock %}
{% block content %}
<p><a href="{{ url('counter:new') }}">{% trans %}New counter{% endtrans %}</a></p>
{% if counter_list %}
<h3>{% trans %}Counter admin list{% endtrans %}</h3>
<h4>{% trans %}Eboutic{% endtrans %}</h4>
<ul>
{% for c in counter_list.filter(type="EBOUTIC").order_by('name') %}
<li>
<a href="{{ url('eboutic:main') }}">{{ c }}</a> -
{% 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> -
{% endif %}
{% if user.is_owner(c) %}
<a href="{{ url('counter:prop_admin', counter_id=c.id) }}">{% trans %}Props{% endtrans %}</a>
{% endif %}
</li>
{% endfor %}
</ul>
<h4>{% trans %}Bars{% endtrans %}</h4>
<ul>
{% for c in counter_list.filter(type="BAR").order_by('name') %}
<li>
<a href="{{ url('counter:details', counter_id=c.id) }}">{{ c }}</a> -
{% 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> -
{% endif %}
{% if c.stock %}
<a href="{{ url('stock:items_list', stock_id=c.stock.id)}}">Stock</a> -
<a href="{{ url('stock:shoppinglist_list', stock_id=c.stock.id)}}">{% trans %}Shopping lists{% endtrans %}</a> -
{% else %}
<a href="{{url('stock:new', counter_id=c.id)}}">{% trans %}Create new stock{% endtrans%}</a> -
{% endif %}
{% if user.is_owner(c) %}
<a href="{{ url('counter:prop_admin', counter_id=c.id) }}">{% trans %}Props{% endtrans %}</a>
{% endif %}
</li>
{% endfor %}
</ul>
<h4>{% trans %}Offices{% endtrans %}</h4>
<ul>
{% for c in counter_list.exclude(type="BAR").exclude(type="EBOUTIC").order_by('name') %}
<li>
<a href="{{ url('counter:details', counter_id=c.id) }}">{{ c }}</a> -
{% 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> -
{% endif %}
{% if user.is_owner(c) %}
<a href="{{ url('counter:prop_admin', counter_id=c.id) }}">{% trans %}Props{% endtrans %}</a>
{% endif %}
</li>
{% endfor %}
</ul>
{% else %}
{% trans %}There is no counters in this website.{% endtrans %}
{% endif %}
{% endblock %}