user_tools.jinja 2.4 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 26
    {% 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>
    {% endif %}
Skia's avatar
Skia committed
27
    {% for b in settings.SITH_COUNTER_BARS %}
28
    {% if user.is_in_group(b[1]+" admin") %}
Skia's avatar
Skia committed
29 30
    <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>
31
    {% endif %}
Skia's avatar
Skia committed
32
    {% endfor %}
33 34
</ul>

Skia's avatar
Skia committed
35 36 37
<hr>
<h4>{% trans %}Accounting{% endtrans %}</h4>
<ul>
Skia's avatar
Skia committed
38 39 40
    {% 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
41 42 43 44 45 46 47 48 49 50 51 52 53 54
    {% 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
55 56 57 58 59
<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
60 61 62 63 64

{% endblock %}