Show More
@@ -327,6 +327,14 b' class SettingsForm(NeboardForm):' | |||||
327 | label=_('Theme')) |
|
327 | label=_('Theme')) | |
328 | username = forms.CharField(label=_('User name'), required=False) |
|
328 | username = forms.CharField(label=_('User name'), required=False) | |
329 |
|
329 | |||
|
330 | def clean_username(self): | |||
|
331 | username = self.cleaned_data['username'] | |||
|
332 | ||||
|
333 | if username and not REGEX_TAGS.match(username): | |||
|
334 | raise forms.ValidationError(_('Inappropriate characters.')) | |||
|
335 | ||||
|
336 | return username | |||
|
337 | ||||
330 |
|
338 | |||
331 | class SearchForm(NeboardForm): |
|
339 | class SearchForm(NeboardForm): | |
332 | query = forms.CharField(max_length=500, label=LABEL_SEARCH, required=False) |
|
340 | query = forms.CharField(max_length=500, label=LABEL_SEARCH, required=False) |
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: 2015-02-2 |
|
10 | "POT-Creation-Date: 2015-02-24 08:32+0200\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" | |
@@ -124,6 +124,10 b' msgstr "\xd0\xa2\xd0\xb5\xd0\xbc\xd0\xb0"' | |||||
124 | msgid "User name" |
|
124 | msgid "User name" | |
125 | msgstr "ΠΠΌΡ ΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΠ΅Π»Ρ" |
|
125 | msgstr "ΠΠΌΡ ΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΠ΅Π»Ρ" | |
126 |
|
126 | |||
|
127 | #: forms.py:334 | |||
|
128 | msgid "Inappropriate characters." | |||
|
129 | msgstr "ΠΠ΅Π΄ΠΎΠΏΡΡΡΠΈΠΌΡΠ΅ ΡΠΈΠΌΠ²ΠΎΠ»Ρ." | |||
|
130 | ||||
127 | #: templates/boards/404.html:6 |
|
131 | #: templates/boards/404.html:6 | |
128 | msgid "Not found" |
|
132 | msgid "Not found" | |
129 | msgstr "ΠΠ΅ Π½Π°ΠΉΠ΄Π΅Π½ΠΎ" |
|
133 | msgstr "ΠΠ΅ Π½Π°ΠΉΠ΄Π΅Π½ΠΎ" | |
@@ -160,7 +164,7 b' msgstr "\xd0\x92\xd1\x81\xd0\xb5 \xd1\x82\xd0\xb5\xd0\xbc\xd1\x8b"' | |||||
160 | msgid "Tag management" |
|
164 | msgid "Tag management" | |
161 | msgstr "Π£ΠΏΡΠ°Π²Π»Π΅Π½ΠΈΠ΅ ΠΌΠ΅ΡΠΊΠ°ΠΌΠΈ" |
|
165 | msgstr "Π£ΠΏΡΠ°Π²Π»Π΅Π½ΠΈΠ΅ ΠΌΠ΅ΡΠΊΠ°ΠΌΠΈ" | |
162 |
|
166 | |||
163 | #: templates/boards/base.html:41 |
|
167 | #: templates/boards/base.html:41 templates/boards/notifications.html:7 | |
164 | msgid "Notifications" |
|
168 | msgid "Notifications" | |
165 | msgstr "Π£Π²Π΅Π΄ΠΎΠΌΠ»Π΅Π½ΠΈΡ" |
|
169 | msgstr "Π£Π²Π΅Π΄ΠΎΠΌΠ»Π΅Π½ΠΈΡ" | |
166 |
|
170 | |||
@@ -193,13 +197,13 b' msgstr "\xd0\x92\xd1\x85\xd0\xbe\xd0\xb4"' | |||||
193 | msgid "Insert your user id above" |
|
197 | msgid "Insert your user id above" | |
194 | msgstr "ΠΡΡΠ°Π²ΡΡΠ΅ ΡΠ²ΠΎΠΉ ID ΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΠ΅Π»Ρ Π²ΡΡΠ΅" |
|
198 | msgstr "ΠΡΡΠ°Π²ΡΡΠ΅ ΡΠ²ΠΎΠΉ ID ΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΠ΅Π»Ρ Π²ΡΡΠ΅" | |
195 |
|
199 | |||
196 |
#: templates/boards/notifications.html:1 |
|
200 | #: templates/boards/notifications.html:16 | |
197 | #: templates/boards/posting_general.html:85 templates/search/search.html:22 |
|
201 | #: templates/boards/posting_general.html:85 templates/search/search.html:22 | |
198 | msgid "Previous page" |
|
202 | msgid "Previous page" | |
199 | msgstr "ΠΡΠ΅Π΄ΡΠ΄ΡΡΠ°Ρ ΡΡΡΠ°Π½ΠΈΡΠ°" |
|
203 | msgstr "ΠΡΠ΅Π΄ΡΠ΄ΡΡΠ°Ρ ΡΡΡΠ°Π½ΠΈΡΠ°" | |
200 |
|
204 | |||
201 |
#: templates/boards/notifications.html:2 |
|
205 | #: templates/boards/notifications.html:26 | |
202 |
#: templates/boards/posting_general.html:12 |
|
206 | #: templates/boards/posting_general.html:125 templates/search/search.html:33 | |
203 | msgid "Next page" |
|
207 | msgid "Next page" | |
204 | msgstr "Π‘Π»Π΅Π΄ΡΡΡΠ°Ρ ΡΡΡΠ°Π½ΠΈΡΠ°" |
|
208 | msgstr "Π‘Π»Π΅Π΄ΡΡΡΠ°Ρ ΡΡΡΠ°Π½ΠΈΡΠ°" | |
205 |
|
209 | |||
@@ -254,34 +258,34 b' msgstr "\xd0\x98\xd0\xb7\xd0\xbc\xd0\xb5\xd0\xbd\xd0\xb8\xd1\x82\xd1\x8c \xd0\xbc\xd0\xb5\xd1\x82\xd0\xba\xd1\x83"' | |||||
254 | msgid "This tag has %(thread_count)s threads and %(post_count)s posts." |
|
258 | msgid "This tag has %(thread_count)s threads and %(post_count)s posts." | |
255 | msgstr "Π‘ ΡΡΠΎΠΉ ΠΌΠ΅ΡΠΊΠΎΠΉ Π΅ΡΡΡ %(thread_count)s ΡΠ΅ΠΌ ΠΈ %(post_count)s ΡΠΎΠΎΠ±ΡΠ΅Π½ΠΈΠΉ." |
|
259 | msgstr "Π‘ ΡΡΠΎΠΉ ΠΌΠ΅ΡΠΊΠΎΠΉ Π΅ΡΡΡ %(thread_count)s ΡΠ΅ΠΌ ΠΈ %(post_count)s ΡΠΎΠΎΠ±ΡΠ΅Π½ΠΈΠΉ." | |
256 |
|
260 | |||
257 |
#: templates/boards/posting_general.html: |
|
261 | #: templates/boards/posting_general.html:99 | |
258 | #, python-format |
|
262 | #, python-format | |
259 | msgid "Skipped %(count)s replies. Open thread to see all replies." |
|
263 | msgid "Skipped %(count)s replies. Open thread to see all replies." | |
260 | msgstr "ΠΡΠΎΠΏΡΡΠ΅Π½ΠΎ %(count)s ΠΎΡΠ²Π΅ΡΠΎΠ². ΠΡΠΊΡΠΎΠΉΡΠ΅ ΡΡΠ΅Π΄, ΡΡΠΎΠ±Ρ ΡΠ²ΠΈΠ΄Π΅ΡΡ Π²ΡΠ΅ ΠΎΡΠ²Π΅ΡΡ." |
|
264 | msgstr "ΠΡΠΎΠΏΡΡΠ΅Π½ΠΎ %(count)s ΠΎΡΠ²Π΅ΡΠΎΠ². ΠΡΠΊΡΠΎΠΉΡΠ΅ ΡΡΠ΅Π΄, ΡΡΠΎΠ±Ρ ΡΠ²ΠΈΠ΄Π΅ΡΡ Π²ΡΠ΅ ΠΎΡΠ²Π΅ΡΡ." | |
261 |
|
265 | |||
262 |
#: templates/boards/posting_general.html:13 |
|
266 | #: templates/boards/posting_general.html:130 | |
263 | msgid "No threads exist. Create the first one!" |
|
267 | msgid "No threads exist. Create the first one!" | |
264 | msgstr "ΠΠ΅Ρ ΡΠ΅ΠΌ. Π‘ΠΎΠ·Π΄Π°ΠΉΡΠ΅ ΠΏΠ΅ΡΠ²ΡΡ!" |
|
268 | msgstr "ΠΠ΅Ρ ΡΠ΅ΠΌ. Π‘ΠΎΠ·Π΄Π°ΠΉΡΠ΅ ΠΏΠ΅ΡΠ²ΡΡ!" | |
265 |
|
269 | |||
266 |
#: templates/boards/posting_general.html:13 |
|
270 | #: templates/boards/posting_general.html:136 | |
267 | msgid "Create new thread" |
|
271 | msgid "Create new thread" | |
268 | msgstr "Π‘ΠΎΠ·Π΄Π°ΡΡ Π½ΠΎΠ²ΡΡ ΡΠ΅ΠΌΡ" |
|
272 | msgstr "Π‘ΠΎΠ·Π΄Π°ΡΡ Π½ΠΎΠ²ΡΡ ΡΠ΅ΠΌΡ" | |
269 |
|
273 | |||
270 |
#: templates/boards/posting_general.html:14 |
|
274 | #: templates/boards/posting_general.html:141 templates/boards/preview.html:16 | |
271 | #: templates/boards/thread.html:54 |
|
275 | #: templates/boards/thread.html:54 | |
272 | msgid "Post" |
|
276 | msgid "Post" | |
273 | msgstr "ΠΡΠΏΡΠ°Π²ΠΈΡΡ" |
|
277 | msgstr "ΠΡΠΏΡΠ°Π²ΠΈΡΡ" | |
274 |
|
278 | |||
275 |
#: templates/boards/posting_general.html:14 |
|
279 | #: templates/boards/posting_general.html:146 | |
276 | msgid "Tags must be delimited by spaces. Text or image is required." |
|
280 | msgid "Tags must be delimited by spaces. Text or image is required." | |
277 | msgstr "" |
|
281 | msgstr "" | |
278 | "ΠΠ΅ΡΠΊΠΈ Π΄ΠΎΠ»ΠΆΠ½Ρ Π±ΡΡΡ ΡΠ°Π·Π΄Π΅Π»Π΅Π½Ρ ΠΏΡΠΎΠ±Π΅Π»Π°ΠΌΠΈ. Π’Π΅ΠΊΡΡ ΠΈΠ»ΠΈ ΠΈΠ·ΠΎΠ±ΡΠ°ΠΆΠ΅Π½ΠΈΠ΅ ΠΎΠ±ΡΠ·Π°ΡΠ΅Π»ΡΠ½Ρ." |
|
282 | "ΠΠ΅ΡΠΊΠΈ Π΄ΠΎΠ»ΠΆΠ½Ρ Π±ΡΡΡ ΡΠ°Π·Π΄Π΅Π»Π΅Π½Ρ ΠΏΡΠΎΠ±Π΅Π»Π°ΠΌΠΈ. Π’Π΅ΠΊΡΡ ΠΈΠ»ΠΈ ΠΈΠ·ΠΎΠ±ΡΠ°ΠΆΠ΅Π½ΠΈΠ΅ ΠΎΠ±ΡΠ·Π°ΡΠ΅Π»ΡΠ½Ρ." | |
279 |
|
283 | |||
280 |
#: templates/boards/posting_general.html:1 |
|
284 | #: templates/boards/posting_general.html:149 templates/boards/thread.html:59 | |
281 | msgid "Text syntax" |
|
285 | msgid "Text syntax" | |
282 | msgstr "Π‘ΠΈΠ½ΡΠ°ΠΊΡΠΈΡ ΡΠ΅ΠΊΡΡΠ°" |
|
286 | msgstr "Π‘ΠΈΠ½ΡΠ°ΠΊΡΠΈΡ ΡΠ΅ΠΊΡΡΠ°" | |
283 |
|
287 | |||
284 |
#: templates/boards/posting_general.html:16 |
|
288 | #: templates/boards/posting_general.html:161 | |
285 | msgid "Pages:" |
|
289 | msgid "Pages:" | |
286 | msgstr "Π‘ΡΡΠ°Π½ΠΈΡΡ: " |
|
290 | msgstr "Π‘ΡΡΠ°Π½ΠΈΡΡ: " | |
287 |
|
291 |
@@ -89,8 +89,7 b'' | |||||
89 | {% for thread in threads %} |
|
89 | {% for thread in threads %} | |
90 | {% cache 600 thread_short thread.id thread.last_edit_time moderator LANGUAGE_CODE %} |
|
90 | {% cache 600 thread_short thread.id thread.last_edit_time moderator LANGUAGE_CODE %} | |
91 | <div class="thread"> |
|
91 | <div class="thread"> | |
92 | {% with can_bump=thread.can_bump %} |
|
92 | {% post_view thread.get_opening_post moderator is_opening=True thread=thread truncated=True need_open_link=True %} | |
93 | {% post_view thread.get_opening_post moderator is_opening=True thread=thread can_bump=can_bump truncated=True need_open_link=True %} |
|
|||
94 | {% if not thread.archived %} |
|
93 | {% if not thread.archived %} | |
95 | {% with last_replies=thread.get_last_replies %} |
|
94 | {% with last_replies=thread.get_last_replies %} | |
96 | {% if last_replies %} |
|
95 | {% if last_replies %} | |
@@ -109,7 +108,6 b'' | |||||
109 | {% endif %} |
|
108 | {% endif %} | |
110 | {% endwith %} |
|
109 | {% endwith %} | |
111 | {% endif %} |
|
110 | {% endif %} | |
112 | {% endwith %} |
|
|||
113 | </div> |
|
111 | </div> | |
114 | {% endcache %} |
|
112 | {% endcache %} | |
115 | {% endfor %} |
|
113 | {% endfor %} |
@@ -11,11 +11,13 b" FORM_USERNAME = 'username'" | |||||
11 |
|
11 | |||
12 | CONTEXT_HIDDEN_TAGS = 'hidden_tags' |
|
12 | CONTEXT_HIDDEN_TAGS = 'hidden_tags' | |
13 |
|
13 | |||
|
14 | TEMPLATE = 'boards/settings.html' | |||
|
15 | ||||
14 |
|
16 | |||
15 | class SettingsView(BaseBoardView): |
|
17 | class SettingsView(BaseBoardView): | |
16 |
|
18 | |||
17 | def get(self, request): |
|
19 | def get(self, request): | |
18 |
params = |
|
20 | params = dict() | |
19 | settings_manager = get_settings_manager(request) |
|
21 | settings_manager = get_settings_manager(request) | |
20 |
|
22 | |||
21 | selected_theme = settings_manager.get_theme() |
|
23 | selected_theme = settings_manager.get_theme() | |
@@ -29,8 +31,7 b' class SettingsView(BaseBoardView):' | |||||
29 | params[CONTEXT_FORM] = form |
|
31 | params[CONTEXT_FORM] = form | |
30 | params[CONTEXT_HIDDEN_TAGS] = settings_manager.get_hidden_tags() |
|
32 | params[CONTEXT_HIDDEN_TAGS] = settings_manager.get_hidden_tags() | |
31 |
|
33 | |||
32 | # TODO Use dict here |
|
34 | return render(request, TEMPLATE, params) | |
33 | return render(request, 'boards/settings.html', params) |
|
|||
34 |
|
35 | |||
35 | def post(self, request): |
|
36 | def post(self, request): | |
36 | settings_manager = get_settings_manager(request) |
|
37 | settings_manager = get_settings_manager(request) | |
@@ -46,5 +47,13 b' class SettingsView(BaseBoardView):' | |||||
46 |
|
47 | |||
47 | settings_manager.set_setting(SETTING_USERNAME, username) |
|
48 | settings_manager.set_setting(SETTING_USERNAME, username) | |
48 | settings_manager.set_setting(SETTING_LAST_NOTIFICATION_ID, None) |
|
49 | settings_manager.set_setting(SETTING_LAST_NOTIFICATION_ID, None) | |
|
50 | ||||
|
51 | return redirect('settings') | |||
|
52 | else: | |||
|
53 | params = dict() | |||
49 |
|
54 | |||
50 | return redirect('settings') |
|
55 | params[CONTEXT_FORM] = form | |
|
56 | params[CONTEXT_HIDDEN_TAGS] = settings_manager.get_hidden_tags() | |||
|
57 | ||||
|
58 | return render(request, TEMPLATE, params) | |||
|
59 |
General Comments 0
You need to be logged in to leave comments.
Login now