~widelands-dev/widelands-website/trunk

« back to all changes in this revision

Viewing changes to templates/pybb/topic.html

  • Committer: franku
  • Date: 2016-05-15 14:41:54 UTC
  • mto: This revision was merged to the branch mainline in revision 409.
  • Revision ID: somal@arcor.de-20160515144154-00m3tiibyxm0nw2w
added the old threadedcomments app as wildelands app

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
{% extends 'pybb/base.html' %}
2
2
{% load pybb_extras %}
3
3
{% load i18n %}
 
4
{% load humanize %}
 
5
{% load wiki_extras %}
 
6
{% load wlprofile_extras %}
 
7
{% load custom_date %}
4
8
 
5
9
{% block title %}
6
10
{{ topic.name }} - {{ topic.forum.name }} - {{ block.super }}
7
11
{% endblock title %}
8
12
 
9
13
{% block extra_head %}
10
 
<link rel="alternate" type="application/atom+xml" title="Latest Posts on forum '{{ topic.forum.name }}'" href="{% url pybb_feed "posts" %}{{topic.forum.id}}/"  />
11
 
<link rel="alternate" type="application/atom+xml" title="Latest Topics on forum '{{ topic.forum.name }}'" href="{% url pybb_feed "topics"%}{{topic.forum.id}}/" />
 
14
<link rel="alternate" type="application/atom+xml" title="Latest Posts on forum '{{ topic.forum.name }}'" href="{% url 'pybb_feed_posts' %}{{topic.forum.id}}/"  />
 
15
<link rel="alternate" type="application/atom+xml" title="Latest Topics on forum '{{ topic.forum.name }}'" href="{% url 'pybb_feed_topics' %}{{topic.forum.id}}/" />
12
16
{{ block.super }}
13
17
{% endblock %}
14
18
 
15
19
{% block content %}
16
 
{% include "django_messages/inlines/navigation.html" %}
17
 
<br />
18
 
<br />
19
 
<div class="box_item_model">
20
 
    <span class="title"><a href="/forum/">Forum</a> &rArr; <a href="{{ topic.forum.get_absolute_url }}">{{ topic.forum.name }}</a> &rArr; {{ topic }}</span>
21
 
    <br />
22
 
    {% pybb_pagination _('Posts') %}
23
 
    <div class="posts" style="clear:left">
24
 
        <a name="top" id="top"></a>
25
 
        <table cellspacing="1" width="100%">
26
 
            <tr align="center">
27
 
                <th>Author</th>
28
 
                <th width="85%" nowrap="nowrap">Message</th>
29
 
            </tr>
30
 
        </table>
31
 
 
32
 
    {% if first_post %}
33
 
        {% ifnotequal first_post posts.0 %}
34
 
            {% with first_post as post %}
35
 
        <div class="post first_post">
36
 
                {% include "pybb/inlines/post.html" %}
37
 
        </div>
38
 
            {% endwith %}
39
 
        {% endifnotequal %}
40
 
    {% endif %}
41
 
    {% for post in posts %}
42
 
        <div class="post">
43
 
        {% include "pybb/inlines/post.html" %}
44
 
        </div>
45
 
    {% endfor %}
46
 
    </div>
47
 
    {% pybb_pagination _('Posts') %}
48
 
    <br />
49
 
    <div class="controls">
50
 
        <br />
51
 
    {% if moderator %}
52
 
        {% if topic.sticky %}
53
 
    <a href="{% url pybb_unstick_topic topic.id %}">
54
 
        <img src="{{MEDIA_URL}}/forum/img/en/unstick_topic.png" height="25" alr="{% trans "Unstick topic" %}" />
55
 
    </a>
56
 
        {% else %}
57
 
    <a href="{% url pybb_stick_topic topic.id %}">
58
 
        <img src="{{MEDIA_URL}}/forum/img/en/stick_topic.png" height="25" alt ="{% trans "Stick Topic" %}" />
59
 
    </a>
60
 
        {% endif %}
61
 
        {% if topic.closed %}
62
 
    <a href="{% url pybb_open_topic topic.id %}">
63
 
        <img src="{{MEDIA_URL}}/forum/img/en/open_topic.png" height="25" alt="{% trans "Open topic" %}" />
64
 
    </a>
65
 
        {% else %}
66
 
    <a href="{% url pybb_close_topic topic.id %}">
67
 
        <img src="{{MEDIA_URL}}/forum/img/en/close_topic.png" height="25" alt ="{% trans "Close Topic" %}" />
68
 
    </a>
69
 
        {% endif %}
70
 
    {% endif %}
71
 
 
72
 
 
73
 
    {% if user.is_authenticated %}
74
 
        {% if subscribed %}
75
 
    <a href="{% url pybb_delete_subscription topic.id %}?from_topic">
76
 
        <img src="{{MEDIA_URL}}/forum/img/en/unsubscribe.png" height="25" alt ="{% trans "Unsubscribe" %}" />
77
 
    </a>
78
 
        {% else %}
79
 
    <a href="{% url pybb_add_subscription topic.id %}">
80
 
        <img src="{{MEDIA_URL}}/forum/img/en/subscribe.png" height="25" alt="{% trans "Subscribe" %}" /></a>
81
 
        {% endif %}
82
 
    {% endif %}
83
 
 
84
 
    </div>
 
20
<h1>Topic: {{ topic }}</h1>
 
21
<div class="blogEntry">
 
22
        <a href="{% url 'pybb_index' %}">Forums</a> &#187; 
 
23
        {% pybb_link topic.forum.category %} &#187; 
 
24
        <a href="{{ topic.forum.get_absolute_url }}">{{ topic.forum.name }}</a> &#187;
 
25
        {{ topic }}
 
26
        <br /><br />
 
27
        <div class="posRight">
 
28
        {% if moderator %}
 
29
                {% if topic.sticky %}
 
30
                <a class="button" href="{% url 'pybb_unstick_topic' topic.id %}">
 
31
                        <img src="{{ MEDIA_URL }}forum/img/unstick.png" alt ="" class="middle" />
 
32
                        <span class="middle">{% trans "Unstick Topic" %}</span>
 
33
                </a>
 
34
                {% else %}
 
35
                <a class="button" href="{% url 'pybb_stick_topic' topic.id %}">
 
36
                        <img src="{{ MEDIA_URL }}forum/img/sticky.png" alt ="" class="middle" />
 
37
                        <span class="middle">{% trans "Stick Topic" %}</span>
 
38
                </a>
 
39
                {% endif %}
 
40
                {% if topic.closed %}
 
41
                <a class="button" href="{% url 'pybb_open_topic' topic.id %}">
 
42
                        <img src="{{ MEDIA_URL }}forum/img/open.png" alt ="" class="middle" />
 
43
                        <span class="middle">{% trans "Open Topic" %}</span>
 
44
                </a>
 
45
                {% else %}
 
46
                <a class="button" href="{% url 'pybb_close_topic' topic.id %}">
 
47
                        <img src="{{ MEDIA_URL }}forum/img/closed.png" alt ="" class="middle" />
 
48
                        <span class="middle">{% trans "Close Topic" %}</span>
 
49
                </a>
 
50
                {% endif %}
 
51
        {% endif %}
 
52
        {% if user.is_authenticated %}
 
53
                {% if subscribed %}
 
54
                <a class="button" href="{% url 'pybb_delete_subscription' topic.id %}?from_topic">
 
55
                        <img src="{{ MEDIA_URL }}forum/img/unsubscribe.png" alt ="" class="middle" />
 
56
                        <span class="middle">{% trans "Unsubscribe" %}</span>
 
57
                </a>
 
58
                {% else %}
 
59
                <a class="button" href="{% url 'pybb_add_subscription' topic.id %}">
 
60
                        <img src="{{ MEDIA_URL }}forum/img/subscribe.png" alt ="" class="middle" />
 
61
                        <span class="middle">{% trans "Subscribe" %}</span>
 
62
                </a>
 
63
                {% endif %}
 
64
                <a class="button" href="{% url 'pybb_add_post' topic.id %}">
 
65
                        <img src="{{ MEDIA_URL }}forum/img/send.png" alt ="" class="middle" />
 
66
                        <span class="middle">{% trans "New Reply" %}</span>
 
67
                </a>
 
68
        {% endif %}
 
69
        </div>
 
70
        {% pybb_pagination _('Posts') %}
 
71
        <br /><br />
 
72
 
 
73
{% if first_post %}
 
74
        {% ifnotequal first_post posts.0 %}
 
75
                {% with first_post as post %}
 
76
        {% trans "First Post" %}:
 
77
        <table class="forum">
 
78
                <tbody>
 
79
                <tr class="odd">
 
80
                        <td class="author">
 
81
                                {{ post.user|user_link }}<br />
 
82
                                {% if post.user.wlprofile_extras.avatar %}
 
83
                                <a href="{% url 'profile_view' post.user %}">
 
84
                                        <img src="{{ post.user.wlprofile.avatar.url }}" alt="Avatar" />
 
85
                                </a>
 
86
                                {% endif %}
 
87
                                <div class="authorStats">
 
88
                                <strong>Joined:</strong> {{ post.user.date_joined|custom_date:user|title }}<br />
 
89
                                <strong>Posts:</strong> {{ post.user.wlprofile.post_count }}<br />
 
90
                                <img src="{{ MEDIA_URL }}img/{{ post.user.wlprofile.user_status.image }}" alt="Ranking" /><br />
 
91
                                <strong>{{ post.user.wlprofile.user_status.text }}</strong><br />
 
92
                                {% if post.user.wlprofile.location %}
 
93
                                <strong>Location:</strong> {{ post.user.wlprofile.location }}<br />
 
94
                                {% endif %}
 
95
                                {% if post.user.wlprofile.get_ggzstats and post.user.wlprofile.get_ggzstats.ranking %} 
 
96
                                <strong>GGZ ranking:</strong> {{ post.user.wlprofile.get_ggzstats.ranking|floatformat }}<br />
 
97
                                <strong>GGZ rating:</strong> {{ post.user.wlprofile.get_ggzstats.rating|floatformat }}<br />
 
98
                                <strong>GGZ win:</strong> {{ post.user.wlprofile.get_ggzstats.wins|floatformat }}<br />
 
99
                                <strong>GGZ loses:</strong> {{ post.user.wlprofile.get_ggzstats.losses|floatformat }}<br />
 
100
                                {% endif %}
 
101
                                </div>
 
102
                        </td>
 
103
                        <td class="post">
 
104
                                <a id="post-{{ post.id }}" href="{{post.get_absolute_url}}" title="{% trans "Permalink" %}" class="posRight small permalink">&nbsp;</a>
 
105
                                <span class="small">Posted at: {{ post.created|custom_date:user}}</span>
 
106
                                <hr />
 
107
                                <div class="post">
 
108
                                        {{ post.body_html|safe }}
 
109
                                </div>
 
110
 
 
111
                                {% if post.attachment_cache %}
 
112
                                        {% for attach in post.attachment_cache %}
 
113
                                                {% trans "Attachment" %}: <a href="{{ attach.get_absolute_url }}">{{ attach.name }}</a> ({{ attach.size_display }})
 
114
                                        {% endfor %}
 
115
                                {% endif %}
 
116
 
 
117
                                {% if post.updated %}
 
118
                                        <span class="small">{% trans "Edited" %}: {{ post.updated|custom_date:user|title}}</span>
 
119
                                {% endif %}
 
120
                                <hr />
 
121
                                {% if user.is_authenticated %}
 
122
                                        {% ifequal user.wlprofile.show_signatures 1 %}
 
123
                                                {% if post.user.wlprofile.signature %}
 
124
                                                        {{ post.user.wlprofile.signature|urlize|linebreaks }}
 
125
                                                {% endif %}
 
126
                                        {% endifequal %}
 
127
                                {% else %}
 
128
                                        {% if post.user.wlprofile.signature %}
 
129
                                                {{ post.user.wlprofile.signature|urlize|linebreaks }}
 
130
                                        {% endif %}
 
131
                                {% endif %}
 
132
 
 
133
                                <button onclick="window.location.href='#top';" class="posRight">
 
134
                                        <img src="{{ MEDIA_URL }}forum/img/top.png" alt ="" class="middle" />
 
135
                                        <span class="middle">{% trans "Top" %}</span>
 
136
                                </button>
 
137
 
 
138
                                <button onclick="window.location.href='{% url 'pybb_add_post' topic.id %}?quote_id={{ post.id }}';">
 
139
                                        <img src="{{ MEDIA_URL }}forum/img/quote.png" alt ="" class="middle" />
 
140
                                        <span class="middle">{% trans "Quote" %}</span>
 
141
                                </button>
 
142
                                {% if moderator or post|pybb_posted_by:user %}
 
143
                                        <button onclick="window.location.href='{% url 'pybb_edit_post' post.id %}';">
 
144
                                                <img src="{{ MEDIA_URL }}forum/img/edit.png" alt ="" class="middle" />
 
145
                                                <span class="middle">{% trans "Edit" %}</span>
 
146
                                        </button>
 
147
                                        {% if moderator or post|pybb_equal_to:last_post %}
 
148
                                        <button onclick="window.location.href='{% url 'pybb_delete_post' post.id %}';">
 
149
                                                <img src="{{ MEDIA_URL }}forum/img/delete.png" alt ="" class="middle" />
 
150
                                                <span class="middle">{% trans "Delete" %}</span>
 
151
                                        </button>
 
152
                                        {% endif %}
 
153
                                {% endif %}
 
154
                        </td>
 
155
                </tr>
 
156
                </tbody>
 
157
        </table>
 
158
        <br /><hr /><br />
 
159
                {% endwith %}
 
160
        {% endifnotequal %}
 
161
{% endif %}
 
162
 
 
163
        <table class="forum">
 
164
                <tbody>
 
165
        {% for post in posts %}
 
166
                <tr class="{% cycle 'odd' 'even' %}">
 
167
                        <td class="author">
 
168
                                {{ post.user|user_link }}<br />
 
169
                                {% if post.user.wlprofile.avatar %}
 
170
                                <a href="{% url 'profile_view' post.user %}">
 
171
                                        <img src="{{ post.user.wlprofile.avatar.url }}" alt="Avatar" />
 
172
                                </a>
 
173
                                {% endif %}
 
174
                                <div class="authorStats">
 
175
                                <strong>Joined:</strong> {{ post.user.date_joined|custom_date:user|title }}<br />
 
176
                                <strong>Posts:</strong> {{ post.user.wlprofile.post_count }}<br />
 
177
                                <img src="{{ MEDIA_URL }}img/{{ post.user.wlprofile.user_status.image }}" alt="Ranking" /><br />
 
178
                                <strong>{{ post.user.wlprofile.user_status.text }}</strong><br />
 
179
                                {% if post.user.wlprofile.location %}
 
180
                                <strong>Location:</strong> {{ post.user.wlprofile.location }}<br />
 
181
                                {% endif %}
 
182
                                {% if post.user.wlprofile.get_ggzstats and post.user.wlprofile.get_ggzstats.ranking %} 
 
183
                                <strong>GGZ ranking:</strong> {{ post.user.wlprofile.get_ggzstats.ranking|floatformat }}<br />
 
184
                                <strong>GGZ rating:</strong> {{ post.user.wlprofile.get_ggzstats.rating|floatformat }}<br />
 
185
                                <strong>GGZ win:</strong> {{ post.user.wlprofile.get_ggzstats.wins|floatformat }}<br />
 
186
                                <strong>GGZ loses:</strong> {{ post.user.wlprofile.get_ggzstats.losses|floatformat }}<br />
 
187
                                {% endif %}
 
188
                                </div>
 
189
                        </td>
 
190
                        <td class="post">
 
191
                                <a id="post-{{ post.id }}" href="{{post.get_absolute_url}}" title="{% trans "Permalink" %}" class="posRight small permalink">&nbsp;</a>
 
192
                                <span class="small">Posted at: {{ post.created|custom_date:user}}</span>
 
193
                                <hr />
 
194
                                <div class="post">
 
195
                                        {{ post.body_html|safe }}
 
196
                                </div>
 
197
 
 
198
                                {% if post.attachment_cache %}
 
199
                                        {% for attach in post.attachment_cache %}
 
200
                                                {% trans "Attachment" %}: <a href="{{ attach.get_absolute_url }}">{{ attach.name }}</a> ({{ attach.size_display }})
 
201
                                        {% endfor %}
 
202
                                {% endif %}
 
203
 
 
204
                                {% if post.updated %}
 
205
                                        <span class="small">{% trans "Edited" %}: {{ post.updated|custom_date:user|title}}</span>
 
206
                                {% endif %}
 
207
                                <hr />
 
208
                                {% if user.is_authenticated %}
 
209
                                        {% ifequal user.wlprofile.show_signatures 1 %}
 
210
                                                {% if post.user.wlprofile.signature %}
 
211
                                                        {{ post.user.wlprofile.signature|urlize|linebreaks }}
 
212
                                                {% endif %}
 
213
                                        {% endifequal %}
 
214
                                {% else %}
 
215
                                        {% if post.user.wlprofile.signature %}
 
216
                                                {{ post.user.wlprofile.signature|urlize|linebreaks }}
 
217
                                        {% endif %}
 
218
                                {% endif %}
 
219
 
 
220
                                <a class="button posRight" href="#top">
 
221
                                        <img src="{{ MEDIA_URL }}forum/img/top.png" alt ="" class="middle" />
 
222
                                        <span class="middle">{% trans "Top" %}</span>
 
223
                                </a>
 
224
 
 
225
                                <a class="button" href="{% url 'pybb_add_post' topic.id %}?quote_id={{ post.id }}">
 
226
                                        <img src="{{ MEDIA_URL }}forum/img/quote.png" alt ="" class="middle" />
 
227
                                        <span class="middle">{% trans "Quote" %}</span>
 
228
                                </a>
 
229
                                {% if moderator or post|pybb_posted_by:user %}
 
230
                                        <a class="button" href="{% url 'pybb_edit_post' post.id %}">
 
231
                                                <img src="{{ MEDIA_URL }}forum/img/edit.png" alt ="" class="middle" />
 
232
                                                <span class="middle">{% trans "Edit" %}</span>
 
233
                                        </a>
 
234
                                        {% if moderator or post|pybb_equal_to:last_post %}
 
235
                                        <a class="button" href="{% url 'pybb_delete_post' post.id %}">
 
236
                                                <img src="{{ MEDIA_URL }}forum/img/delete.png" alt ="" class="middle" />
 
237
                                                <span class="middle">{% trans "Delete" %}</span>
 
238
                                        </a>
 
239
                                        {% endif %}
 
240
                                {% endif %}
 
241
                        </td>
 
242
                </tr>
 
243
                <tr class="spacer">
 
244
                        <td></td>
 
245
                        <td></td>
 
246
                </tr>
 
247
        {% endfor %}
 
248
                </tbody>
 
249
        </table>
 
250
 
 
251
        <div class="posRight">
 
252
        {% if moderator %}
 
253
                {% if topic.sticky %}
 
254
                <a class="button" href="{% url 'pybb_unstick_topic' topic.id %}">
 
255
                        <img src="{{ MEDIA_URL }}forum/img/unstick.png" alt ="" class="middle" />
 
256
                        <span class="middle">{% trans "Unstick Topic" %}</span>
 
257
                </a>
 
258
                {% else %}
 
259
                <a class="button" href="{% url 'pybb_stick_topic' topic.id %}">
 
260
                        <img src="{{ MEDIA_URL }}forum/img/sticky.png" alt ="" class="middle" />
 
261
                        <span class="middle">{% trans "Stick Topic" %}</span>
 
262
                </a>
 
263
                {% endif %}
 
264
                {% if topic.closed %}
 
265
                <a class="button" href="{% url 'pybb_open_topic' topic.id %}">
 
266
                        <img src="{{ MEDIA_URL }}forum/img/open.png" alt ="" class="middle" />
 
267
                        <span class="middle">{% trans "Open Topic" %}</span>
 
268
                </a>
 
269
                {% else %}
 
270
                <a class="button" href="{% url 'pybb_close_topic' topic.id %}">
 
271
                        <img src="{{ MEDIA_URL }}forum/img/closed.png" alt ="" class="middle" />
 
272
                        <span class="middle">{% trans "Close Topic" %}</span>
 
273
                </a>
 
274
                {% endif %}
 
275
        {% endif %}
 
276
        {% if user.is_authenticated %}
 
277
                {% if subscribed %}
 
278
                <a class="button" href="{% url 'pybb_delete_subscription' topic.id %}?from_topic">
 
279
                        <img src="{{ MEDIA_URL }}forum/img/unsubscribe.png" alt ="" class="middle" />
 
280
                        <span class="middle">{% trans "Unsubscribe" %}</span>
 
281
                </a>
 
282
                {% else %}
 
283
                <a class="button" href="{% url 'pybb_add_subscription' topic.id %}">
 
284
                        <img src="{{ MEDIA_URL }}forum/img/subscribe.png" alt ="" class="middle" />
 
285
                        <span class="middle">{% trans "Subscribe" %}</span>
 
286
                </a>
 
287
                {% endif %}
 
288
                <a class="button" href="{% url 'pybb_add_post' topic.id %}">
 
289
                        <img src="{{ MEDIA_URL }}forum/img/send.png" alt ="" class="middle" />
 
290
                        <span class="middle">{% trans "New Reply" %}</span>
 
291
                </a>
 
292
        {% endif %}
 
293
        </div>
 
294
        {% pybb_pagination _('Posts') %}
 
295
        <br />
85
296
</div>
 
297
 
86
298
{% if user.is_authenticated %}
87
 
    {% if not topic.closed %}
88
 
<br />
89
 
<br />
90
 
<div class="box_item_model border">
91
 
    {% include "pybb/inlines/add_post_form.html" %}
92
 
</div>
93
 
    {% endif %}
 
299
        {% if not topic.closed %}
 
300
                {% include "pybb/inlines/add_post_form.html" %}
 
301
        {% endif %}
94
302
{% endif %}
95
303
 
96
304
{% endblock %}