-
Notifications
You must be signed in to change notification settings - Fork 151
/
topic.html
99 lines (85 loc) · 3.61 KB
/
topic.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
{% extends 'pybb/base.html' %}
{% load url from future %}
{% load pybb_tags i18n %}
{% block title %}{{ topic }}{% endblock %}
{% block extra_script %}
{{ block.super }}
{% include "pybb/_markitup.html" %}
<script type="text/javascript" src="{{ STATIC_URL }}pybb/js/jquery.formset.min.js"></script>
{% endblock %}
{% block breadcrumb %}
{% with object=topic %}
{% include "pybb/breadcrumb.html" %}
{% endwith %}
{% endblock %}
{% block content %}
<div class="topic">
<h1>{{ topic.name }}</h1>
{% with _('Posts') as label %}
{% include "pybb/pagination.html" %}
{% endwith %}
{% if topic.poll_type %}
{% include 'pybb/poll.html' %}
{% endif %}
<div class="posts">
{% if first_post %}{% ifnotequal first_post post_list.0 %}
{% with first_post as post %}
<li class="first_post">{% include "pybb/post_template.html" %}</li>
{% endwith %}
{% endifnotequal %}{% endif %}
{% for post in post_list %}
{% cycle 'odd' 'even' as rowcolors silent %}
{% include "pybb/post_template.html" %}
{% endfor %}
</div>
<div> </div>
{% with _('Posts') as label %}
{% include "pybb/pagination.html" %}
{% endwith %}
{% if user.is_authenticated %}
<div class="controls">
{% if user.is_moderator %}
{% if topic.sticky %}
<a href="{% url 'pybb:unstick_topic' topic.id %}">{% trans "Unstick topic" %}</a> /
{% else %}
<a href="{% url 'pybb:stick_topic' topic.id %}">{% trans "Stick topic" %}</a> /
{% endif %}
{% if topic.closed %}
<a href="{% url 'pybb:open_topic' topic.id %}">{% trans "Open topic" %}</a> /
{% else %}
<a href="{% url 'pybb:close_topic' topic.id %}">{% trans "Close topic" %}</a> /
{% endif %}
{% if perms.pybb.change_topic and user.is_staff %}
<a href="{% url 'admin:pybb_topic_change' topic.id %}">{% trans 'Admin' %}</a> /
{% endif %}
{% comment %}
<a href="{% url 'pybb:merge_topics' %}?topic={{ topic.id }}">{% trans 'Merge topics' %}</a> /
{% endcomment %}
{% endif %}
{% if user.is_subscribed %}
<a href="{% url 'pybb:delete_subscription' topic.id %}?from_topic">{% trans "Unsubscribe" %}</a>
{% else %}
<a href="{% url 'pybb:add_subscription' topic.id %}">{% trans "Subscribe" %}</a>
{% endif %}
</div>
{% endif %}
{% if user.is_authenticated or PYBB_ENABLE_ANONYMOUS_POST %}
{% pybb_get_profile user=user as user_profile %}
{% if not user_profile.is_banned %}
{% if not topic.closed %}
{% include "pybb/post_form.html" %}
{% endif %}
{% endif %}
{% else %}
{% include 'pybb/_need_to_login_message.html' %}
{% endif %}
{% if user.is_staff %}
<div class="subscriber-list">
{% trans "Subscribers" %}:
{% for subscriber in topic.subscribers.all %}
<a href="{% url 'pybb:user' subscriber.username %}">{{ subscriber.username }}</a>,
{% endfor %}
</div>
{% endif %}
</div>
{% endblock %}