macros.jinja 1.08 KB
Newer Older
Skia's avatar
Skia committed
1 2
{% macro display_forum(forum) %}
<div class="forum {% if forum.is_category %}category{% endif %}">
Skia's avatar
Skia committed
3 4 5 6 7 8 9 10 11 12 13 14 15 16
    <div class="ib w_big">
        {% if not forum.is_category %}
        <a class="ib w_big" href="{{ url('forum:view_forum', forum_id=forum.id) }}">
        {% else %}
        <div class="ib w_big">
        {% endif %}
            <h5>{{ forum.name }}</h5>
            <p>{{ forum.description }}</p>
        {% if not forum.is_category %}
        </a>
        {% else %}
        </div>
        {% endif %}
        <a class="ib" href="{{ url('forum:edit_forum', forum_id=forum.id) }}">Edit</a>
Skia's avatar
Skia committed
17 18
    </div>
    {% if not forum.is_category %}
Skia's avatar
Skia committed
19 20 21 22 23 24 25 26 27 28 29 30
    <div class="ib w_small">
        <div class="ib w_medium">
            {{ forum.get_topic_number() }}
        </div>
        <div class="ib w_medium">
            {% set last_msg = forum.get_last_message() %}
            {% if last_msg %}
            {{ last_msg.author }} <br/>
            {{ last_msg.date|date(DATETIME_FORMAT) }} {{ last_msg.date|time(DATETIME_FORMAT) }}
            {% endif %}
        </div>
    </div>
Skia's avatar
Skia committed
31
    {% endif %}
Skia's avatar
Skia committed
32 33 34 35
</div>
{% endmacro %}