Show More
1 | NO CONTENT: new file 100644 |
|
NO CONTENT: new file 100644 |
@@ -0,0 +1,22 b'' | |||||
|
1 | from django.core.urlresolvers import reverse | |||
|
2 | from django.shortcuts import get_object_or_404 | |||
|
3 | from boards.models import Post | |||
|
4 | from boards.views import thread | |||
|
5 | from django import template | |||
|
6 | ||||
|
7 | register = template.Library() | |||
|
8 | ||||
|
9 | ||||
|
10 | @register.simple_tag(name='post_url') | |||
|
11 | def post_url(*args, **kwargs): | |||
|
12 | post_id = args[0] | |||
|
13 | ||||
|
14 | post = get_object_or_404(Post, id=post_id) | |||
|
15 | ||||
|
16 | if post.thread: | |||
|
17 | link = reverse(thread, kwargs={'post_id': post.thread.id}) \ | |||
|
18 | + '#' + str(post_id) | |||
|
19 | else: | |||
|
20 | link = reverse(thread, kwargs={'post_id': post_id}) | |||
|
21 | ||||
|
22 | return link |
@@ -1,227 +1,228 b'' | |||||
1 | {% extends "boards/base.html" %} |
|
1 | {% extends "boards/base.html" %} | |
2 |
|
2 | |||
3 | {% load i18n %} |
|
3 | {% load i18n %} | |
4 | {% load markup %} |
|
4 | {% load markup %} | |
5 | {% load cache %} |
|
5 | {% load cache %} | |
|
6 | {% load board %} | |||
6 |
|
7 | |||
7 | {% block head %} |
|
8 | {% block head %} | |
8 | {% if tag %} |
|
9 | {% if tag %} | |
9 | <title>Neboard - {{ tag.name }}</title> |
|
10 | <title>Neboard - {{ tag.name }}</title> | |
10 | {% else %} |
|
11 | {% else %} | |
11 | <title>Neboard</title> |
|
12 | <title>Neboard</title> | |
12 | {% endif %} |
|
13 | {% endif %} | |
13 | {% endblock %} |
|
14 | {% endblock %} | |
14 |
|
15 | |||
15 | {% block content %} |
|
16 | {% block content %} | |
16 |
|
17 | |||
17 | {% get_current_language as LANGUAGE_CODE %} |
|
18 | {% get_current_language as LANGUAGE_CODE %} | |
18 |
|
19 | |||
19 | {% if tag %} |
|
20 | {% if tag %} | |
20 | <div class="tag_info"> |
|
21 | <div class="tag_info"> | |
21 | <h2> |
|
22 | <h2> | |
22 | {% if tag in user.fav_tags.all %} |
|
23 | {% if tag in user.fav_tags.all %} | |
23 | <a href="{% url 'tag_unsubscribe' tag.name %}?next={{ request.path }}" |
|
24 | <a href="{% url 'tag_unsubscribe' tag.name %}?next={{ request.path }}" | |
24 | class="fav">★</a> |
|
25 | class="fav">★</a> | |
25 | {% else %} |
|
26 | {% else %} | |
26 | <a href="{% url 'tag_subscribe' tag.name %}?next={{ request.path }}" |
|
27 | <a href="{% url 'tag_subscribe' tag.name %}?next={{ request.path }}" | |
27 | class="not_fav">★</a> |
|
28 | class="not_fav">★</a> | |
28 | {% endif %} |
|
29 | {% endif %} | |
29 | #{{ tag.name }} |
|
30 | #{{ tag.name }} | |
30 | </h2> |
|
31 | </h2> | |
31 | </div> |
|
32 | </div> | |
32 | {% endif %} |
|
33 | {% endif %} | |
33 |
|
34 | |||
34 | {% if threads %} |
|
35 | {% if threads %} | |
35 | {% for thread in threads %} |
|
36 | {% for thread in threads %} | |
36 | {% cache 600 thread_short thread.thread.last_edit_time moderator LANGUAGE_CODE %} |
|
37 | {% cache 600 thread_short thread.thread.last_edit_time moderator LANGUAGE_CODE %} | |
37 | <div class="thread"> |
|
38 | <div class="thread"> | |
38 | {% if thread.bumpable %} |
|
39 | {% if thread.bumpable %} | |
39 | <div class="post" id="{{ thread.thread.id }}"> |
|
40 | <div class="post" id="{{ thread.thread.id }}"> | |
40 | {% else %} |
|
41 | {% else %} | |
41 | <div class="post dead_post" id="{{ thread.thread.id }}"> |
|
42 | <div class="post dead_post" id="{{ thread.thread.id }}"> | |
42 | {% endif %} |
|
43 | {% endif %} | |
43 | {% if thread.thread.image %} |
|
44 | {% if thread.thread.image %} | |
44 | <div class="image"> |
|
45 | <div class="image"> | |
45 | <a class="thumb" |
|
46 | <a class="thumb" | |
46 | href="{{ thread.thread.image.url }}"><img |
|
47 | href="{{ thread.thread.image.url }}"><img | |
47 | src="{{ thread.thread.image.url_200x150 }}" |
|
48 | src="{{ thread.thread.image.url_200x150 }}" | |
48 | alt="{{ thread.thread.id }}" |
|
49 | alt="{{ thread.thread.id }}" | |
49 | data-width="{{ thread.thread.image_width }}" |
|
50 | data-width="{{ thread.thread.image_width }}" | |
50 | data-height="{{ thread.thread.image_height }}" /> |
|
51 | data-height="{{ thread.thread.image_height }}" /> | |
51 | </a> |
|
52 | </a> | |
52 | </div> |
|
53 | </div> | |
53 | {% endif %} |
|
54 | {% endif %} | |
54 | <div class="message"> |
|
55 | <div class="message"> | |
55 | <div class="post-info"> |
|
56 | <div class="post-info"> | |
56 | <span class="title">{{ thread.thread.title }}</span> |
|
57 | <span class="title">{{ thread.thread.title }}</span> | |
57 | <a class="post_id" href="{% url 'thread' thread.thread.id %}" |
|
58 | <a class="post_id" href="{% url 'thread' thread.thread.id %}" | |
58 | >({{ thread.thread.id }})</a> |
|
59 | >({{ thread.thread.id }})</a> | |
59 | [{{ thread.thread.pub_time }}] |
|
60 | [{{ thread.thread.pub_time }}] | |
60 | [<a class="link" href="{% url 'thread' thread.thread.id %}#form" |
|
61 | [<a class="link" href="{% url 'thread' thread.thread.id %}#form" | |
61 | >{% trans "Reply" %}</a>] |
|
62 | >{% trans "Reply" %}</a>] | |
62 |
|
63 | |||
63 | {% if moderator %} |
|
64 | {% if moderator %} | |
64 | <span class="moderator_info"> |
|
65 | <span class="moderator_info"> | |
65 | [<a href="{% url 'delete' post_id=thread.thread.id %}?next={{ request.path }}" |
|
66 | [<a href="{% url 'delete' post_id=thread.thread.id %}?next={{ request.path }}" | |
66 | >{% trans 'Delete' %}</a>] |
|
67 | >{% trans 'Delete' %}</a>] | |
67 | ({{ thread.thread.poster_ip }}) |
|
68 | ({{ thread.thread.poster_ip }}) | |
68 | [<a href="{% url 'ban' post_id=thread.thread.id %}?next={{ request.path }}" |
|
69 | [<a href="{% url 'ban' post_id=thread.thread.id %}?next={{ request.path }}" | |
69 | >{% trans 'Ban IP' %}</a>] |
|
70 | >{% trans 'Ban IP' %}</a>] | |
70 | </span> |
|
71 | </span> | |
71 | {% endif %} |
|
72 | {% endif %} | |
72 | </div> |
|
73 | </div> | |
73 | {% autoescape off %} |
|
74 | {% autoescape off %} | |
74 | {{ thread.thread.text.rendered|truncatewords_html:50 }} |
|
75 | {{ thread.thread.text.rendered|truncatewords_html:50 }} | |
75 | {% endautoescape %} |
|
76 | {% endautoescape %} | |
76 | {% if thread.thread.referenced_posts.all %} |
|
77 | {% if thread.thread.referenced_posts.all %} | |
77 | <div class="refmap"> |
|
78 | <div class="refmap"> | |
78 | {% trans "Replies" %}: |
|
79 | {% trans "Replies" %}: | |
79 | {% for ref_post in thread.thread.referenced_posts.all %} |
|
80 | {% for ref_post in thread.thread.referenced_posts.all %} | |
80 |
<a href="{% url |
|
81 | <a href="{% post_url ref_post.id %}">>>{{ ref_post.id }}</a> | |
81 | {% endfor %} |
|
82 | {% endfor %} | |
82 | </div> |
|
83 | </div> | |
83 | {% endif %} |
|
84 | {% endif %} | |
84 | </div> |
|
85 | </div> | |
85 | <div class="metadata"> |
|
86 | <div class="metadata"> | |
86 | {{ thread.thread.get_reply_count }} {% trans 'replies' %}, |
|
87 | {{ thread.thread.get_reply_count }} {% trans 'replies' %}, | |
87 | {{ thread.thread.get_images_count }} {% trans 'images' %}. |
|
88 | {{ thread.thread.get_images_count }} {% trans 'images' %}. | |
88 | {% if thread.thread.tags %} |
|
89 | {% if thread.thread.tags %} | |
89 | <span class="tags"> |
|
90 | <span class="tags"> | |
90 | {% for tag in thread.thread.get_tags %} |
|
91 | {% for tag in thread.thread.get_tags %} | |
91 | <a class="tag" href=" |
|
92 | <a class="tag" href=" | |
92 | {% url 'tag' tag_name=tag.name %}"> |
|
93 | {% url 'tag' tag_name=tag.name %}"> | |
93 | #{{ tag.name }}</a> |
|
94 | #{{ tag.name }}</a> | |
94 | {% endfor %} |
|
95 | {% endfor %} | |
95 | </span> |
|
96 | </span> | |
96 | {% endif %} |
|
97 | {% endif %} | |
97 | </div> |
|
98 | </div> | |
98 | </div> |
|
99 | </div> | |
99 | {% if thread.last_replies.exists %} |
|
100 | {% if thread.last_replies.exists %} | |
100 | <div class="last-replies"> |
|
101 | <div class="last-replies"> | |
101 | {% for post in thread.last_replies %} |
|
102 | {% for post in thread.last_replies %} | |
102 | {% if thread.bumpable %} |
|
103 | {% if thread.bumpable %} | |
103 | <div class="post" id="{{ post.id }}"> |
|
104 | <div class="post" id="{{ post.id }}"> | |
104 | {% else %} |
|
105 | {% else %} | |
105 | <div class="post dead_post" id="{{ post.id }}"> |
|
106 | <div class="post dead_post" id="{{ post.id }}"> | |
106 | {% endif %} |
|
107 | {% endif %} | |
107 | {% if post.image %} |
|
108 | {% if post.image %} | |
108 | <div class="image"> |
|
109 | <div class="image"> | |
109 | <a class="thumb" |
|
110 | <a class="thumb" | |
110 | href="{{ post.image.url }}"><img |
|
111 | href="{{ post.image.url }}"><img | |
111 | src=" {{ post.image.url_200x150 }}" |
|
112 | src=" {{ post.image.url_200x150 }}" | |
112 | alt="{{ post.id }}" |
|
113 | alt="{{ post.id }}" | |
113 | data-width="{{ post.image_width }}" |
|
114 | data-width="{{ post.image_width }}" | |
114 | data-height="{{ post.image_height }}"/> |
|
115 | data-height="{{ post.image_height }}"/> | |
115 | </a> |
|
116 | </a> | |
116 | </div> |
|
117 | </div> | |
117 | {% endif %} |
|
118 | {% endif %} | |
118 | <div class="message"> |
|
119 | <div class="message"> | |
119 | <div class="post-info"> |
|
120 | <div class="post-info"> | |
120 | <span class="title">{{ post.title }}</span> |
|
121 | <span class="title">{{ post.title }}</span> | |
121 | <a class="post_id" href=" |
|
122 | <a class="post_id" href=" | |
122 | {% url 'thread' thread.thread.id %}#{{ post.id }}"> |
|
123 | {% url 'thread' thread.thread.id %}#{{ post.id }}"> | |
123 | ({{ post.id }})</a> |
|
124 | ({{ post.id }})</a> | |
124 | [{{ post.pub_time }}] |
|
125 | [{{ post.pub_time }}] | |
125 | </div> |
|
126 | </div> | |
126 | {% autoescape off %} |
|
127 | {% autoescape off %} | |
127 | {{ post.text.rendered|truncatewords_html:50 }} |
|
128 | {{ post.text.rendered|truncatewords_html:50 }} | |
128 | {% endautoescape %} |
|
129 | {% endautoescape %} | |
129 | </div> |
|
130 | </div> | |
130 | {% if post.referenced_posts.all %} |
|
131 | {% if post.referenced_posts.all %} | |
131 | <div class="refmap"> |
|
132 | <div class="refmap"> | |
132 | {% trans "Replies" %}: |
|
133 | {% trans "Replies" %}: | |
133 | {% for ref_post in post.referenced_posts.all %} |
|
134 | {% for ref_post in post.referenced_posts.all %} | |
134 |
<a href="{% url |
|
135 | <a href="{% post_url ref_post.id %}">>>{{ ref_post.id }}</a> | |
135 | {% endfor %} |
|
136 | {% endfor %} | |
136 | </div> |
|
137 | </div> | |
137 | {% endif %} |
|
138 | {% endif %} | |
138 | </div> |
|
139 | </div> | |
139 | {% endfor %} |
|
140 | {% endfor %} | |
140 | </div> |
|
141 | </div> | |
141 | {% endif %} |
|
142 | {% endif %} | |
142 | </div> |
|
143 | </div> | |
143 | {% endcache %} |
|
144 | {% endcache %} | |
144 | {% endfor %} |
|
145 | {% endfor %} | |
145 | {% else %} |
|
146 | {% else %} | |
146 | <div class="post"> |
|
147 | <div class="post"> | |
147 | {% trans 'No threads exist. Create the first one!' %}</div> |
|
148 | {% trans 'No threads exist. Create the first one!' %}</div> | |
148 | {% endif %} |
|
149 | {% endif %} | |
149 |
|
150 | |||
150 | <form enctype="multipart/form-data" method="post">{% csrf_token %} |
|
151 | <form enctype="multipart/form-data" method="post">{% csrf_token %} | |
151 | <div class="post-form-w"> |
|
152 | <div class="post-form-w"> | |
152 |
|
153 | |||
153 | <div class="form-title">{% trans "Create new thread" %}</div> |
|
154 | <div class="form-title">{% trans "Create new thread" %}</div> | |
154 | <div class="post-form"> |
|
155 | <div class="post-form"> | |
155 | <div class="form-row"> |
|
156 | <div class="form-row"> | |
156 | <div class="form-label">{% trans 'Title' %}</div> |
|
157 | <div class="form-label">{% trans 'Title' %}</div> | |
157 | <div class="form-input">{{ form.title }}</div> |
|
158 | <div class="form-input">{{ form.title }}</div> | |
158 | <div class="form-errors">{{ form.title.errors }}</div> |
|
159 | <div class="form-errors">{{ form.title.errors }}</div> | |
159 | </div> |
|
160 | </div> | |
160 | <div class="form-row"> |
|
161 | <div class="form-row"> | |
161 | <div class="form-label">{% trans 'Formatting' %}</div> |
|
162 | <div class="form-label">{% trans 'Formatting' %}</div> | |
162 | <div class="form-input" id="mark_panel"> |
|
163 | <div class="form-input" id="mark_panel"> | |
163 | <span class="mark_btn" id="quote"><span class="quote">>{% trans 'quote' %}</span></span> |
|
164 | <span class="mark_btn" id="quote"><span class="quote">>{% trans 'quote' %}</span></span> | |
164 | <span class="mark_btn" id="italic"><i>{% trans 'italic' %}</i></span> |
|
165 | <span class="mark_btn" id="italic"><i>{% trans 'italic' %}</i></span> | |
165 | <span class="mark_btn" id="bold"><b>{% trans 'bold' %}</b></span> |
|
166 | <span class="mark_btn" id="bold"><b>{% trans 'bold' %}</b></span> | |
166 | <span class="mark_btn" id="spoiler"><span class="spoiler">{% trans 'spoiler' %}</span></span> |
|
167 | <span class="mark_btn" id="spoiler"><span class="spoiler">{% trans 'spoiler' %}</span></span> | |
167 | <span class="mark_btn" id="comment"><span class="comment">// {% trans 'comment' %}</span></span> |
|
168 | <span class="mark_btn" id="comment"><span class="comment">// {% trans 'comment' %}</span></span> | |
168 | </div> |
|
169 | </div> | |
169 | </div> |
|
170 | </div> | |
170 | <div class="form-row"> |
|
171 | <div class="form-row"> | |
171 | <div class="form-label">{% trans 'Text' %}</div> |
|
172 | <div class="form-label">{% trans 'Text' %}</div> | |
172 | <div class="form-input">{{ form.text }}</div> |
|
173 | <div class="form-input">{{ form.text }}</div> | |
173 | <div class="form-errors">{{ form.text.errors }}</div> |
|
174 | <div class="form-errors">{{ form.text.errors }}</div> | |
174 | </div> |
|
175 | </div> | |
175 | <div class="form-row"> |
|
176 | <div class="form-row"> | |
176 | <div class="form-label">{% trans 'Image' %}</div> |
|
177 | <div class="form-label">{% trans 'Image' %}</div> | |
177 | <div class="form-input">{{ form.image }}</div> |
|
178 | <div class="form-input">{{ form.image }}</div> | |
178 | <div class="form-errors">{{ form.image.errors }}</div> |
|
179 | <div class="form-errors">{{ form.image.errors }}</div> | |
179 | </div> |
|
180 | </div> | |
180 | <div class="form-row"> |
|
181 | <div class="form-row"> | |
181 | <div class="form-label">{% trans 'Tags' %}</div> |
|
182 | <div class="form-label">{% trans 'Tags' %}</div> | |
182 | <div class="form-input">{{ form.tags }}</div> |
|
183 | <div class="form-input">{{ form.tags }}</div> | |
183 | <div class="form-errors">{{ form.tags.errors }}</div> |
|
184 | <div class="form-errors">{{ form.tags.errors }}</div> | |
184 | </div> |
|
185 | </div> | |
185 | <div class="form-row form-email"> |
|
186 | <div class="form-row form-email"> | |
186 | <div class="form-label">{% trans 'e-mail' %}</div> |
|
187 | <div class="form-label">{% trans 'e-mail' %}</div> | |
187 | <div class="form-input">{{ form.email }}</div> |
|
188 | <div class="form-input">{{ form.email }}</div> | |
188 | <div class="form-errors">{{ form.email.errors }}</div> |
|
189 | <div class="form-errors">{{ form.email.errors }}</div> | |
189 | </div> |
|
190 | </div> | |
190 | <div class="form-row"> |
|
191 | <div class="form-row"> | |
191 | {{ form.captcha }} |
|
192 | {{ form.captcha }} | |
192 | <div class="form-errors">{{ form.captcha.errors }}</div> |
|
193 | <div class="form-errors">{{ form.captcha.errors }}</div> | |
193 | </div> |
|
194 | </div> | |
194 | <div class="form-row"> |
|
195 | <div class="form-row"> | |
195 | <div class="form-errors">{{ form.other.errors }}</div> |
|
196 | <div class="form-errors">{{ form.other.errors }}</div> | |
196 | </div> |
|
197 | </div> | |
197 | </div> |
|
198 | </div> | |
198 | <div class="form-submit"> |
|
199 | <div class="form-submit"> | |
199 | <input type="submit" value="{% trans "Post" %}"/></div> |
|
200 | <input type="submit" value="{% trans "Post" %}"/></div> | |
200 | <div> |
|
201 | <div> | |
201 | {% trans 'Tags must be delimited by spaces. Text or image is required.' %} |
|
202 | {% trans 'Tags must be delimited by spaces. Text or image is required.' %} | |
202 | </div> |
|
203 | </div> | |
203 | <div><a href="{% url "staticpage" name="help" %}"> |
|
204 | <div><a href="{% url "staticpage" name="help" %}"> | |
204 | {% trans 'Text syntax' %}</a></div> |
|
205 | {% trans 'Text syntax' %}</a></div> | |
205 | </div> |
|
206 | </div> | |
206 | </form> |
|
207 | </form> | |
207 |
|
208 | |||
208 | {% endblock %} |
|
209 | {% endblock %} | |
209 |
|
210 | |||
210 | {% block metapanel %} |
|
211 | {% block metapanel %} | |
211 |
|
212 | |||
212 | <span class="metapanel"> |
|
213 | <span class="metapanel"> | |
213 | <b><a href="{% url "authors" %}">Neboard</a> 1.3</b> |
|
214 | <b><a href="{% url "authors" %}">Neboard</a> 1.3</b> | |
214 | {% trans "Pages:" %} |
|
215 | {% trans "Pages:" %} | |
215 | {% for page in pages %} |
|
216 | {% for page in pages %} | |
216 | [<a href=" |
|
217 | [<a href=" | |
217 | {% if tag %} |
|
218 | {% if tag %} | |
218 | {% url "tag" tag_name=tag page=page %} |
|
219 | {% url "tag" tag_name=tag page=page %} | |
219 | {% else %} |
|
220 | {% else %} | |
220 | {% url "index" page=page %} |
|
221 | {% url "index" page=page %} | |
221 | {% endif %} |
|
222 | {% endif %} | |
222 | ">{{ page }}</a>] |
|
223 | ">{{ page }}</a>] | |
223 | {% endfor %} |
|
224 | {% endfor %} | |
224 | [<a href="rss/">RSS</a>] |
|
225 | [<a href="rss/">RSS</a>] | |
225 | </span> |
|
226 | </span> | |
226 |
|
227 | |||
227 | {% endblock %} |
|
228 | {% endblock %} |
@@ -1,160 +1,161 b'' | |||||
1 | {% extends "boards/base.html" %} |
|
1 | {% extends "boards/base.html" %} | |
2 |
|
2 | |||
3 | {% load i18n %} |
|
3 | {% load i18n %} | |
4 | {% load markup %} |
|
4 | {% load markup %} | |
5 | {% load cache %} |
|
5 | {% load cache %} | |
6 | {% load static from staticfiles %} |
|
6 | {% load static from staticfiles %} | |
|
7 | {% load board %} | |||
7 |
|
8 | |||
8 | {% block head %} |
|
9 | {% block head %} | |
9 | <title>Neboard - {{ posts.0.get_title }}</title> |
|
10 | <title>Neboard - {{ posts.0.get_title }}</title> | |
10 | {% endblock %} |
|
11 | {% endblock %} | |
11 |
|
12 | |||
12 | {% block content %} |
|
13 | {% block content %} | |
13 | {% get_current_language as LANGUAGE_CODE %} |
|
14 | {% get_current_language as LANGUAGE_CODE %} | |
14 |
|
15 | |||
15 | <script src="{% static 'js/thread.js' %}"></script> |
|
16 | <script src="{% static 'js/thread.js' %}"></script> | |
16 |
|
17 | |||
17 | {% if posts %} |
|
18 | {% if posts %} | |
18 | {% cache 600 thread_view posts.0.last_edit_time moderator LANGUAGE_CODE %} |
|
19 | {% cache 600 thread_view posts.0.last_edit_time moderator LANGUAGE_CODE %} | |
19 | {% if bumpable %} |
|
20 | {% if bumpable %} | |
20 | <div class="bar-bg"> |
|
21 | <div class="bar-bg"> | |
21 | <div class="bar-value" style="width:{{ bumplimit_progress }}%"> |
|
22 | <div class="bar-value" style="width:{{ bumplimit_progress }}%"> | |
22 | </div> |
|
23 | </div> | |
23 | <div class="bar-text"> |
|
24 | <div class="bar-text"> | |
24 | {{ posts_left }} {% trans 'posts to bumplimit' %} |
|
25 | {{ posts_left }} {% trans 'posts to bumplimit' %} | |
25 | </div> |
|
26 | </div> | |
26 | </div> |
|
27 | </div> | |
27 | {% endif %} |
|
28 | {% endif %} | |
28 | <div class="thread"> |
|
29 | <div class="thread"> | |
29 | {% for post in posts %} |
|
30 | {% for post in posts %} | |
30 | {% if bumpable %} |
|
31 | {% if bumpable %} | |
31 | <div class="post" id="{{ post.id }}"> |
|
32 | <div class="post" id="{{ post.id }}"> | |
32 | {% else %} |
|
33 | {% else %} | |
33 | <div class="post dead_post" id="{{ post.id }}"> |
|
34 | <div class="post dead_post" id="{{ post.id }}"> | |
34 | {% endif %} |
|
35 | {% endif %} | |
35 | {% if post.image %} |
|
36 | {% if post.image %} | |
36 | <div class="image"> |
|
37 | <div class="image"> | |
37 | <a |
|
38 | <a | |
38 | class="thumb" |
|
39 | class="thumb" | |
39 | href="{{ post.image.url }}"><img |
|
40 | href="{{ post.image.url }}"><img | |
40 | src="{{ post.image.url_200x150 }}" |
|
41 | src="{{ post.image.url_200x150 }}" | |
41 | alt="{{ post.id }}" |
|
42 | alt="{{ post.id }}" | |
42 | data-width="{{ post.image_width }}" |
|
43 | data-width="{{ post.image_width }}" | |
43 | data-height="{{ post.image_height }}"/> |
|
44 | data-height="{{ post.image_height }}"/> | |
44 | </a> |
|
45 | </a> | |
45 | </div> |
|
46 | </div> | |
46 | {% endif %} |
|
47 | {% endif %} | |
47 | <div class="message"> |
|
48 | <div class="message"> | |
48 | <div class="post-info"> |
|
49 | <div class="post-info"> | |
49 | <span class="title">{{ post.title }}</span> |
|
50 | <span class="title">{{ post.title }}</span> | |
50 | <a class="post_id" href="#{{ post.id }}"> |
|
51 | <a class="post_id" href="#{{ post.id }}"> | |
51 | ({{ post.id }})</a> |
|
52 | ({{ post.id }})</a> | |
52 | [{{ post.pub_time }}] |
|
53 | [{{ post.pub_time }}] | |
53 | [<a href="#" onclick="javascript:addQuickReply('{{ post.id }}') |
|
54 | [<a href="#" onclick="javascript:addQuickReply('{{ post.id }}') | |
54 | ; return false;">>></a>] |
|
55 | ; return false;">>></a>] | |
55 |
|
56 | |||
56 | {% if moderator %} |
|
57 | {% if moderator %} | |
57 | <span class="moderator_info"> |
|
58 | <span class="moderator_info"> | |
58 | [<a href="{% url 'delete' post_id=post.id %}" |
|
59 | [<a href="{% url 'delete' post_id=post.id %}" | |
59 | >{% trans 'Delete' %}</a>] |
|
60 | >{% trans 'Delete' %}</a>] | |
60 | ({{ post.poster_ip }}) |
|
61 | ({{ post.poster_ip }}) | |
61 | [<a href="{% url 'ban' post_id=post.id %}?next={{ request.path }}" |
|
62 | [<a href="{% url 'ban' post_id=post.id %}?next={{ request.path }}" | |
62 | >{% trans 'Ban IP' %}</a>] |
|
63 | >{% trans 'Ban IP' %}</a>] | |
63 | </span> |
|
64 | </span> | |
64 | {% endif %} |
|
65 | {% endif %} | |
65 | </div> |
|
66 | </div> | |
66 | {% autoescape off %} |
|
67 | {% autoescape off %} | |
67 | {{ post.text.rendered }} |
|
68 | {{ post.text.rendered }} | |
68 | {% endautoescape %} |
|
69 | {% endautoescape %} | |
69 | {% if post.referenced_posts.all %} |
|
70 | {% if post.referenced_posts.all %} | |
70 | <div class="refmap"> |
|
71 | <div class="refmap"> | |
71 | {% trans "Replies" %}: |
|
72 | {% trans "Replies" %}: | |
72 | {% for ref_post in post.referenced_posts.all %} |
|
73 | {% for ref_post in post.referenced_posts.all %} | |
73 |
<a href="{% url |
|
74 | <a href="{% post_url ref_post.id %}">>>{{ ref_post.id }}</a> | |
74 | {% endfor %} |
|
75 | {% endfor %} | |
75 | </div> |
|
76 | </div> | |
76 | {% endif %} |
|
77 | {% endif %} | |
77 | </div> |
|
78 | </div> | |
78 | {% if post.id == posts.0.id %} |
|
79 | {% if post.id == posts.0.id %} | |
79 | <div class="metadata"> |
|
80 | <div class="metadata"> | |
80 | <span class="tags"> |
|
81 | <span class="tags"> | |
81 | {% for tag in post.get_tags %} |
|
82 | {% for tag in post.get_tags %} | |
82 | <a class="tag" href="{% url 'tag' tag.name %}"> |
|
83 | <a class="tag" href="{% url 'tag' tag.name %}"> | |
83 | #{{ tag.name }}</a> |
|
84 | #{{ tag.name }}</a> | |
84 | {% endfor %} |
|
85 | {% endfor %} | |
85 | </span> |
|
86 | </span> | |
86 | </div> |
|
87 | </div> | |
87 | {% endif %} |
|
88 | {% endif %} | |
88 | </div> |
|
89 | </div> | |
89 | {% endfor %} |
|
90 | {% endfor %} | |
90 | </div> |
|
91 | </div> | |
91 | {% endcache %} |
|
92 | {% endcache %} | |
92 | {% endif %} |
|
93 | {% endif %} | |
93 |
|
94 | |||
94 | <form id="form" enctype="multipart/form-data" method="post" |
|
95 | <form id="form" enctype="multipart/form-data" method="post" | |
95 | >{% csrf_token %} |
|
96 | >{% csrf_token %} | |
96 | <div class="post-form-w"> |
|
97 | <div class="post-form-w"> | |
97 | <div class="form-title">{% trans "Reply to thread" %} #{{ posts.0.id }}</div> |
|
98 | <div class="form-title">{% trans "Reply to thread" %} #{{ posts.0.id }}</div> | |
98 | <div class="post-form"> |
|
99 | <div class="post-form"> | |
99 | <div class="form-row"> |
|
100 | <div class="form-row"> | |
100 | <div class="form-label">{% trans 'Title' %}</div> |
|
101 | <div class="form-label">{% trans 'Title' %}</div> | |
101 | <div class="form-input">{{ form.title }}</div> |
|
102 | <div class="form-input">{{ form.title }}</div> | |
102 | <div class="form-errors">{{ form.title.errors }}</div> |
|
103 | <div class="form-errors">{{ form.title.errors }}</div> | |
103 | </div> |
|
104 | </div> | |
104 | <div class="form-row"> |
|
105 | <div class="form-row"> | |
105 | <div class="form-label">{% trans 'Formatting' %}</div> |
|
106 | <div class="form-label">{% trans 'Formatting' %}</div> | |
106 | <div class="form-input" id="mark_panel"> |
|
107 | <div class="form-input" id="mark_panel"> | |
107 | <span class="mark_btn" id="quote"><span class="quote">>{% trans 'quote' %}</span></span> |
|
108 | <span class="mark_btn" id="quote"><span class="quote">>{% trans 'quote' %}</span></span> | |
108 | <span class="mark_btn" id="italic"><i>{% trans 'italic' %}</i></span> |
|
109 | <span class="mark_btn" id="italic"><i>{% trans 'italic' %}</i></span> | |
109 | <span class="mark_btn" id="bold"><b>{% trans 'bold' %}</b></span> |
|
110 | <span class="mark_btn" id="bold"><b>{% trans 'bold' %}</b></span> | |
110 | <span class="mark_btn" id="spoiler"><span class="spoiler">{% trans 'spoiler' %}</span></span> |
|
111 | <span class="mark_btn" id="spoiler"><span class="spoiler">{% trans 'spoiler' %}</span></span> | |
111 | <span class="mark_btn" id="comment"><span class="comment">// {% trans 'comment' %}</span></span> |
|
112 | <span class="mark_btn" id="comment"><span class="comment">// {% trans 'comment' %}</span></span> | |
112 | </div> |
|
113 | </div> | |
113 | </div> |
|
114 | </div> | |
114 | <div class="form-row"> |
|
115 | <div class="form-row"> | |
115 | <div class="form-label">{% trans 'Text' %}</div> |
|
116 | <div class="form-label">{% trans 'Text' %}</div> | |
116 | <div class="form-input">{{ form.text }}</div> |
|
117 | <div class="form-input">{{ form.text }}</div> | |
117 | <div class="form-errors">{{ form.text.errors }}</div> |
|
118 | <div class="form-errors">{{ form.text.errors }}</div> | |
118 | </div> |
|
119 | </div> | |
119 | <div class="form-row"> |
|
120 | <div class="form-row"> | |
120 | <div class="form-label">{% trans 'Image' %}</div> |
|
121 | <div class="form-label">{% trans 'Image' %}</div> | |
121 | <div class="form-input">{{ form.image }}</div> |
|
122 | <div class="form-input">{{ form.image }}</div> | |
122 | <div class="form-errors">{{ form.image.errors }}</div> |
|
123 | <div class="form-errors">{{ form.image.errors }}</div> | |
123 | </div> |
|
124 | </div> | |
124 | <div class="form-row form-email"> |
|
125 | <div class="form-row form-email"> | |
125 | <div class="form-label">{% trans 'e-mail' %}</div> |
|
126 | <div class="form-label">{% trans 'e-mail' %}</div> | |
126 | <div class="form-input">{{ form.email }}</div> |
|
127 | <div class="form-input">{{ form.email }}</div> | |
127 | <div class="form-errors">{{ form.email.errors }}</div> |
|
128 | <div class="form-errors">{{ form.email.errors }}</div> | |
128 | </div> |
|
129 | </div> | |
129 | <div class="form-row"> |
|
130 | <div class="form-row"> | |
130 | {{ form.captcha }} |
|
131 | {{ form.captcha }} | |
131 | <div class="form-errors">{{ form.captcha.errors }}</div> |
|
132 | <div class="form-errors">{{ form.captcha.errors }}</div> | |
132 | </div> |
|
133 | </div> | |
133 | <div class="form-row"> |
|
134 | <div class="form-row"> | |
134 | <div class="form-errors">{{ form.other.errors }}</div> |
|
135 | <div class="form-errors">{{ form.other.errors }}</div> | |
135 | </div> |
|
136 | </div> | |
136 | </div> |
|
137 | </div> | |
137 |
|
138 | |||
138 | <div class="form-submit"><input type="submit" |
|
139 | <div class="form-submit"><input type="submit" | |
139 | value="{% trans "Post" %}"/></div> |
|
140 | value="{% trans "Post" %}"/></div> | |
140 | <div><a href="{% url "staticpage" name="help" %}"> |
|
141 | <div><a href="{% url "staticpage" name="help" %}"> | |
141 | {% trans 'Text syntax' %}</a></div> |
|
142 | {% trans 'Text syntax' %}</a></div> | |
142 | </div> |
|
143 | </div> | |
143 | </form> |
|
144 | </form> | |
144 |
|
145 | |||
145 | {% endblock %} |
|
146 | {% endblock %} | |
146 |
|
147 | |||
147 | {% block metapanel %} |
|
148 | {% block metapanel %} | |
148 |
|
149 | |||
149 | {% get_current_language as LANGUAGE_CODE %} |
|
150 | {% get_current_language as LANGUAGE_CODE %} | |
150 |
|
151 | |||
151 | <span class="metapanel"> |
|
152 | <span class="metapanel"> | |
152 | {% cache 600 thread_meta posts.0.last_edit_time moderator LANGUAGE_CODE %} |
|
153 | {% cache 600 thread_meta posts.0.last_edit_time moderator LANGUAGE_CODE %} | |
153 | {{ posts.0.get_reply_count }} {% trans 'replies' %}, |
|
154 | {{ posts.0.get_reply_count }} {% trans 'replies' %}, | |
154 | {{ posts.0.get_images_count }} {% trans 'images' %}. |
|
155 | {{ posts.0.get_images_count }} {% trans 'images' %}. | |
155 | {% trans 'Last update: ' %}{{ posts.0.last_edit_time }} |
|
156 | {% trans 'Last update: ' %}{{ posts.0.last_edit_time }} | |
156 | [<a href="rss/">RSS</a>] |
|
157 | [<a href="rss/">RSS</a>] | |
157 | {% endcache %} |
|
158 | {% endcache %} | |
158 | </span> |
|
159 | </span> | |
159 |
|
160 | |||
160 | {% endblock %} |
|
161 | {% endblock %} |
General Comments 0
You need to be logged in to leave comments.
Login now