Show More
@@ -0,0 +1,27 b'' | |||||
|
1 | class Tripcode: | |||
|
2 | def __init__(self, code_str): | |||
|
3 | self.tripcode = code_str | |||
|
4 | ||||
|
5 | def get_color(self): | |||
|
6 | return self.tripcode[:6] | |||
|
7 | ||||
|
8 | def get_background(self): | |||
|
9 | code = self.get_color() | |||
|
10 | result = '' | |||
|
11 | ||||
|
12 | for i in range(0, len(code), 2): | |||
|
13 | p = code[i:i+2] | |||
|
14 | background = hex(255 - int(p, 16))[2:] | |||
|
15 | if len(background) < 2: | |||
|
16 | background = '0' + background | |||
|
17 | result += background | |||
|
18 | ||||
|
19 | return result | |||
|
20 | ||||
|
21 | def get_short_text(self): | |||
|
22 | return self.tripcode[:8] | |||
|
23 | ||||
|
24 | def get_view(self): | |||
|
25 | return '<span style="color: #{}; background: #{}">{}</span>'\ | |||
|
26 | .format(self.get_color(), self.get_background(), | |||
|
27 | self.get_short_text()) No newline at end of file |
@@ -1,3 +1,4 b'' | |||||
|
1 | import uuid | |||
1 | from django.shortcuts import get_object_or_404 |
|
2 | from django.shortcuts import get_object_or_404 | |
2 | from boards.models import Tag |
|
3 | from boards.models import Tag | |
3 |
|
4 | |||
@@ -15,6 +16,7 b" SETTING_PERMISSIONS = 'permissions'" | |||||
15 | SETTING_USERNAME = 'username' |
|
16 | SETTING_USERNAME = 'username' | |
16 | SETTING_LAST_NOTIFICATION_ID = 'last_notification' |
|
17 | SETTING_LAST_NOTIFICATION_ID = 'last_notification' | |
17 | SETTING_IMAGE_VIEWER = 'image_viewer' |
|
18 | SETTING_IMAGE_VIEWER = 'image_viewer' | |
|
19 | SETTING_TRIPCODE = 'tripcode' | |||
18 |
|
20 | |||
19 | DEFAULT_THEME = 'md' |
|
21 | DEFAULT_THEME = 'md' | |
20 |
|
22 | |||
@@ -116,6 +118,12 b' class SettingsManager:' | |||||
116 | tags.remove(tag.name) |
|
118 | tags.remove(tag.name) | |
117 | self.set_setting(SETTING_HIDDEN_TAGS, tags) |
|
119 | self.set_setting(SETTING_HIDDEN_TAGS, tags) | |
118 |
|
120 | |||
|
121 | def get_tripcode(self): | |||
|
122 | return self.get_setting(SETTING_TRIPCODE, str(uuid.uuid4())) | |||
|
123 | ||||
|
124 | def reset_tripcode(self): | |||
|
125 | self.set_setting(SETTING_TRIPCODE, str(uuid.uuid4())) | |||
|
126 | ||||
119 |
|
127 | |||
120 | class SessionSettingsManager(SettingsManager): |
|
128 | class SessionSettingsManager(SettingsManager): | |
121 | """ |
|
129 | """ | |
@@ -130,6 +138,7 b' class SessionSettingsManager(SettingsMan' | |||||
130 | if setting in self.session: |
|
138 | if setting in self.session: | |
131 | return self.session[setting] |
|
139 | return self.session[setting] | |
132 | else: |
|
140 | else: | |
|
141 | self.set_setting(setting, default) | |||
133 | return default |
|
142 | return default | |
134 |
|
143 | |||
135 | def set_setting(self, setting, value): |
|
144 | def set_setting(self, setting, value): |
@@ -1,8 +1,7 b'' | |||||
1 | import hashlib |
|
|||
2 |
|
|
1 | import re | |
3 | import time |
|
2 | import time | |
|
3 | ||||
4 | import pytz |
|
4 | import pytz | |
5 |
|
||||
6 | from django import forms |
|
5 | from django import forms | |
7 | from django.core.files.uploadedfile import SimpleUploadedFile |
|
6 | from django.core.files.uploadedfile import SimpleUploadedFile | |
8 | from django.core.exceptions import ObjectDoesNotExist |
|
7 | from django.core.exceptions import ObjectDoesNotExist | |
@@ -10,6 +9,7 b' from django.forms.util import ErrorList' | |||||
10 | from django.utils.translation import ugettext_lazy as _ |
|
9 | from django.utils.translation import ugettext_lazy as _ | |
11 | import requests |
|
10 | import requests | |
12 |
|
11 | |||
|
12 | from boards.abstracts.settingsmanager import SessionSettingsManager | |||
13 | from boards.mdx_neboard import formatters |
|
13 | from boards.mdx_neboard import formatters | |
14 | from boards.models.post import TITLE_MAX_LENGTH |
|
14 | from boards.models.post import TITLE_MAX_LENGTH | |
15 | from boards.models import Tag, Post |
|
15 | from boards.models import Tag, Post | |
@@ -241,7 +241,7 b' class PostForm(NeboardForm):' | |||||
241 |
|
241 | |||
242 | def get_tripcode(self): |
|
242 | def get_tripcode(self): | |
243 | if self.cleaned_data['tripcode']: |
|
243 | if self.cleaned_data['tripcode']: | |
244 | return hashlib.sha1(self.session.session_key.encode()).hexdigest() |
|
244 | return SessionSettingsManager(self.session).get_tripcode() | |
245 |
|
245 | |||
246 | def _clean_text_file(self): |
|
246 | def _clean_text_file(self): | |
247 | text = self.cleaned_data.get('text') |
|
247 | text = self.cleaned_data.get('text') | |
@@ -366,7 +366,7 b' class ThreadForm(PostForm):' | |||||
366 | class SettingsForm(NeboardForm): |
|
366 | class SettingsForm(NeboardForm): | |
367 |
|
367 | |||
368 | theme = forms.ChoiceField(choices=settings.THEMES, label=_('Theme')) |
|
368 | theme = forms.ChoiceField(choices=settings.THEMES, label=_('Theme')) | |
369 |
image_viewer = forms.ChoiceField(choices=settings.IMAGE_VIEWERS, label=_(' |
|
369 | image_viewer = forms.ChoiceField(choices=settings.IMAGE_VIEWERS, label=_('Image view mode')) | |
370 | username = forms.CharField(label=_('User name'), required=False) |
|
370 | username = forms.CharField(label=_('User name'), required=False) | |
371 | timezone = forms.ChoiceField(choices=get_timezones(), label=_('Time zone')) |
|
371 | timezone = forms.ChoiceField(choices=get_timezones(), label=_('Time zone')) | |
372 |
|
372 |
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-08-2 |
|
10 | "POT-Creation-Date: 2015-08-22 15:07+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" | |
@@ -38,111 +38,114 b' msgstr "\xd1\x80\xd0\xb0\xd0\xb7\xd1\x80\xd0\xb0\xd0\xb1\xd0\xbe\xd1\x82\xd1\x87\xd0\xb8\xd0\xba javascript"' | |||||
38 | msgid "designer" |
|
38 | msgid "designer" | |
39 | msgstr "Π΄ΠΈΠ·Π°ΠΉΠ½Π΅Ρ" |
|
39 | msgstr "Π΄ΠΈΠ·Π°ΠΉΠ½Π΅Ρ" | |
40 |
|
40 | |||
41 |
#: forms.py:3 |
|
41 | #: forms.py:31 | |
42 | msgid "Type message here. Use formatting panel for more advanced usage." |
|
42 | msgid "Type message here. Use formatting panel for more advanced usage." | |
43 | msgstr "" |
|
43 | msgstr "" | |
44 | "ΠΠ²ΠΎΠ΄ΠΈΡΠ΅ ΡΠΎΠΎΠ±ΡΠ΅Π½ΠΈΠ΅ ΡΡΠ΄Π°. ΠΡΠΏΠΎΠ»ΡΠ·ΡΠΉΡΠ΅ ΠΏΠ°Π½Π΅Π»Ρ Π΄Π»Ρ Π±ΠΎΠ»Π΅Π΅ ΡΠ»ΠΎΠΆΠ½ΠΎΠ³ΠΎ ΡΠΎΡΠΌΠ°ΡΠΈΡΠΎΠ²Π°Π½ΠΈΡ." |
|
44 | "ΠΠ²ΠΎΠ΄ΠΈΡΠ΅ ΡΠΎΠΎΠ±ΡΠ΅Π½ΠΈΠ΅ ΡΡΠ΄Π°. ΠΡΠΏΠΎΠ»ΡΠ·ΡΠΉΡΠ΅ ΠΏΠ°Π½Π΅Π»Ρ Π΄Π»Ρ Π±ΠΎΠ»Π΅Π΅ ΡΠ»ΠΎΠΆΠ½ΠΎΠ³ΠΎ ΡΠΎΡΠΌΠ°ΡΠΈΡΠΎΠ²Π°Π½ΠΈΡ." | |
45 |
|
45 | |||
46 |
#: forms.py:3 |
|
46 | #: forms.py:32 | |
47 | msgid "music images i_dont_like_tags" |
|
47 | msgid "music images i_dont_like_tags" | |
48 | msgstr "ΠΌΡΠ·ΡΠΊΠ° ΠΊΠ°ΡΡΠΈΠ½ΠΊΠΈ ΡΠ΅Π³ΠΈ_Π½Π΅_Π½ΡΠΆΠ½Ρ" |
|
48 | msgstr "ΠΌΡΠ·ΡΠΊΠ° ΠΊΠ°ΡΡΠΈΠ½ΠΊΠΈ ΡΠ΅Π³ΠΈ_Π½Π΅_Π½ΡΠΆΠ½Ρ" | |
49 |
|
49 | |||
50 |
#: forms.py:3 |
|
50 | #: forms.py:34 | |
51 | msgid "Title" |
|
51 | msgid "Title" | |
52 | msgstr "ΠΠ°Π³ΠΎΠ»ΠΎΠ²ΠΎΠΊ" |
|
52 | msgstr "ΠΠ°Π³ΠΎΠ»ΠΎΠ²ΠΎΠΊ" | |
53 |
|
53 | |||
54 |
#: forms.py:3 |
|
54 | #: forms.py:35 | |
55 | msgid "Text" |
|
55 | msgid "Text" | |
56 | msgstr "Π’Π΅ΠΊΡΡ" |
|
56 | msgstr "Π’Π΅ΠΊΡΡ" | |
57 |
|
57 | |||
58 |
#: forms.py:3 |
|
58 | #: forms.py:36 | |
59 | msgid "Tag" |
|
59 | msgid "Tag" | |
60 | msgstr "ΠΠ΅ΡΠΊΠ°" |
|
60 | msgstr "ΠΠ΅ΡΠΊΠ°" | |
61 |
|
61 | |||
62 |
#: forms.py:3 |
|
62 | #: forms.py:37 templates/boards/base.html:40 templates/search/search.html:7 | |
63 | msgid "Search" |
|
63 | msgid "Search" | |
64 | msgstr "ΠΠΎΠΈΡΠΊ" |
|
64 | msgstr "ΠΠΎΠΈΡΠΊ" | |
65 |
|
65 | |||
66 |
#: forms.py:3 |
|
66 | #: forms.py:39 | |
67 | #, python-format |
|
67 | #, python-format | |
68 | msgid "Please wait %s seconds before sending message" |
|
68 | msgid "Please wait %s seconds before sending message" | |
69 | msgstr "ΠΠΎΠΆΠ°Π»ΡΠΉΡΡΠ° ΠΏΠΎΠ΄ΠΎΠΆΠ΄ΠΈΡΠ΅ %s ΡΠ΅ΠΊΡΠ½Π΄ ΠΏΠ΅ΡΠ΅Π΄ ΠΎΡΠΏΡΠ°Π²ΠΊΠΎΠΉ ΡΠΎΠΎΠ±ΡΠ΅Π½ΠΈΡ" |
|
69 | msgstr "ΠΠΎΠΆΠ°Π»ΡΠΉΡΡΠ° ΠΏΠΎΠ΄ΠΎΠΆΠ΄ΠΈΡΠ΅ %s ΡΠ΅ΠΊΡΠ½Π΄ ΠΏΠ΅ΡΠ΅Π΄ ΠΎΡΠΏΡΠ°Π²ΠΊΠΎΠΉ ΡΠΎΠΎΠ±ΡΠ΅Π½ΠΈΡ" | |
70 |
|
70 | |||
71 |
#: forms.py:1 |
|
71 | #: forms.py:140 | |
72 | msgid "File" |
|
72 | msgid "File" | |
73 | msgstr "Π€Π°ΠΉΠ»" |
|
73 | msgstr "Π€Π°ΠΉΠ»" | |
74 |
|
74 | |||
75 |
#: forms.py:14 |
|
75 | #: forms.py:143 | |
76 | msgid "File URL" |
|
76 | msgid "File URL" | |
77 | msgstr "URL ΡΠ°ΠΉΠ»Π°" |
|
77 | msgstr "URL ΡΠ°ΠΉΠ»Π°" | |
78 |
|
78 | |||
79 |
#: forms.py:14 |
|
79 | #: forms.py:149 | |
80 | msgid "e-mail" |
|
80 | msgid "e-mail" | |
81 | msgstr "" |
|
81 | msgstr "" | |
82 |
|
82 | |||
83 |
#: forms.py:15 |
|
83 | #: forms.py:152 | |
84 | msgid "Additional threads" |
|
84 | msgid "Additional threads" | |
85 | msgstr "ΠΠΎΠΏΠΎΠ»Π½ΠΈΡΠ΅Π»ΡΠ½ΡΠ΅ ΡΠ΅ΠΌΡ" |
|
85 | msgstr "ΠΠΎΠΏΠΎΠ»Π½ΠΈΡΠ΅Π»ΡΠ½ΡΠ΅ ΡΠ΅ΠΌΡ" | |
86 |
|
86 | |||
87 |
#: forms.py:1 |
|
87 | #: forms.py:155 | |
|
88 | msgid "Tripcode" | |||
|
89 | msgstr "Π’ΡΠΈΠΏΠΊΠΎΠ΄" | |||
|
90 | ||||
|
91 | #: forms.py:164 | |||
88 | #, python-format |
|
92 | #, python-format | |
89 | msgid "Title must have less than %s characters" |
|
93 | msgid "Title must have less than %s characters" | |
90 | msgstr "ΠΠ°Π³ΠΎΠ»ΠΎΠ²ΠΎΠΊ Π΄ΠΎΠ»ΠΆΠ΅Π½ ΠΈΠΌΠ΅ΡΡ ΠΌΠ΅Π½ΡΡΠ΅ %s ΡΠΈΠΌΠ²ΠΎΠ»ΠΎΠ²" |
|
94 | msgstr "ΠΠ°Π³ΠΎΠ»ΠΎΠ²ΠΎΠΊ Π΄ΠΎΠ»ΠΆΠ΅Π½ ΠΈΠΌΠ΅ΡΡ ΠΌΠ΅Π½ΡΡΠ΅ %s ΡΠΈΠΌΠ²ΠΎΠ»ΠΎΠ²" | |
91 |
|
95 | |||
92 |
#: forms.py:17 |
|
96 | #: forms.py:174 | |
93 | #, python-format |
|
97 | #, python-format | |
94 | msgid "Text must have less than %s characters" |
|
98 | msgid "Text must have less than %s characters" | |
95 | msgstr "Π’Π΅ΠΊΡΡ Π΄ΠΎΠ»ΠΆΠ΅Π½ Π±ΡΡΡ ΠΊΠΎΡΠΎΡΠ΅ %s ΡΠΈΠΌΠ²ΠΎΠ»ΠΎΠ²" |
|
99 | msgstr "Π’Π΅ΠΊΡΡ Π΄ΠΎΠ»ΠΆΠ΅Π½ Π±ΡΡΡ ΠΊΠΎΡΠΎΡΠ΅ %s ΡΠΈΠΌΠ²ΠΎΠ»ΠΎΠ²" | |
96 |
|
100 | |||
97 |
#: forms.py:19 |
|
101 | #: forms.py:194 | |
98 | msgid "Invalid URL" |
|
102 | msgid "Invalid URL" | |
99 | msgstr "ΠΠ΅Π²Π΅ΡΠ½ΡΠΉ URL" |
|
103 | msgstr "ΠΠ΅Π²Π΅ΡΠ½ΡΠΉ URL" | |
100 |
|
104 | |||
101 |
#: forms.py:21 |
|
105 | #: forms.py:215 | |
102 | msgid "Invalid additional thread list" |
|
106 | msgid "Invalid additional thread list" | |
103 | msgstr "ΠΠ΅Π²Π΅ΡΠ½ΡΠΉ ΡΠΏΠΈΡΠΎΠΊ Π΄ΠΎΠΏΠΎΠ»Π½ΠΈΡΠ΅Π»ΡΠ½ΡΡ ΡΠ΅ΠΌ" |
|
107 | msgstr "ΠΠ΅Π²Π΅ΡΠ½ΡΠΉ ΡΠΏΠΈΡΠΎΠΊ Π΄ΠΎΠΏΠΎΠ»Π½ΠΈΡΠ΅Π»ΡΠ½ΡΡ ΡΠ΅ΠΌ" | |
104 |
|
108 | |||
105 |
#: forms.py:2 |
|
109 | #: forms.py:251 | |
106 | msgid "Either text or file must be entered." |
|
110 | msgid "Either text or file must be entered." | |
107 | msgstr "Π’Π΅ΠΊΡΡ ΠΈΠ»ΠΈ ΡΠ°ΠΉΠ» Π΄ΠΎΠ»ΠΆΠ½Ρ Π±ΡΡΡ Π²Π²Π΅Π΄Π΅Π½Ρ." |
|
111 | msgstr "Π’Π΅ΠΊΡΡ ΠΈΠ»ΠΈ ΡΠ°ΠΉΠ» Π΄ΠΎΠ»ΠΆΠ½Ρ Π±ΡΡΡ Π²Π²Π΅Π΄Π΅Π½Ρ." | |
108 |
|
112 | |||
109 |
#: forms.py:28 |
|
113 | #: forms.py:289 | |
110 | #, python-format |
|
114 | #, python-format | |
111 | msgid "File must be less than %s bytes" |
|
115 | msgid "File must be less than %s bytes" | |
112 | msgstr "Π€Π°ΠΉΠ» Π΄ΠΎΠ»ΠΆΠ΅Π½ Π±ΡΡΡ ΠΌΠ΅Π½Π΅Π΅ %s Π±Π°ΠΉΡ" |
|
116 | msgstr "Π€Π°ΠΉΠ» Π΄ΠΎΠ»ΠΆΠ΅Π½ Π±ΡΡΡ ΠΌΠ΅Π½Π΅Π΅ %s Π±Π°ΠΉΡ" | |
113 |
|
117 | |||
114 |
#: forms.py:3 |
|
118 | #: forms.py:335 templates/boards/all_threads.html:154 | |
115 | #: templates/boards/rss/post.html:10 templates/boards/tags.html:6 |
|
119 | #: templates/boards/rss/post.html:10 templates/boards/tags.html:6 | |
116 | msgid "Tags" |
|
120 | msgid "Tags" | |
117 | msgstr "ΠΠ΅ΡΠΊΠΈ" |
|
121 | msgstr "ΠΠ΅ΡΠΊΠΈ" | |
118 |
|
122 | |||
119 |
#: forms.py:3 |
|
123 | #: forms.py:342 | |
120 | msgid "Inappropriate characters in tags." |
|
124 | msgid "Inappropriate characters in tags." | |
121 | msgstr "ΠΠ΅Π΄ΠΎΠΏΡΡΡΠΈΠΌΡΠ΅ ΡΠΈΠΌΠ²ΠΎΠ»Ρ Π² ΠΌΠ΅ΡΠΊΠ°Ρ ." |
|
125 | msgstr "ΠΠ΅Π΄ΠΎΠΏΡΡΡΠΈΠΌΡΠ΅ ΡΠΈΠΌΠ²ΠΎΠ»Ρ Π² ΠΌΠ΅ΡΠΊΠ°Ρ ." | |
122 |
|
126 | |||
123 |
#: forms.py:35 |
|
127 | #: forms.py:356 | |
124 | msgid "Need at least one section." |
|
128 | msgid "Need at least one section." | |
125 | msgstr "ΠΡΠΆΠ΅Π½ Ρ ΠΎΡΡ Π±Ρ ΠΎΠ΄ΠΈΠ½ ΡΠ°Π·Π΄Π΅Π»." |
|
129 | msgstr "ΠΡΠΆΠ΅Π½ Ρ ΠΎΡΡ Π±Ρ ΠΎΠ΄ΠΈΠ½ ΡΠ°Π·Π΄Π΅Π»." | |
126 |
|
130 | |||
127 |
#: forms.py:36 |
|
131 | #: forms.py:368 | |
128 | msgid "Theme" |
|
132 | msgid "Theme" | |
129 | msgstr "Π’Π΅ΠΌΠ°" |
|
133 | msgstr "Π’Π΅ΠΌΠ°" | |
130 |
|
134 | |||
131 |
#: forms.py:36 |
|
135 | #: forms.py:369 | |
132 | #, fuzzy |
|
|||
133 | #| msgid "Image view mode" |
|
136 | #| msgid "Image view mode" | |
134 |
msgid " |
|
137 | msgid "Image view mode" | |
135 | msgstr "Π Π΅ΠΆΠΈΠΌ ΠΏΡΠΎΡΠΌΠΎΡΡΠ° ΠΈΠ·ΠΎΠ±ΡΠ°ΠΆΠ΅Π½ΠΈΠΉ" |
|
138 | msgstr "Π Π΅ΠΆΠΈΠΌ ΠΏΡΠΎΡΠΌΠΎΡΡΠ° ΠΈΠ·ΠΎΠ±ΡΠ°ΠΆΠ΅Π½ΠΈΠΉ" | |
136 |
|
139 | |||
137 |
#: forms.py:3 |
|
140 | #: forms.py:370 | |
138 | msgid "User name" |
|
141 | msgid "User name" | |
139 | msgstr "ΠΠΌΡ ΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΠ΅Π»Ρ" |
|
142 | msgstr "ΠΠΌΡ ΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΠ΅Π»Ρ" | |
140 |
|
143 | |||
141 |
#: forms.py:3 |
|
144 | #: forms.py:371 | |
142 | msgid "Time zone" |
|
145 | msgid "Time zone" | |
143 | msgstr "Π§Π°ΡΠΎΠ²ΠΎΠΉ ΠΏΠΎΡΡ" |
|
146 | msgstr "Π§Π°ΡΠΎΠ²ΠΎΠΉ ΠΏΠΎΡΡ" | |
144 |
|
147 | |||
145 |
#: forms.py:37 |
|
148 | #: forms.py:377 | |
146 | msgid "Inappropriate characters." |
|
149 | msgid "Inappropriate characters." | |
147 | msgstr "ΠΠ΅Π΄ΠΎΠΏΡΡΡΠΈΠΌΡΠ΅ ΡΠΈΠΌΠ²ΠΎΠ»Ρ." |
|
150 | msgstr "ΠΠ΅Π΄ΠΎΠΏΡΡΡΠΈΠΌΡΠ΅ ΡΠΈΠΌΠ²ΠΎΠ»Ρ." | |
148 |
|
151 | |||
@@ -300,35 +303,35 b' msgstr "\xd0\x92\xd0\xb2\xd0\xb5\xd1\x80\xd1\x85"' | |||||
300 | msgid "No posts exist. Create the first one!" |
|
303 | msgid "No posts exist. Create the first one!" | |
301 | msgstr "ΠΠ΅Ρ ΡΠΎΠΎΠ±ΡΠ΅Π½ΠΈΠΉ. Π‘ΠΎΠ·Π΄Π°ΠΉΡΠ΅ ΠΏΠ΅ΡΠ²ΠΎΠ΅!" |
|
304 | msgstr "ΠΠ΅Ρ ΡΠΎΠΎΠ±ΡΠ΅Π½ΠΈΠΉ. Π‘ΠΎΠ·Π΄Π°ΠΉΡΠ΅ ΠΏΠ΅ΡΠ²ΠΎΠ΅!" | |
302 |
|
305 | |||
303 |
#: templates/boards/post.html: |
|
306 | #: templates/boards/post.html:30 | |
304 | msgid "Open" |
|
307 | msgid "Open" | |
305 | msgstr "ΠΡΠΊΡΡΡΡ" |
|
308 | msgstr "ΠΡΠΊΡΡΡΡ" | |
306 |
|
309 | |||
307 |
#: templates/boards/post.html:2 |
|
310 | #: templates/boards/post.html:32 templates/boards/post.html.py:43 | |
308 | msgid "Reply" |
|
311 | msgid "Reply" | |
309 | msgstr "ΠΡΠ²Π΅ΡΠΈΡΡ" |
|
312 | msgstr "ΠΡΠ²Π΅ΡΠΈΡΡ" | |
310 |
|
313 | |||
311 |
#: templates/boards/post.html:3 |
|
314 | #: templates/boards/post.html:38 | |
312 | msgid " in " |
|
315 | msgid " in " | |
313 | msgstr " Π² " |
|
316 | msgstr " Π² " | |
314 |
|
317 | |||
315 |
#: templates/boards/post.html:4 |
|
318 | #: templates/boards/post.html:48 | |
316 | msgid "Edit" |
|
319 | msgid "Edit" | |
317 | msgstr "ΠΠ·ΠΌΠ΅Π½ΠΈΡΡ" |
|
320 | msgstr "ΠΠ·ΠΌΠ΅Π½ΠΈΡΡ" | |
318 |
|
321 | |||
319 |
#: templates/boards/post.html: |
|
322 | #: templates/boards/post.html:50 | |
320 | msgid "Edit thread" |
|
323 | msgid "Edit thread" | |
321 | msgstr "ΠΠ·ΠΌΠ΅Π½ΠΈΡΡ ΡΠ΅ΠΌΡ" |
|
324 | msgstr "ΠΠ·ΠΌΠ΅Π½ΠΈΡΡ ΡΠ΅ΠΌΡ" | |
322 |
|
325 | |||
323 |
#: templates/boards/post.html:9 |
|
326 | #: templates/boards/post.html:97 | |
324 | msgid "Replies" |
|
327 | msgid "Replies" | |
325 | msgstr "ΠΡΠ²Π΅ΡΡ" |
|
328 | msgstr "ΠΡΠ²Π΅ΡΡ" | |
326 |
|
329 | |||
327 |
#: templates/boards/post.html:10 |
|
330 | #: templates/boards/post.html:109 templates/boards/thread.html:34 | |
328 | msgid "messages" |
|
331 | msgid "messages" | |
329 | msgstr "ΡΠΎΠΎΠ±ΡΠ΅Π½ΠΈΠΉ" |
|
332 | msgstr "ΡΠΎΠΎΠ±ΡΠ΅Π½ΠΈΠΉ" | |
330 |
|
333 | |||
331 |
#: templates/boards/post.html:10 |
|
334 | #: templates/boards/post.html:110 templates/boards/thread.html:35 | |
332 | msgid "images" |
|
335 | msgid "images" | |
333 | msgstr "ΠΈΠ·ΠΎΠ±ΡΠ°ΠΆΠ΅Π½ΠΈΠΉ" |
|
336 | msgstr "ΠΈΠ·ΠΎΠ±ΡΠ°ΠΆΠ΅Π½ΠΈΠΉ" | |
334 |
|
337 | |||
@@ -336,18 +339,26 b' msgstr "\xd0\xb8\xd0\xb7\xd0\xbe\xd0\xb1\xd1\x80\xd0\xb0\xd0\xb6\xd0\xb5\xd0\xbd\xd0\xb8\xd0\xb9"' | |||||
336 | msgid "Post image" |
|
339 | msgid "Post image" | |
337 | msgstr "ΠΠ·ΠΎΠ±ΡΠ°ΠΆΠ΅Π½ΠΈΠ΅ ΡΠΎΠΎΠ±ΡΠ΅Π½ΠΈΡ" |
|
340 | msgstr "ΠΠ·ΠΎΠ±ΡΠ°ΠΆΠ΅Π½ΠΈΠ΅ ΡΠΎΠΎΠ±ΡΠ΅Π½ΠΈΡ" | |
338 |
|
341 | |||
339 |
#: templates/boards/settings.html:1 |
|
342 | #: templates/boards/settings.html:15 | |
340 | msgid "You are moderator." |
|
343 | msgid "You are moderator." | |
341 | msgstr "ΠΡ ΠΌΠΎΠ΄Π΅ΡΠ°ΡΠΎΡ." |
|
344 | msgstr "ΠΡ ΠΌΠΎΠ΄Π΅ΡΠ°ΡΠΎΡ." | |
342 |
|
345 | |||
343 |
#: templates/boards/settings.html: |
|
346 | #: templates/boards/settings.html:19 | |
344 | msgid "Hidden tags:" |
|
347 | msgid "Hidden tags:" | |
345 | msgstr "Π‘ΠΊΡΡΡΡΠ΅ ΠΌΠ΅ΡΠΊΠΈ:" |
|
348 | msgstr "Π‘ΠΊΡΡΡΡΠ΅ ΠΌΠ΅ΡΠΊΠΈ:" | |
346 |
|
349 | |||
347 |
#: templates/boards/settings.html:2 |
|
350 | #: templates/boards/settings.html:27 | |
348 | msgid "No hidden tags." |
|
351 | msgid "No hidden tags." | |
349 | msgstr "ΠΠ΅Ρ ΡΠΊΡΡΡΡΡ ΠΌΠ΅ΡΠΎΠΊ." |
|
352 | msgstr "ΠΠ΅Ρ ΡΠΊΡΡΡΡΡ ΠΌΠ΅ΡΠΎΠΊ." | |
350 |
|
353 | |||
|
354 | #: templates/boards/settings.html:29 | |||
|
355 | msgid "Tripcode:" | |||
|
356 | msgstr "Π’ΡΠΈΠΏΠΊΠΎΠ΄:" | |||
|
357 | ||||
|
358 | #: templates/boards/settings.html:29 | |||
|
359 | msgid "reset" | |||
|
360 | msgstr "ΡΠ±ΡΠΎΡΠΈΡΡ" | |||
|
361 | ||||
351 | #: templates/boards/settings.html:37 |
|
362 | #: templates/boards/settings.html:37 | |
352 | msgid "Save" |
|
363 | msgid "Save" | |
353 | msgstr "Π‘ΠΎΡ ΡΠ°Π½ΠΈΡΡ" |
|
364 | msgstr "Π‘ΠΎΡ ΡΠ°Π½ΠΈΡΡ" | |
@@ -439,7 +450,6 b' msgid "Reply to thread"' | |||||
439 | msgstr "ΠΡΠ²Π΅ΡΠΈΡΡ Π² ΡΠ΅ΠΌΡ" |
|
450 | msgstr "ΠΡΠ²Π΅ΡΠΈΡΡ Π² ΡΠ΅ΠΌΡ" | |
440 |
|
451 | |||
441 | #: templates/boards/thread_normal.html:31 |
|
452 | #: templates/boards/thread_normal.html:31 | |
442 | #| msgid "messages" |
|
|||
443 | msgid "to message " |
|
453 | msgid "to message " | |
444 | msgstr "Π½Π° ΡΠΎΠΎΠ±ΡΠ΅Π½ΠΈΠ΅" |
|
454 | msgstr "Π½Π° ΡΠΎΠΎΠ±ΡΠ΅Π½ΠΈΠ΅" | |
445 |
|
455 |
@@ -12,6 +12,7 b' from django.template.loader import rende' | |||||
12 | from django.utils import timezone |
|
12 | from django.utils import timezone | |
13 |
|
13 | |||
14 | from boards import settings |
|
14 | from boards import settings | |
|
15 | from boards.abstracts.tripcode import Tripcode | |||
15 | from boards.mdx_neboard import Parser |
|
16 | from boards.mdx_neboard import Parser | |
16 | from boards.models import PostImage, Attachment |
|
17 | from boards.models import PostImage, Attachment | |
17 | from boards.models.base import Viewable |
|
18 | from boards.models.base import Viewable | |
@@ -440,21 +441,6 b' class Post(models.Model, Viewable):' | |||||
440 | thread.save(update_fields=['last_edit_time', 'bumpable']) |
|
441 | thread.save(update_fields=['last_edit_time', 'bumpable']) | |
441 | self.threads.add(opening_post.get_thread()) |
|
442 | self.threads.add(opening_post.get_thread()) | |
442 |
|
443 | |||
443 |
def get_tripcode |
|
444 | def get_tripcode(self): | |
444 |
|
|
445 | if self.tripcode: | |
445 |
|
446 | return Tripcode(self.tripcode) | ||
446 | def get_tripcode_background(self): |
|
|||
447 | code = self.get_tripcode_color() |
|
|||
448 | result = '' |
|
|||
449 |
|
||||
450 | for i in range(0, len(code), 2): |
|
|||
451 | p = code[i:i+2] |
|
|||
452 | background = hex(255 - int(p, 16))[2:] |
|
|||
453 | if len(background) < 2: |
|
|||
454 | background = '0' + background |
|
|||
455 | result += background |
|
|||
456 |
|
||||
457 | return result |
|
|||
458 |
|
||||
459 | def get_short_tripcode(self): |
|
|||
460 | return self.tripcode[:10] |
|
@@ -9,7 +9,9 b'' | |||||
9 | <span class="title">{{ post.title }}</span> |
|
9 | <span class="title">{{ post.title }}</span> | |
10 | <span class="pub_time"><time datetime="{{ post.pub_time|date:'c' }}">{{ post.pub_time }}</time></span> |
|
10 | <span class="pub_time"><time datetime="{{ post.pub_time|date:'c' }}">{{ post.pub_time }}</time></span> | |
11 | {% if post.tripcode %} |
|
11 | {% if post.tripcode %} | |
12 | <span style="color: #{{ post.get_tripcode_color }}; background: #{{ post.get_tripcode_background }}">{{ post.get_short_tripcode }}</span> |
|
12 | {% autoescape off %} | |
|
13 | {{ post.get_tripcode.get_view }} | |||
|
14 | {% endautoescape %} | |||
13 | {% endif %} |
|
15 | {% endif %} | |
14 | {% comment %} |
|
16 | {% comment %} | |
15 | Thread death time needs to be shown only if the thread is alredy archived |
|
17 | Thread death time needs to be shown only if the thread is alredy archived |
@@ -9,7 +9,6 b'' | |||||
9 | {% endblock %} |
|
9 | {% endblock %} | |
10 |
|
10 | |||
11 | {% block content %} |
|
11 | {% block content %} | |
12 |
|
||||
13 | <div class="post"> |
|
12 | <div class="post"> | |
14 | <p> |
|
13 | <p> | |
15 | {% if moderator %} |
|
14 | {% if moderator %} | |
@@ -27,6 +26,7 b'' | |||||
27 | {% else %} |
|
26 | {% else %} | |
28 | <p>{% trans 'No hidden tags.' %}</p> |
|
27 | <p>{% trans 'No hidden tags.' %}</p> | |
29 | {% endif %} |
|
28 | {% endif %} | |
|
29 | <p>{% trans "Tripcode:" %} {% autoescape off %}{{ tripcode.get_view }}{% endautoescape %} (<a href="?reset_tripcode">{% trans "reset" %}</a>)</p> | |||
30 | </div> |
|
30 | </div> | |
31 |
|
31 | |||
32 | <div class="post-form-w"> |
|
32 | <div class="post-form-w"> |
@@ -4,11 +4,13 b' from django.utils import timezone' | |||||
4 |
|
4 | |||
5 | from boards.abstracts.settingsmanager import get_settings_manager, \ |
|
5 | from boards.abstracts.settingsmanager import get_settings_manager, \ | |
6 | SETTING_USERNAME, SETTING_LAST_NOTIFICATION_ID, SETTING_IMAGE_VIEWER |
|
6 | SETTING_USERNAME, SETTING_LAST_NOTIFICATION_ID, SETTING_IMAGE_VIEWER | |
|
7 | from boards.abstracts.tripcode import Tripcode | |||
7 | from boards.middlewares import SESSION_TIMEZONE |
|
8 | from boards.middlewares import SESSION_TIMEZONE | |
8 | from boards.views.base import BaseBoardView, CONTEXT_FORM |
|
9 | from boards.views.base import BaseBoardView, CONTEXT_FORM | |
9 | from boards.forms import SettingsForm, PlainErrorList |
|
10 | from boards.forms import SettingsForm, PlainErrorList | |
10 | from boards import settings |
|
11 | from boards import settings | |
11 |
|
12 | |||
|
13 | PARAM_RESET_TRIPCODE = 'reset_tripcode' | |||
12 |
|
14 | |||
13 | FORM_THEME = 'theme' |
|
15 | FORM_THEME = 'theme' | |
14 | FORM_USERNAME = 'username' |
|
16 | FORM_USERNAME = 'username' | |
@@ -16,6 +18,7 b" FORM_TIMEZONE = 'timezone'" | |||||
16 | FORM_IMAGE_VIEWER = 'image_viewer' |
|
18 | FORM_IMAGE_VIEWER = 'image_viewer' | |
17 |
|
19 | |||
18 | CONTEXT_HIDDEN_TAGS = 'hidden_tags' |
|
20 | CONTEXT_HIDDEN_TAGS = 'hidden_tags' | |
|
21 | CONTEXT_TRIPCODE = 'tripcode' | |||
19 |
|
22 | |||
20 | TEMPLATE = 'boards/settings.html' |
|
23 | TEMPLATE = 'boards/settings.html' | |
21 |
|
24 | |||
@@ -26,6 +29,9 b' class SettingsView(BaseBoardView):' | |||||
26 | params = dict() |
|
29 | params = dict() | |
27 | settings_manager = get_settings_manager(request) |
|
30 | settings_manager = get_settings_manager(request) | |
28 |
|
31 | |||
|
32 | if PARAM_RESET_TRIPCODE in request.GET: | |||
|
33 | settings_manager.reset_tripcode() | |||
|
34 | ||||
29 | selected_theme = settings_manager.get_theme() |
|
35 | selected_theme = settings_manager.get_theme() | |
30 |
|
36 | |||
31 | form = SettingsForm( |
|
37 | form = SettingsForm( | |
@@ -42,6 +48,7 b' class SettingsView(BaseBoardView):' | |||||
42 |
|
48 | |||
43 | params[CONTEXT_FORM] = form |
|
49 | params[CONTEXT_FORM] = form | |
44 | params[CONTEXT_HIDDEN_TAGS] = settings_manager.get_hidden_tags() |
|
50 | params[CONTEXT_HIDDEN_TAGS] = settings_manager.get_hidden_tags() | |
|
51 | params[CONTEXT_TRIPCODE] = Tripcode(settings_manager.get_tripcode()) | |||
45 |
|
52 | |||
46 | return render(request, TEMPLATE, params) |
|
53 | return render(request, TEMPLATE, params) | |
47 |
|
54 |
General Comments 0
You need to be logged in to leave comments.
Login now