##// END OF EJS Templates
Show active threads count in the tag info
neko259 -
r1260:4ce9f0e7 default
parent child Browse files
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: 2015-08-09 22:38+0300\n"
10 "POT-Creation-Date: 2015-08-10 10:22+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"
@@ -121,7 +121,6 b' msgid "Inappropriate characters in tags.'
121 msgstr "Недопустимые символы в метках."
121 msgstr "Недопустимые символы в метках."
122
122
123 #: forms.py:359
123 #: forms.py:359
124 #| msgid "Need at least one of the tags: "
125 msgid "Need at least one section."
124 msgid "Need at least one section."
126 msgstr "Нужен хотя бы один раздел."
125 msgstr "Нужен хотя бы один раздел."
127
126
@@ -163,8 +162,11 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"'
163
162
164 #: templates/boards/all_threads.html:76
163 #: templates/boards/all_threads.html:76
165 #, python-format
164 #, python-format
166 msgid "This tag has %(thread_count)s threads and %(post_count)s posts."
165 #| msgid "This tag has %(thread_count)s threads and %(post_count)s posts."
167 msgstr "С этой меткой есть %(thread_count)s тем и %(post_count)s сообщений."
166 msgid ""
167 "This tag has %(active_thread_count)s/%(thread_count)s threads and "
168 "%(post_count)s posts."
169 msgstr "С этой меткой есть %(active_thread_count)s/%(thread_count)s тем и %(post_count)s сообщений."
168
170
169 #: templates/boards/all_threads.html:83 templates/boards/feed.html:30
171 #: templates/boards/all_threads.html:83 templates/boards/feed.html:30
170 #: templates/boards/notifications.html:17 templates/search/search.html:26
172 #: templates/boards/notifications.html:17 templates/search/search.html:26
@@ -54,8 +54,14 b' class Tag(models.Model, Viewable):'
54
54
55 return self.get_thread_count() == 0
55 return self.get_thread_count() == 0
56
56
57 def get_thread_count(self) -> int:
57 def get_thread_count(self, archived=None) -> int:
58 return self.get_threads().count()
58 threads = self.get_threads()
59 if archived is not None:
60 threads = threads.filter(archived=archived)
61 return threads.count()
62
63 def get_active_thread_count(self) -> int:
64 return self.get_thread_count(archived=False)
59
65
60 def get_absolute_url(self):
66 def get_absolute_url(self):
61 return reverse('tag', kwargs={'tag_name': self.name})
67 return reverse('tag', kwargs={'tag_name': self.name})
@@ -73,7 +73,7 b''
73 <p>{{ tag.get_description }}</p>
73 <p>{{ tag.get_description }}</p>
74 {% endautoescape %}
74 {% endautoescape %}
75 {% endif %}
75 {% endif %}
76 <p>{% blocktrans with thread_count=tag.get_thread_count post_count=tag.get_post_count %}This tag has {{ thread_count }} threads and {{ post_count }} posts.{% endblocktrans %}</p>
76 <p>{% blocktrans with active_thread_count=tag.get_active_thread_count thread_count=tag.get_thread_count post_count=tag.get_post_count %}This tag has {{ active_thread_count}}/{{ thread_count }} threads and {{ post_count }} posts.{% endblocktrans %}</p>
77 </div>
77 </div>
78 {% endif %}
78 {% endif %}
79
79
General Comments 0
You need to be logged in to leave comments. Login now