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

{% 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
7
{% endblock %}

{% 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
14
15
16
17
18
    {% if user.is_in_group(settings.SITH_GROUPS['root']['name']) %}
    <li><a href="{{ url('core:group_list') }}">{% trans %}Groups{% endtrans %}</a></li>
    {% endif %}
    {% if user.is_in_group(settings.SITH_MAIN_BOARD_GROUP) or user.is_in_group(settings.SITH_GROUPS['root']['name']) %}
    <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
25
    {% if user.is_in_group(settings.SITH_GROUPS['counter-admin']['name']) or user.is_in_group(settings.SITH_GROUPS['root']['name']) %}
    <li><a href="{{ url('counter:admin_list') }}">{% trans %}General counters management{% endtrans %}</a></li>
Skia's avatar
Skia committed
26
    <li><a href="{{ url('counter:product_list') }}">{% trans %}General products management{% endtrans %}</a></li>
Skia's avatar
Skia committed
27
    {% endif %}
Skia's avatar
Skia committed
28
    {% for b in settings.SITH_COUNTER_BARS %}
29
    {% if user.is_in_group(b[1]+" admin") %}
Skia's avatar
Skia committed
30
31
    <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>
32
    {% endif %}
Skia's avatar
Skia committed
33
    {% endfor %}
34
35
</ul>

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

<hr>
<h4>{% trans %}Club tools{% endtrans %}</h4>
Skia's avatar
Skia committed
56
57
58
59
60
<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
61
62
63
64
65

{% endblock %}