forum.jinja 2.43 KB
Newer Older
Skia's avatar
Skia committed
1
{% extends "core/base.jinja" %}
Skia's avatar
Skia committed
2 3 4 5 6
{% from 'forum/macros.jinja' import display_forum, display_topic %}

{% block title %}
{{ forum }}
{% endblock %}
Skia's avatar
Skia committed
7 8

{% block content %}
Skia's avatar
Skia committed
9
<div>
10
    <a href="{{ url('forum:main') }}">{% trans %}Forum{% endtrans %}</a>
Skia's avatar
Skia committed
11
    {% for f in forum.get_parent_list()|reverse %}
Skia's avatar
Skia committed
12 13 14
    > <a href="{{ f.get_absolute_url() }}">{{ f }}</a>
    {% endfor %}
    > <a href="{{ forum.get_absolute_url() }}">{{ forum }}</a>
Skia's avatar
Skia committed
15 16
</div>
<div id="forum">
Skia's avatar
Skia committed
17
    <h3>{{ forum.name }}</h3>
18
    <p>
Sli's avatar
Sli committed
19
    {% if user.is_in_group(settings.SITH_GROUP_FORUM_ADMIN_ID) or user.is_in_group(settings.SITH_GROUP_COM_ADMIN_ID) or user.can_edit(forum) %}
Skia's avatar
Skia committed
20
        <a class="ib button" href="{{ url('forum:new_forum') }}?parent={{ forum.id }}">{% trans %}New forum{% endtrans %}</a> <br/>
21
    {% endif %}
Krophil's avatar
Krophil committed
22
    {% if not forum.is_category %}
Skia's avatar
Skia committed
23
        <a class="ib button" href="{{ url('forum:new_topic', forum_id=forum.id) }}">{% trans %}New topic{% endtrans %}</a>
Krophil's avatar
Krophil committed
24
    {% endif %}
25
    </p>
26 27 28
    {% if forum.children.exists() %}
    <div>
        <div class="ib w_big">
Skia's avatar
Skia committed
29
            {% trans %}Title{% endtrans %}
30 31 32
        </div>
        <div class="ib w_small">
            <div class="ib w_medium">
Skia's avatar
Skia committed
33
                {% trans %}Topics{% endtrans %}
34 35
            </div>
            <div class="ib w_small">
Skia's avatar
Skia committed
36
                {% trans %}Last message{% endtrans %}
37 38 39
            </div>
        </div>
    </div>
Skia's avatar
Skia committed
40
    {{ display_forum(forum, user, True) }}
41
    {% for f in forum.children.all().select_related("_last_message__author", "_last_message__topic") %}
42
    {{ display_forum(f, user) }}
Skia's avatar
Skia committed
43
    {% endfor %}
44 45 46 47
    {% endif %}
    {% if topics %}
    <div>
        <div class="ib w_medium">
Skia's avatar
Skia committed
48
            {% trans %}Title{% endtrans %}
49 50 51
        </div>
        <div class="ib w_medium">
            <div class="ib w_small">
Skia's avatar
Skia committed
52
                {% trans %}Author{% endtrans %}
53 54
            </div>
            <div class="ib w_medium">
Skia's avatar
Skia committed
55
                {% trans %}Messages{% endtrans %}
56 57
            </div>
            <div class="ib w_small">
Skia's avatar
Skia committed
58
                {% trans %}Last message{% endtrans %}
59 60 61
            </div>
        </div>
    </div>
Skia's avatar
Skia committed
62
    {% for t in topics %}
Skia's avatar
Skia committed
63
    {{ display_topic(t, user) }}
Skia's avatar
Skia committed
64
    {% endfor %}
Skia's avatar
Skia committed
65 66 67 68 69
    <p style="text-align: right; background: #d8e7f3;">
    {% for p in topics.paginator.page_range %}
        <span class="ib" style="background: {% if p == topics.number %}white{% endif %}; margin: 0;"><a href="?topic_page={{ p }}">{{ p }}</a></span>
    {% endfor %}
    </p>
70
    {% endif %}
Skia's avatar
Skia committed
71
</div>
Skia's avatar
Skia committed
72 73 74 75
{% endblock %}