club_list.jinja 911 Bytes
Newer Older
1
2
3
{% extends "core/base.jinja" %}

{% block title %}
Skia's avatar
Skia committed
4
{% trans %}Club list{% endtrans %}
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{% endblock %}

{% macro display_club(club) -%}
    <li><a href="{{ url('club:club_view', club_id=club.id) }}">{{ club.name }}</a>
        {%- if club.children.all()|length != 0 %}
        <ul>
            {%- for c in club.children.all() %}
                {{ display_club(c) }}
            {%- endfor %}
        </ul>
        {%- endif -%}
    </li>
{%- endmacro %}

{% block content %}
Skia's avatar
Skia committed
20
    {% if user.is_root %}
Skia's avatar
Skia committed
21
    <p><a href="{{ url('club:club_new') }}">{% trans %}New club{% endtrans %}</a></p>
Skia's avatar
Skia committed
22
    {% endif %}
23
    {% if club_list %}
Skia's avatar
Skia committed
24
25
26
27
28
29
    <h3>{% trans %}Club list{% endtrans %}</h3>
    <ul>
        {%- for c in club_list if c.parent is none %}
        {{ display_club(c) }}
        {%- endfor %}
    </ul>
30
    {% else %}
Skia's avatar
Skia committed
31
    {% trans %}There is no club in this website.{% endtrans %}
32
33
34
35
36
    {% endif %}
{% endblock %}