Skip to content

Commit

Permalink
#250, allow subscribe on new posts for your topic
Browse files Browse the repository at this point in the history
  • Loading branch information
Alerion committed Apr 6, 2014
1 parent e3bbd1b commit e5c519c
Show file tree
Hide file tree
Showing 13 changed files with 366 additions and 109 deletions.
4 changes: 2 additions & 2 deletions src/doc_comments/locale/ru/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: release\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-04-06 12:11+0300\n"
"POT-Creation-Date: 2014-04-06 16:36+0300\n"
"PO-Revision-Date: 2012-08-31 15:50+0400\n"
"Last-Translator: Ruslan Popob <[email protected]>\n"
"Language-Team: ru <[email protected]>\n"
Expand Down Expand Up @@ -62,7 +62,7 @@ msgstr "комментарий к доке"
msgid "doc. comments"
msgstr "комментарии к доке"

#: views.py:78
#: views.py:86
msgid "You are not authenticated."
msgstr "Вы не авторизированы"

Expand Down
4 changes: 2 additions & 2 deletions src/forum/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ class ForumAdmin(admin.ModelAdmin):


class TopicAdmin(admin.ModelAdmin):
list_filter = ['sticky', 'closed', 'heresy']
list_display = ['name', 'forum', 'created', 'updated', 'user', 'views', 'rating', 'sticky']
list_filter = ['sticky', 'closed', 'heresy', 'send_response']
list_display = ['name', 'forum', 'created', 'updated', 'user', 'views', 'rating', 'sticky', 'send_response']
search_fields = ('name',)


Expand Down
5 changes: 4 additions & 1 deletion src/forum/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ def save(self):
post.user = self.user
post.topic = self.topic
post.save()

post.topic.send_email_about_post(post)

return post


Expand All @@ -45,7 +48,7 @@ class AddTopicForm(PlaceholderMixin, forms.ModelForm):

class Meta:
model = Topic
fields = ('name', 'body')
fields = ('name', 'body', 'send_response')

def __init__(self, forum, user, *args, **kwargs):
self.forum = forum
Expand Down
124 changes: 78 additions & 46 deletions src/forum/locale/ru/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ msgid ""
msgstr ""
"Project-Id-Version: 1\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-04-06 12:11+0300\n"
"PO-Revision-Date: 2014-04-06 12:15+0300\n"
"POT-Creation-Date: 2014-04-06 16:36+0300\n"
"PO-Revision-Date: 2014-04-06 16:37+0300\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
"Language: \n"
Expand All @@ -19,136 +19,145 @@ msgstr ""
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)\n"

#: forms.py:44 models.py:287
#: forms.py:47 models.py:308
msgid "Message"
msgstr "Сообщение"

#: models.py:25 models.py:58
#: models.py:27 models.py:60
msgid "Name"
msgstr "Имя"

#: models.py:26
#: models.py:28
msgid "Groups"
msgstr "Группы "

#: models.py:27
#: models.py:29
msgid "Only users from these groups can see this category"
msgstr "Только пользователи следующих групп могут видеть данную категорию"

#: models.py:28 models.py:59
#: models.py:30 models.py:61
msgid "Position"
msgstr "Позиция"

#: models.py:32 models.py:57
#: models.py:34 models.py:59
msgid "Category"
msgstr "Категория"

#: models.py:33
#: models.py:35
msgid "Categories"
msgstr "Категории"

#: models.py:60
#: models.py:62
msgid "Description"
msgstr "Описание"

#: models.py:64 models.py:209 templates/djforum/base.html:4
#: models.py:66 models.py:212 templates/djforum/base.html:4
msgid "Forum"
msgstr "Форум"

#: models.py:65
#: models.py:67
msgid "Forums"
msgstr "Форумы"

#: models.py:122 models.py:179
#: models.py:124 models.py:181
msgid "user"
msgstr "пользователь"

#: models.py:123
#: models.py:125
msgid "topic"
msgstr "тема"

#: models.py:124
#: models.py:126
msgid "time"
msgstr "время"

#: models.py:175
#: models.py:177
msgid "forum"
msgstr "форум"

#: models.py:176
#: models.py:178
msgid "subject"
msgstr "заголовок"

#: models.py:177
#: models.py:179
msgid "created"
msgstr "создан"

#: models.py:178
#: models.py:180
msgid "updated"
msgstr "изменён"

#: models.py:180
#: models.py:182
msgid "views count"
msgstr "количество просмотров"

#: models.py:181
#: models.py:183
msgid "sticky"
msgstr "прикреплён"

#: models.py:182
#: models.py:184
msgid "closed"
msgstr "закрыт"

#: models.py:183 templates/djforum/topic.html:95
#: models.py:185 templates/djforum/topic.html:95
msgid "heresy"
msgstr "ересь"

#: models.py:186 models.py:288
#: models.py:188 models.py:309
msgid "rating"
msgstr "рейтинг"

#: models.py:187 models.py:289
#: models.py:189 models.py:310
msgid "votes"
msgstr "голоса"

#: models.py:192 models.py:282
#: models.py:191
msgid "send response on email"
msgstr "отправлять email про новые ответы"

#: models.py:195 models.py:303
msgid "Topic"
msgstr "Тема"

#: models.py:193 templates/djforum/index.html:35
#: models.py:196 templates/djforum/index.html:30
msgid "Topics"
msgstr "Темы"

#: models.py:283
#: models.py:290
#, python-format
msgid "New post for your topic \"%(topic)s\""
msgstr "Новый ответ для вашей темы \"%(topic)s\""

#: models.py:304
msgid "User"
msgstr "Пользователь"

#: models.py:284
#: models.py:305
msgid "Created"
msgstr "Создан"

#: models.py:285
#: models.py:306
msgid "Updated"
msgstr "Изменён"

#: models.py:286
#: models.py:307
msgid "Updated by"
msgstr "Изменён"

#: models.py:295
#: models.py:316
msgid "Post"
msgstr "Отклик"

#: models.py:296 templates/djforum/_post_author.html:13
#: templates/djforum/index.html:36
#: models.py:317 templates/djforum/_post_author.html:13
#: templates/djforum/index.html:31
msgid "Posts"
msgstr "Отклики"

#: views.py:152
msgid "You have no permission edit this post"
msgstr "У вас нет прав на редактирование этого отклика"

#: views.py:286
#: views.py:308
msgid "Authentication required."
msgstr "Необходима авторизация"

Expand Down Expand Up @@ -194,7 +203,7 @@ msgstr "Откликов"
msgid "Views"
msgstr "Просмотров"

#: templates/djforum/_topic_list.html:9 templates/djforum/index.html:37
#: templates/djforum/_topic_list.html:9 templates/djforum/index.html:32
msgid "Last post"
msgstr "Последний отклик"

Expand Down Expand Up @@ -223,7 +232,7 @@ msgid "New post"
msgstr "Новый отклик"

#: templates/djforum/add_post.html:24 templates/djforum/add_topic.html:33
#: templates/djforum/edit_post.html:24 templates/djforum/topic.html:141
#: templates/djforum/edit_post.html:24 templates/djforum/topic.html:149
msgid "Submit"
msgstr "Отправить"

Expand Down Expand Up @@ -252,43 +261,58 @@ msgstr "Новая тема"
msgid "Edit post"
msgstr "Изменить отклик"

#: templates/djforum/forum.html:20 templates/djforum/index.html:11
#: templates/djforum/email_new_post.html:1
#, python-format
msgid ""
"\n"
"<a href=\"%(protocol)s://%(domain)s%(url)s\">%(protocol)s://%(domain)s"
"%(url)s</a>\n"
msgstr ""
"\n"
"<a href=\"%(protocol)s://%(domain)s%(url)s\">%(protocol)s://%(domain)s"
"%(url)s</a>\n"

#: templates/djforum/forum.html:20 templates/djforum/index.html:12
#: templates/djforum/topic.html:76 templates/djforum/unread_topics.html:6
#: templates/djforum/unread_topics.html:13
msgid "Unread topics"
msgstr "Непрочитанные темы"

#: templates/djforum/forum.html:28 templates/djforum/index.html:21
#: templates/djforum/forum.html:28 templates/djforum/index.html:16
#: templates/djforum/unread_topics.html:22
msgid "Mark all as read"
msgstr "Пометить всё как прочитанное"

#: templates/djforum/index.html:17 templates/djforum/my_topics.html:6
#: templates/djforum/index.html:9
msgid "Search"
msgstr "Поиск"

#: templates/djforum/index.html:15 templates/djforum/my_topics.html:6
#: templates/djforum/my_topics.html:13 templates/djforum/unread_topics.html:18
msgid "My topics"
msgstr "Мои темы"

#: templates/djforum/index.html:72
#: templates/djforum/index.html:67
msgid "Total number of registered users:"
msgstr "Пользователей зарегистрировано:"

#: templates/djforum/index.html:73
#: templates/djforum/index.html:68
msgid "Total number of topics:"
msgstr "Тем создано"

#: templates/djforum/index.html:74
#: templates/djforum/index.html:69
msgid "Total number of posts:"
msgstr "Откликов написано:"

#: templates/djforum/index.html:77
#: templates/djforum/index.html:72
msgid "Registered users online:"
msgstr "Пользователей онлайн:"

#: templates/djforum/index.html:78
#: templates/djforum/index.html:73
msgid "Guests online:"
msgstr "Гостей онлайн:"

#: templates/djforum/index.html:80
#: templates/djforum/index.html:75
msgid "Online:"
msgstr "Онлайн:"

Expand Down Expand Up @@ -368,6 +392,14 @@ msgstr "Открыть"
msgid "Close"
msgstr "Закрыть"

#: templates/djforum/topic.html:123
msgid "Unsubscribe"
msgstr "Отписаться"

#: templates/djforum/topic.html:125
msgid "Subscribe"
msgstr "Подписаться"

#: templatetags/forum_tags.py:88
msgid "Post rating"
msgstr "Рейтинг отклика"
Expand Down
Loading

0 comments on commit e5c519c

Please sign in to comment.