Show More
1 | NO CONTENT: modified file, binary diff hidden |
|
NO CONTENT: modified file, binary diff hidden |
@@ -7,7 +7,7 b' msgid ""' | |||||
7 | msgstr "" |
|
7 | msgstr "" | |
8 | "Project-Id-Version: PACKAGE VERSION\n" |
|
8 | "Project-Id-Version: PACKAGE VERSION\n" | |
9 | "Report-Msgid-Bugs-To: \n" |
|
9 | "Report-Msgid-Bugs-To: \n" | |
10 |
"POT-Creation-Date: 2013-09-0 |
|
10 | "POT-Creation-Date: 2013-09-07 19:43+0300\n" | |
11 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" |
|
11 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" | |
12 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" |
|
12 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" | |
13 | "Language-Team: LANGUAGE <LL@li.org>\n" |
|
13 | "Language-Team: LANGUAGE <LL@li.org>\n" | |
@@ -106,8 +106,8 b' msgid "images"' | |||||
106 | msgstr "изображений" |
|
106 | msgstr "изображений" | |
107 |
|
107 | |||
108 | #: templates/boards/posting_general.html:66 |
|
108 | #: templates/boards/posting_general.html:66 | |
109 |
#: templates/boards/posting_general.html:139 templates/boards/t |
|
109 | #: templates/boards/posting_general.html:139 templates/boards/tags.html:7 | |
110 | #: templates/boards/rss/post.html:10 |
|
110 | #: templates/boards/thread.html:56 templates/boards/rss/post.html:10 | |
111 | msgid "Tags" |
|
111 | msgid "Tags" | |
112 | msgstr "Теги" |
|
112 | msgstr "Теги" | |
113 |
|
113 | |||
@@ -164,9 +164,21 b' msgstr "\xd0\xa2\xd0\xb5\xd0\xbc\xd0\xb0"' | |||||
164 | msgid "Save" |
|
164 | msgid "Save" | |
165 | msgstr "Сохранить" |
|
165 | msgstr "Сохранить" | |
166 |
|
166 | |||
167 | #: templates/boards/tags.html:7 |
|
167 | #: templates/boards/tags.html:17 | |
168 |
msgid "t |
|
168 | msgid "threads" | |
169 |
msgstr "те |
|
169 | msgstr "тем" | |
|
170 | ||||
|
171 | #: templates/boards/tags.html:20 | |||
|
172 | msgid "Remove" | |||
|
173 | msgstr "Удалить" | |||
|
174 | ||||
|
175 | #: templates/boards/tags.html:23 | |||
|
176 | msgid "Add" | |||
|
177 | msgstr "Добавить" | |||
|
178 | ||||
|
179 | #: templates/boards/tags.html:28 | |||
|
180 | msgid "No tags found." | |||
|
181 | msgstr "Теги не найдены." | |||
170 |
|
182 | |||
171 | #: templates/boards/thread.html:72 |
|
183 | #: templates/boards/thread.html:72 | |
172 | msgid "Reply to thread" |
|
184 | msgid "Reply to thread" | |
@@ -196,6 +208,9 b' msgstr "\xd0\xa1\xd1\x81\xd1\x8b\xd0\xbb\xd0\xba\xd0\xb8 \xd0\xbd\xd0\xb0 \xd0\xbe\xd1\x82\xd0\xb2\xd0\xb5\xd1\x82\xd1\x8b \xd0\xbc\xd0\xbe\xd0\xb3\xd1\x83\xd1\x82 \xd0\xb1\xd1\x8b\xd1\x82\xd1\x8c \xd0\xb2\xd1\x81\xd1\x82\xd0\xb0\xd0\xb2\xd0\xbb\xd0\xb5\xd0\xbd\xd1\x8b \xd1\x81 \xd0\xbf\xd0\xbe\xd0\xbc\xd0\xbe\xd1\x89\xd1\x8c\xd1\x8e"' | |||||
196 | msgid "Last update: " |
|
208 | msgid "Last update: " | |
197 | msgstr "Последнее обновление: " |
|
209 | msgstr "Последнее обновление: " | |
198 |
|
210 | |||
|
211 | #~ msgid "tags" | |||
|
212 | #~ msgstr "тегов" | |||
|
213 | ||||
199 | #~ msgid "Get!" |
|
214 | #~ msgid "Get!" | |
200 | #~ msgstr "Гет!" |
|
215 | #~ msgstr "Гет!" | |
201 |
|
216 |
@@ -29,7 +29,7 b'' | |||||
29 | <a class="link" href="{% url 'index' %}">{% trans "All threads" %}</a> |
|
29 | <a class="link" href="{% url 'index' %}">{% trans "All threads" %}</a> | |
30 | {% for tag in tags %} |
|
30 | {% for tag in tags %} | |
31 | <a class="tag" href="{% url 'tag' tag_name=tag.name %}"> |
|
31 | <a class="tag" href="{% url 'tag' tag_name=tag.name %}"> | |
32 |
{{ tag.name }}</a> |
|
32 | {{ tag.name }}</a> | |
33 | {% endfor %} |
|
33 | {% endfor %} | |
34 | <a class="tag" href="{% url 'tags' %}">[...]</a> |
|
34 | <a class="tag" href="{% url 'tags' %}">[...]</a> | |
35 | <a class="link" href="{% url 'settings' %}">{% trans 'Settings' %}</a> |
|
35 | <a class="link" href="{% url 'settings' %}">{% trans 'Settings' %}</a> |
@@ -4,20 +4,28 b'' | |||||
4 | {% load markup %} |
|
4 | {% load markup %} | |
5 |
|
5 | |||
6 | {% block head %} |
|
6 | {% block head %} | |
7 |
<title>Neboard - {% trans " |
|
7 | <title>Neboard - {% trans "Tags" %}</title> | |
8 | {% endblock %} |
|
8 | {% endblock %} | |
9 |
|
9 | |||
10 | {% block content %} |
|
10 | {% block content %} | |
11 |
|
11 | |||
12 | <div class="post"> |
|
12 | <div class="post"> | |
13 | {% if tags %} |
|
13 | {% if all_tags %} | |
14 | {% for tag in all_tags %} |
|
14 | {% for tag in all_tags %} | |
15 | <a class="tag" href="{% url 'tag' tag.name %}"> |
|
15 | <a class="tag" href="{% url 'tag' tag.name %}"> | |
16 |
{{ tag.name }}</a> |
|
16 | {{ tag.name }}</a> | |
|
17 | ({{ tag.get_post_count }} {% trans 'threads' %}) | |||
|
18 | {% if tag in user.fav_tags.all %} | |||
|
19 | [<a href="{% url 'tag_unsubscribe' tag.name %}" | |||
|
20 | >{% trans 'Remove' %}</a>] | |||
|
21 | {% else %} | |||
|
22 | [<a href="{% url 'tag_subscribe' tag.name %}" | |||
|
23 | >{% trans 'Add' %}</a>] | |||
|
24 | {% endif %} | |||
|
25 | <br /> | |||
17 | {% endfor %} |
|
26 | {% endfor %} | |
18 | {% else %} |
|
27 | {% else %} | |
19 | No tags found. |
|
28 | {% trans 'No tags found.' %} | |
20 | <hr /> |
|
|||
21 | {% endif %} |
|
29 | {% endif %} | |
22 | </div> |
|
30 | </div> | |
23 |
|
31 |
@@ -20,6 +20,14 b" urlpatterns = patterns(''," | |||||
20 | url(r'^tag/(?P<tag_name>\w+)/$', views.tag, name='tag'), |
|
20 | url(r'^tag/(?P<tag_name>\w+)/$', views.tag, name='tag'), | |
21 | # /boards/tag/tag_id/page/ |
|
21 | # /boards/tag/tag_id/page/ | |
22 | url(r'^tag/(?P<tag_name>\w+)/page/(?P<page>\w+)/$', views.tag, name='tag'), |
|
22 | url(r'^tag/(?P<tag_name>\w+)/page/(?P<page>\w+)/$', views.tag, name='tag'), | |
|
23 | ||||
|
24 | # /boards/tag/tag_name/unsubscribe/ | |||
|
25 | url(r'^tag/(?P<tag_name>\w+)/subscribe/$', views.tag_subscribe, | |||
|
26 | name='tag_subscribe'), | |||
|
27 | # /boards/tag/tag_name/unsubscribe/ | |||
|
28 | url(r'^tag/(?P<tag_name>\w+)/unsubscribe/$', views.tag_unsubscribe, | |||
|
29 | name='tag_unsubscribe'), | |||
|
30 | ||||
23 | # /boards/thread/ |
|
31 | # /boards/thread/ | |
24 | url(r'^thread/(?P<post_id>\w+)/$', views.thread, name='thread'), |
|
32 | url(r'^thread/(?P<post_id>\w+)/$', views.thread, name='thread'), | |
25 | # /boards/theme/theme_name/ |
|
33 | # /boards/theme/theme_name/ |
@@ -232,6 +232,7 b' def delete(request, post_id):' | |||||
232 | else: |
|
232 | else: | |
233 | return redirect(thread, post_id=post.parent) |
|
233 | return redirect(thread, post_id=post.parent) | |
234 |
|
234 | |||
|
235 | ||||
235 | def you_are_banned(request): |
|
236 | def you_are_banned(request): | |
236 | context = _init_default_context(request) |
|
237 | context = _init_default_context(request) | |
237 | return render(request, 'boards/banned.html', context) |
|
238 | return render(request, 'boards/banned.html', context) | |
@@ -242,6 +243,26 b' def page_404(request):' | |||||
242 | return render(request, 'boards/404.html', context) |
|
243 | return render(request, 'boards/404.html', context) | |
243 |
|
244 | |||
244 |
|
245 | |||
|
246 | def tag_subscribe(request, tag_name): | |||
|
247 | user = _get_user(request) | |||
|
248 | tag = get_object_or_404(Tag, name=tag_name) | |||
|
249 | ||||
|
250 | if not tag in user.fav_tags.all(): | |||
|
251 | user.fav_tags.add(tag) | |||
|
252 | ||||
|
253 | return redirect(all_tags) | |||
|
254 | ||||
|
255 | ||||
|
256 | def tag_unsubscribe(request, tag_name): | |||
|
257 | user = _get_user(request) | |||
|
258 | tag = get_object_or_404(Tag, name=tag_name) | |||
|
259 | ||||
|
260 | if tag in user.fav_tags.all(): | |||
|
261 | user.fav_tags.remove(tag) | |||
|
262 | ||||
|
263 | return redirect(all_tags) | |||
|
264 | ||||
|
265 | ||||
245 | def _get_theme(request): |
|
266 | def _get_theme(request): | |
246 | """Get user's CSS theme""" |
|
267 | """Get user's CSS theme""" | |
247 |
|
268 | |||
@@ -266,9 +287,9 b' def _init_default_context(request):' | |||||
266 | """Create context with default values that are used in most views""" |
|
287 | """Create context with default values that are used in most views""" | |
267 |
|
288 | |||
268 | context = RequestContext(request) |
|
289 | context = RequestContext(request) | |
269 | context['tags'] = Tag.objects.get_popular_tags() |
|
290 | context['user'] = _get_user(request) | |
|
291 | context['tags'] = _get_user(request).fav_tags.all() | |||
270 | context['theme'] = _get_theme(request) |
|
292 | context['theme'] = _get_theme(request) | |
271 | context['user'] = _get_user(request) |
|
|||
272 |
|
293 | |||
273 | return context |
|
294 | return context | |
274 |
|
295 |
General Comments 0
You need to be logged in to leave comments.
Login now