user_tools.jinja 2.55 KB
Newer Older
1
{% extends "core/base.jinja" %}
Skia's avatar
Skia committed
2
3

{% block title %}
Skia's avatar
Skia committed
4
{% trans user_name=user.get_display_name() %}{{ user_name }}'s tools{% endtrans %}
Skia's avatar
Skia committed
5
6
{% endblock %}

7
{% block content %}
Skia's avatar
Skia committed
8
<h3>{% trans %}User Tools{% endtrans %}</h3>
Skia's avatar
Skia committed
9

Skia's avatar
Skia committed
10
<hr>
Skia's avatar
Skia committed
11
<h4>{% trans %}Sith management{% endtrans %}</h4>
Skia's avatar
Skia committed
12
<ul>
Skia's avatar
Skia committed
13
    {% if user.is_root %}
Skia's avatar
Skia committed
14
15
    <li><a href="{{ url('core:group_list') }}">{% trans %}Groups{% endtrans %}</a></li>
    {% endif %}
Skia's avatar
Skia committed
16
    {% if user.is_in_group(settings.SITH_MAIN_BOARD_GROUP) or user.is_root %}
Skia's avatar
Skia committed
17
18
    <li><a href="{{ url('subscription:subscription') }}">{% trans %}Subscriptions{% endtrans %}</a></li>
    {% endif %}
Skia's avatar
Skia committed
19
</ul>
20

Skia's avatar
Skia committed
21
<hr>
Skia's avatar
Skia committed
22
<h4>{% trans %}Counters{% endtrans %}</h4>
23
<ul>
Skia's avatar
Skia committed
24
    {% if user.is_in_group(settings.SITH_GROUPS['counter-admin']['name']) or user.is_root %}
25
    <h5>{% trans %}General management{% endtrans %}</h5>
Skia's avatar
Skia committed
26
    <li><a href="{{ url('counter:admin_list') }}">{% trans %}General counters management{% endtrans %}</a></li>
Skia's avatar
Skia committed
27
    <li><a href="{{ url('counter:product_list') }}">{% trans %}Products management{% endtrans %}</a></li>
Skia's avatar
Skia committed
28
    <li><a href="{{ url('counter:producttype_list') }}">{% trans %}Product types management{% endtrans %}</a></li>
Skia's avatar
Skia committed
29
    {% endif %}
Skia's avatar
Skia committed
30
    {% for b in settings.SITH_COUNTER_BARS %}
31
    {% if user.is_in_group(b[1]+" admin") %}
Skia's avatar
Skia committed
32
33
    <li><a href="{{ url('counter:details', counter_id=b[0]) }}">{{ b[1] }}</a> -
        <a href="{{ url('counter:admin', counter_id=b[0]) }}">{% trans %}Edit{% endtrans %}</a></li>
34
    {% endif %}
Skia's avatar
Skia committed
35
    {% endfor %}
36
37
</ul>

Skia's avatar
Skia committed
38
39
40
<hr>
<h4>{% trans %}Accounting{% endtrans %}</h4>
<ul>
Skia's avatar
Skia committed
41
    {% if user.is_in_group(settings.SITH_GROUPS['accounting-admin']['name']) or user.is_root %}
Skia's avatar
Skia committed
42
43
    <li><a href="{{ url('accounting:bank_list') }}">{% trans %}General accounting{% endtrans %}</a></li>
    {% endif %}
Skia's avatar
Skia committed
44
45
    {% for m in user.membership.filter(end_date=None).filter(role__gte=7).all() -%}
    {%- for b in m.club.bank_accounts.all() %}
Skia's avatar
Skia committed
46
    <li><strong>{% trans %}Bank account: {% endtrans %}</strong>
Skia's avatar
Skia committed
47
48
49
50
51
52
53
54
        <a href="{{ url('accounting:bank_details', b_account_id=b.id) }}">{{ b }}</a></li>
    {%- endfor %}
    {% if m.club.club_account.exists() -%}
        {% for ca in m.club.club_account.all() %}
        <li><strong>{% trans %}Club account: {% endtrans %}</strong> <a href="{{ url('accounting:club_details', c_account_id=ca.id) }}">{{ ca }}</a></li>
        {%- endfor %}
    {%- endif -%}
    {%- endfor %}
Skia's avatar
Skia committed
55
56
57
58
</ul>

<hr>
<h4>{% trans %}Club tools{% endtrans %}</h4>
Skia's avatar
Skia committed
59
60
61
62
63
<ul>
    {% for m in user.membership.filter(end_date=None).all() %}
    <li><a href="{{ url('club:tools', club_id=m.club.id) }}">{{ m.club }}</a></li>
    {% endfor %}
</ul>
Skia's avatar
Skia committed
64
65
66
67
68

{% endblock %}