topic.jinja 2.16 KB
Newer Older
Skia's avatar
Skia committed
1
{% extends "core/base.jinja" %}
Skia's avatar
Skia committed
2
{% from 'core/macros.jinja' import user_profile_link %}
3
{% from 'forum/macros.jinja' import display_message, display_breadcrumb, display_search_bar %}
Skia's avatar
Skia committed
4

Skia's avatar
Skia committed
5 6 7 8
{% block title %}
{{ topic }}
{% endblock %}

Skia's avatar
Skia committed
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
{% 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 %}
29 30
{{ display_breadcrumb(topic.forum, topic) }}
<h3>{{ topic.title }}</h3>
Skia's avatar
Skia committed
31
<div id="forum">
Skia's avatar
Skia committed
32
    <p>{{ topic.description }}</p>
Skia's avatar
Skia committed
33 34 35 36 37 38 39 40
    <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>
41

42
    {{ display_search_bar(request) }}
Skia's avatar
Skia committed
43
    <p style="text-align: right; background: #d8e7f3;">
44 45
    {% 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>
Skia's avatar
Skia committed
46 47 48 49
    {% endfor %}
    </p>

    {% for m in msgs %}
50 51 52
        {% if m.id == first_unread_message_id %}
        <span id="first_unread"></span>
        {% endif %}
Skia's avatar
Skia committed
53 54 55 56 57
        {% if m.id >= first_unread_message_id %}
        {{ display_message(m, user, True) }}
        {% else %}
        {{ display_message(m, user, False) }}
        {% endif %}
Skia's avatar
Skia committed
58
    {% endfor %}
Skia's avatar
Skia committed
59

Skia's avatar
Skia committed
60
    <p><a class="ib button" href="{{ url('forum:new_message', topic_id=topic.id) }}">{% trans %}Reply{% endtrans %}</a></p>
Skia's avatar
Skia committed
61 62

    <p style="text-align: right; background: #d8e7f3;">
63 64
    {% 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>
Skia's avatar
Skia committed
65 66
    {% endfor %}
    </p>
Skia's avatar
Skia committed
67
</div>
Skia's avatar
Skia committed
68 69 70 71
{% endblock %}