Sith/forum/templates/forum/macros.jinja

39 lines
1.2 KiB
Plaintext
Raw Normal View History

{% macro display_forum(forum, user) %}
2017-01-21 02:42:06 +00:00
<div class="forum {% if forum.is_category %}category{% endif %}">
2017-01-21 21:47:30 +00:00
<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 %}
{% if user.is_owner(forum) %}
2017-01-21 21:47:30 +00:00
<a class="ib" href="{{ url('forum:edit_forum', forum_id=forum.id) }}">Edit</a>
<a class="ib" href="{{ url('forum:delete_forum', forum_id=forum.id) }}">Delete</a>
{% endif %}
2017-01-21 11:28:32 +00:00
</div>
{% if not forum.is_category %}
2017-01-21 21:47:30 +00:00
<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>
2017-01-21 11:28:32 +00:00
{% endif %}
2017-01-21 02:42:06 +00:00
</div>
{% endmacro %}