Sith/forum/templates/forum/topic.jinja

72 lines
2.2 KiB
Django/Jinja
Raw Normal View History

2017-01-21 02:42:06 +00:00
{% extends "core/base.jinja" %}
2017-01-21 03:19:15 +00:00
{% from 'core/macros.jinja' import user_profile_link %}
{% from 'forum/macros.jinja' import display_message, display_breadcrumb, display_search_bar %}
2017-01-21 02:42:06 +00:00
2017-01-28 23:16:41 +00:00
{% block title %}
{{ topic }}
{% endblock %}
2017-01-21 02:42:06 +00:00
{% block head %}
{{ super() }}
<style type="text/css" media="all">
.topic {
border: solid skyblue 1px;
padding: 2px;
margin: 2px;
}
.forum {
background: lightblue;
padding: 2px;
margin: 2px;
}
.category {
background: skyblue;
}
</style>
{% endblock %}
{% block content %}
{{ display_breadcrumb(topic.forum, topic) }}
<h3>{{ topic.title }}</h3>
2017-05-20 10:40:30 +00:00
<div id="forum">
2017-01-21 02:42:06 +00:00
<p>{{ topic.description }}</p>
<p>
<a class="ib button" href="{{ url('forum:new_message', topic_id=topic.id) }}">{% trans %}Reply{% endtrans %}</a>
{% if user in topic.subscribed_users.all() %}
<a class="ib button" href="{{ url('forum:toggle_subscribe_topic', topic_id=topic.id) }}">{% trans %}Unmark as favorite{% endtrans %}</a>
{% else %}
<a class="ib button" href="{{ url('forum:toggle_subscribe_topic', topic_id=topic.id) }}">{% trans %}Mark as favorite{% endtrans %}</a>
{% endif %}
</p>
{{ display_search_bar(request) }}
2017-03-12 19:24:16 +00:00
<p style="text-align: right; background: #d8e7f3;">
{% for p in msgs.paginator.page_range %}
<span class="ib" style="background: {% if p == msgs.number %}white{% endif %}; margin: 0;"><a href="?page={{ p }}">{{ p }}</a></span>
2017-03-12 19:24:16 +00:00
{% endfor %}
</p>
{% for m in msgs %}
{% if m.id == first_unread_message_id %}
<span id="first_unread"></span>
{% endif %}
2017-02-24 16:22:13 +00:00
{% if m.id >= first_unread_message_id %}
{{ display_message(m, user, True) }}
{% else %}
{{ display_message(m, user, False) }}
{% endif %}
2017-01-21 02:42:06 +00:00
{% endfor %}
2017-02-24 16:22:13 +00:00
<p><a class="ib button" href="{{ url('forum:new_message', topic_id=topic.id) }}">{% trans %}Reply{% endtrans %}</a></p>
2017-03-12 19:24:16 +00:00
<p style="text-align: right; background: #d8e7f3;">
{% for p in msgs.paginator.page_range %}
<span class="ib" style="background: {% if p == msgs.number %}white{% endif %}; margin: 0;"><a href="?page={{ p }}">{{ p }}</a></span>
2017-03-12 19:24:16 +00:00
{% endfor %}
</p>
2017-05-20 10:40:30 +00:00
</div>
2017-01-21 02:42:06 +00:00
{% endblock %}