commit
0ea3ce2282
238 changed files with 11353 additions and 8516 deletions
@ -0,0 +1,374 @@ |
|||||||
|
# SOME DESCRIPTIVE TITLE. |
||||||
|
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER |
||||||
|
# This file is distributed under the same license as the PACKAGE package. |
||||||
|
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. |
||||||
|
# |
||||||
|
#, fuzzy |
||||||
|
msgid "" |
||||||
|
msgstr "" |
||||||
|
"Project-Id-Version: PACKAGE VERSION\n" |
||||||
|
"Report-Msgid-Bugs-To: \n" |
||||||
|
"POT-Creation-Date: 2015-09-08 13:44+0300\n" |
||||||
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" |
||||||
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" |
||||||
|
"Language-Team: LANGUAGE <LL@li.org>\n" |
||||||
|
"Language: \n" |
||||||
|
"MIME-Version: 1.0\n" |
||||||
|
"Content-Type: text/plain; charset=UTF-8\n" |
||||||
|
"Content-Transfer-Encoding: 8bit\n" |
||||||
|
|
||||||
|
#: django_messages/admin.py:21 |
||||||
|
msgid "group" |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: django_messages/admin.py:22 |
||||||
|
msgid "Creates the message optionally for all users or a group of users." |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: django_messages/admin.py:30 |
||||||
|
msgid "All users" |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: django_messages/admin.py:48 django_messages/models.py:94 |
||||||
|
msgid "Message" |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: django_messages/admin.py:55 |
||||||
|
msgid "Date/time" |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: django_messages/apps.py:6 django_messages/models.py:95 |
||||||
|
msgid "Messages" |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: django_messages/fields.py:56 |
||||||
|
#, python-format |
||||||
|
msgid "The following usernames are incorrect: %(users)s" |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: django_messages/forms.py:17 django_messages/forms.py:66 |
||||||
|
#: django_messages/models.py:55 |
||||||
|
#: django_messages/templates/django_messages/inbox.html:10 |
||||||
|
#: django_messages/templates/django_messages/outbox.html:10 |
||||||
|
#: django_messages/templates/django_messages/trash.html:10 |
||||||
|
#: django_messages/templates/django_messages/view.html:8 |
||||||
|
msgid "Subject" |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: django_messages/forms.py:18 django_messages/forms.py:46 |
||||||
|
#: django_messages/forms.py:67 django_messages/models.py:56 |
||||||
|
msgid "Body" |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: django_messages/forms.py:65 django_messages/models.py:58 |
||||||
|
#: django_messages/templates/django_messages/outbox.html:10 |
||||||
|
#: django_messages/templates/django_messages/view.html:14 |
||||||
|
msgid "Recipient" |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: django_messages/management.py:9 |
||||||
|
msgid "Message Received" |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: django_messages/management.py:9 |
||||||
|
msgid "you have received a message" |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: django_messages/management.py:10 |
||||||
|
msgid "Message Sent" |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: django_messages/management.py:10 |
||||||
|
msgid "you have sent a message" |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: django_messages/management.py:11 |
||||||
|
msgid "Message Replied" |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: django_messages/management.py:11 |
||||||
|
msgid "you have replied to a message" |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: django_messages/management.py:12 |
||||||
|
msgid "Reply Received" |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: django_messages/management.py:12 |
||||||
|
msgid "you have received a reply to a message" |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: django_messages/management.py:13 |
||||||
|
msgid "Message Deleted" |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: django_messages/management.py:13 |
||||||
|
msgid "you have deleted a message" |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: django_messages/management.py:14 |
||||||
|
msgid "Message Recovered" |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: django_messages/management.py:14 |
||||||
|
msgid "you have undeleted a message" |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: django_messages/models.py:57 |
||||||
|
#: django_messages/templates/django_messages/inbox.html:10 |
||||||
|
#: django_messages/templates/django_messages/trash.html:10 |
||||||
|
#: django_messages/templates/django_messages/view.html:10 |
||||||
|
msgid "Sender" |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: django_messages/models.py:59 |
||||||
|
msgid "Parent message" |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: django_messages/models.py:60 |
||||||
|
msgid "sent at" |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: django_messages/models.py:61 |
||||||
|
msgid "read at" |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: django_messages/models.py:62 |
||||||
|
msgid "replied at" |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: django_messages/models.py:63 |
||||||
|
msgid "Sender deleted at" |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: django_messages/models.py:64 |
||||||
|
msgid "Recipient deleted at" |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: django_messages/templates/django_messages/base.html:9 |
||||||
|
#: django_messages/templates/django_messages/inbox.html:6 |
||||||
|
#: django_messages/templates/django_messages/new_message.html:13 |
||||||
|
msgid "Inbox" |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: django_messages/templates/django_messages/base.html:10 |
||||||
|
#: django_messages/templates/django_messages/outbox.html:6 |
||||||
|
msgid "Sent Messages" |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: django_messages/templates/django_messages/base.html:11 |
||||||
|
msgid "New Message" |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: django_messages/templates/django_messages/base.html:12 |
||||||
|
msgid "Trash" |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: django_messages/templates/django_messages/compose.html:4 |
||||||
|
msgid "Compose Message" |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: django_messages/templates/django_messages/compose.html:10 |
||||||
|
msgid "Send" |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: django_messages/templates/django_messages/inbox.html:10 |
||||||
|
msgid "Received" |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: django_messages/templates/django_messages/inbox.html:10 |
||||||
|
#: django_messages/templates/django_messages/outbox.html:10 |
||||||
|
#: django_messages/templates/django_messages/trash.html:10 |
||||||
|
msgid "Action" |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: django_messages/templates/django_messages/inbox.html:22 |
||||||
|
#: django_messages/templates/django_messages/outbox.html:19 |
||||||
|
#: django_messages/templates/django_messages/trash.html:19 |
||||||
|
#: django_messages/templates/django_messages/view.html:13 |
||||||
|
msgid "DATETIME_FORMAT" |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: django_messages/templates/django_messages/inbox.html:23 |
||||||
|
#: django_messages/templates/django_messages/outbox.html:20 |
||||||
|
msgid "delete" |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: django_messages/templates/django_messages/inbox.html:29 |
||||||
|
#: django_messages/templates/django_messages/outbox.html:26 |
||||||
|
#: django_messages/templates/django_messages/trash.html:26 |
||||||
|
msgid "No messages." |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: django_messages/templates/django_messages/new_message.html:4 |
||||||
|
#, python-format |
||||||
|
msgid "" |
||||||
|
"Hello %(recipient)s,\n" |
||||||
|
"\n" |
||||||
|
"you received a private message from %(sender)s with\n" |
||||||
|
"the following contents:" |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: django_messages/templates/django_messages/new_message.html:12 |
||||||
|
#, python-format |
||||||
|
msgid "Sent from %(site_url)s" |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: django_messages/templates/django_messages/new_message.html:14 |
||||||
|
#: django_messages/templates/django_messages/view.html:20 |
||||||
|
msgid "Reply" |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: django_messages/templates/django_messages/outbox.html:10 |
||||||
|
msgid "Sent" |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: django_messages/templates/django_messages/trash.html:6 |
||||||
|
msgid "Deleted Messages" |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: django_messages/templates/django_messages/trash.html:10 |
||||||
|
#: django_messages/templates/django_messages/view.html:12 |
||||||
|
msgid "Date" |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: django_messages/templates/django_messages/trash.html:20 |
||||||
|
msgid "undelete" |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: django_messages/templates/django_messages/trash.html:29 |
||||||
|
msgid "" |
||||||
|
"Deleted Messages are removed from the trash at unregular intervals, don't " |
||||||
|
"rely on this feature for long-time storage." |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: django_messages/templates/django_messages/view.html:6 |
||||||
|
msgid "View Message" |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: django_messages/templates/django_messages/view.html:22 |
||||||
|
msgid "Delete" |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: django_messages/templates/notification/messages_deleted/full.txt:1 |
||||||
|
#, python-format |
||||||
|
msgid "You have deleted the message '%(message)s'." |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: django_messages/templates/notification/messages_deleted/notice.html:1 |
||||||
|
#, python-format |
||||||
|
msgid "" |
||||||
|
"You have deleted the message <a href=\"%(message_url)s\">%(message)s</a>." |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: django_messages/templates/notification/messages_received/full.txt:1 |
||||||
|
#, python-format |
||||||
|
msgid "" |
||||||
|
"%(message_sender)s has sent you a message:\n" |
||||||
|
"\n" |
||||||
|
"%(message)s\n" |
||||||
|
"\n" |
||||||
|
"%(message_body)s\n" |
||||||
|
"\n" |
||||||
|
"http://%(current_site)s%(message_url)s" |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: django_messages/templates/notification/messages_received/notice.html:2 |
||||||
|
#, python-format |
||||||
|
msgid "" |
||||||
|
"You have received the message <a href=\"%(message_url)s\">%(message)s</a> " |
||||||
|
"from %(message_sender)s." |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: django_messages/templates/notification/messages_received/short.txt:1 |
||||||
|
#: django_messages/templates/notification/messages_reply_received/short.txt:1 |
||||||
|
#, python-format |
||||||
|
msgid "%(notice)s by %(message_sender)s" |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: django_messages/templates/notification/messages_recovered/full.txt:1 |
||||||
|
#, python-format |
||||||
|
msgid "You have recovered the message '%(message)s'." |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: django_messages/templates/notification/messages_recovered/notice.html:1 |
||||||
|
#, python-format |
||||||
|
msgid "" |
||||||
|
"You have recovered the message <a href=\"%(message_url)s\">%(message)s</a>." |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: django_messages/templates/notification/messages_replied/full.txt:1 |
||||||
|
#, python-format |
||||||
|
msgid "" |
||||||
|
"You have replied to '%(message_parent_msg)s' from %(message_recipient)s." |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: django_messages/templates/notification/messages_replied/notice.html:2 |
||||||
|
#, python-format |
||||||
|
msgid "" |
||||||
|
"You have replied to <a href=\"%(message_url)s\">%(message_parent_msg)s</a> " |
||||||
|
"from %(message_recipient)s." |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: django_messages/templates/notification/messages_reply_received/full.txt:1 |
||||||
|
#, python-format |
||||||
|
msgid "" |
||||||
|
"%(message_sender)s replied to '%(message_parent_msg)s':\n" |
||||||
|
"\n" |
||||||
|
"%(message)s\n" |
||||||
|
"\n" |
||||||
|
"%(message_body)s\n" |
||||||
|
"\n" |
||||||
|
"http://%(current_site)s%(message_url)s" |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: django_messages/templates/notification/messages_reply_received/notice.html:2 |
||||||
|
#, python-format |
||||||
|
msgid "%(message_sender)s has sent you a reply to %(message_parent_msg)s." |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: django_messages/templates/notification/messages_sent/full.txt:1 |
||||||
|
#, python-format |
||||||
|
msgid "You have sent the message '%(message)s' to %(message_recipient)s." |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: django_messages/templates/notification/messages_sent/notice.html:2 |
||||||
|
#, python-format |
||||||
|
msgid "" |
||||||
|
"You have sent the message <a href=\"%(message_url)s\">%(message)s</a> to " |
||||||
|
"%(message_recipient)s." |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: django_messages/utils.py:26 |
||||||
|
#, python-format |
||||||
|
msgid "" |
||||||
|
"%(sender)s wrote:\n" |
||||||
|
"%(body)s" |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: django_messages/utils.py:54 |
||||||
|
#, python-format |
||||||
|
msgid "Re%(prefix)s: %(subject)s" |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: django_messages/utils.py:60 |
||||||
|
#, python-format |
||||||
|
msgid "New Message: %(subject)s" |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: django_messages/views.py:78 django_messages/views.py:114 |
||||||
|
msgid "Message successfully sent." |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: django_messages/views.py:121 |
||||||
|
#, python-format |
||||||
|
msgid "Re: %(subject)s" |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: django_messages/views.py:157 |
||||||
|
msgid "Message successfully deleted." |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: django_messages/views.py:184 |
||||||
|
msgid "Message successfully recovered." |
||||||
|
msgstr "" |
||||||
Binary file not shown.
@ -1,16 +1,15 @@ |
|||||||
# -*- coding: utf-8 -*- |
# -*- coding: utf-8 -*- |
||||||
from django.conf.urls import patterns, include, url |
from django.conf.urls import patterns, url |
||||||
from admin import MetaListView, MetaView |
from views import CreateSeoText, SeoTextList, EditSeoText, DeleteSeoText |
||||||
from .views import CreateSeoText, SeoTextList, EditSeoText, DeleteSeoText |
from .admin import MetaListView, MetaView |
||||||
|
|
||||||
urlpatterns = patterns('conference.admin', |
|
||||||
|
|
||||||
|
urlpatterns = patterns('', |
||||||
url(r'^seo/new/$', CreateSeoText.as_view(), name='seo_new'), |
url(r'^seo/new/$', CreateSeoText.as_view(), name='seo_new'), |
||||||
url(r'^seo/all/$', SeoTextList.as_view(), name='seo_all'), |
url(r'^seo/all/$', SeoTextList.as_view(), name='seo_all'), |
||||||
url(r'^seo/edit/(?P<pk>\d{1,5})/$', EditSeoText.as_view(), name='seo_edit'), |
url(r'^seo/edit/(?P<pk>\d{1,5})/$', EditSeoText.as_view(), name='seo_edit'), |
||||||
url(r'^seo/delete/(?P<pk>\d{1,5})/$', DeleteSeoText.as_view(), name='seo_delete'), |
url(r'^seo/delete/(?P<pk>\d{1,5})/$', DeleteSeoText.as_view(), name='seo_delete'), |
||||||
url(r'^all/$', MetaListView.as_view()), |
url(r'^all/$', MetaListView.as_view()), |
||||||
#url(r'^change/(?P<url>.*)/$', 'conference_change'), |
url(r'^(?P<id>\d{1,6})/$', MetaView.as_view()), |
||||||
url(r'^(?P<id>.*)/$', MetaView.as_view()), |
|
||||||
url(r'^$', MetaView.as_view()), |
url(r'^$', MetaView.as_view()), |
||||||
) |
) |
||||||
@ -0,0 +1,122 @@ |
|||||||
|
# SOME DESCRIPTIVE TITLE. |
||||||
|
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER |
||||||
|
# This file is distributed under the same license as the PACKAGE package. |
||||||
|
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. |
||||||
|
# |
||||||
|
#, fuzzy |
||||||
|
msgid "" |
||||||
|
msgstr "" |
||||||
|
"Project-Id-Version: PACKAGE VERSION\n" |
||||||
|
"Report-Msgid-Bugs-To: \n" |
||||||
|
"POT-Creation-Date: 2015-09-08 13:44+0300\n" |
||||||
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" |
||||||
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" |
||||||
|
"Language-Team: LANGUAGE <LL@li.org>\n" |
||||||
|
"Language: \n" |
||||||
|
"MIME-Version: 1.0\n" |
||||||
|
"Content-Type: text/plain; charset=UTF-8\n" |
||||||
|
"Content-Transfer-Encoding: 8bit\n" |
||||||
|
|
||||||
|
#: password_reset/forms.py:14 |
||||||
|
msgid "Sorry, this user doesn't exist." |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: password_reset/forms.py:31 |
||||||
|
msgid "Username" |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: password_reset/forms.py:32 |
||||||
|
msgid "Email" |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: password_reset/forms.py:33 |
||||||
|
msgid "Для восстановления пароля укажите email, который Вы регистрировали" |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: password_reset/forms.py:83 |
||||||
|
msgid "Unable to find user." |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: password_reset/forms.py:89 |
||||||
|
msgid "New password" |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: password_reset/forms.py:93 |
||||||
|
msgid "New password (confirm)" |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: password_reset/forms.py:98 |
||||||
|
msgid "The two passwords didn't match." |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: password_reset/templates/password_reset/recovery_done.html:3 |
||||||
|
msgid "New password set" |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: password_reset/templates/password_reset/recovery_done.html:6 |
||||||
|
msgid "" |
||||||
|
"Your password has successfully been reset. You can use it right now on the " |
||||||
|
"login page." |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: password_reset/templates/password_reset/recovery_email.txt:1 |
||||||
|
#, python-format |
||||||
|
msgid "Dear %(username)s," |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: password_reset/templates/password_reset/recovery_email.txt:3 |
||||||
|
#, python-format |
||||||
|
msgid "" |
||||||
|
"You -- or someone pretending to be you -- has requested a password reset on " |
||||||
|
"%(domain)s." |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: password_reset/templates/password_reset/recovery_email.txt:5 |
||||||
|
msgid "You can set your new password by following this link:" |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: password_reset/templates/password_reset/recovery_email.txt:9 |
||||||
|
msgid "" |
||||||
|
"If you don't want to reset your password, simply ignore this email and it " |
||||||
|
"will stay unchanged." |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: password_reset/templates/password_reset/recovery_email_subject.txt:1 |
||||||
|
#, python-format |
||||||
|
msgid "Password recovery on %(domain)s" |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: password_reset/templates/password_reset/recovery_form.html:5 |
||||||
|
msgid "Password recovery" |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: password_reset/templates/password_reset/recovery_form.html:10 |
||||||
|
msgid "Recover my password" |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: password_reset/templates/password_reset/reset.html:5 |
||||||
|
#, python-format |
||||||
|
msgid "" |
||||||
|
"Sorry, this password reset link is invalid. You can still <a href=" |
||||||
|
"\"%(recovery_url)s\">request a new one</a>." |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: password_reset/templates/password_reset/reset.html:7 |
||||||
|
#, python-format |
||||||
|
msgid "Hi, <strong>%(username)s</strong>. Please choose your new password." |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: password_reset/templates/password_reset/reset.html:11 |
||||||
|
msgid "Set new password" |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: password_reset/templates/password_reset/reset_sent.html:4 |
||||||
|
msgid "Password recovery sent" |
||||||
|
msgstr "" |
||||||
|
|
||||||
|
#: password_reset/templates/password_reset/reset_sent.html:7 |
||||||
|
#, python-format |
||||||
|
msgid "" |
||||||
|
"An email was sent to <strong>%(email)s</strong> %(ago)s ago. Use the link in " |
||||||
|
"it to set a new password." |
||||||
|
msgstr "" |
||||||
@ -0,0 +1,20 @@ |
|||||||
|
# -*- coding: utf-8 -*- |
||||||
|
from django.conf.urls import url, patterns |
||||||
|
from .views import * |
||||||
|
|
||||||
|
urlpatterns = patterns('', |
||||||
|
url(r'^specialist/new/$', SpecialistCreateView.as_view(), name='specialist_new'), |
||||||
|
url(r'^specialist/all/$', SpecialistListView.as_view(), name='specialist_all'), |
||||||
|
url(r'^specialist/edit/(?P<pk>\d{1,4})/$', SpecialistUpdateView.as_view(), name='specialist_edit'), |
||||||
|
url(r'^specialist/delete/(?P<pk>\d{1,4})/$', SpecialistDeleteView.as_view(), name='specialist_delete'), |
||||||
|
url(r'^catalog/new/$', CatalogCreateView.as_view(), name='catalog_new'), |
||||||
|
url(r'^catalog/all/$', CatalogListView.as_view(), name='catalog_all'), |
||||||
|
url(r'^catalog/city/$', CatalogCityView.as_view(), name='catalog_city'), |
||||||
|
url(r'^catalog/country/$', CatalogCountryView.as_view(), name='catalog_country'), |
||||||
|
url(r'^catalog/edit/(?P<pk>\d{1,4})/$', CatalogUpdateView.as_view(), name='catalog_edit'), |
||||||
|
url(r'^catalog/delete/(?P<pk>\d{1,4})/$', CatalogDeleteView.as_view(), name='catalog_delete'), |
||||||
|
url(r'^catalog/(?P<catalog_pk>\d{1,4})/add_feedback/$', FeedbackCreateView.as_view(), name='feedback_new'), |
||||||
|
#url(r'^catalog/(?P<pk>\d{1,4})/feedbacks/$', FeedbackListView.as_view(), name='feedback_all'), |
||||||
|
url(r'^catalog/(?P<catalog_pk>\d{1,4})/feedback/(?P<id>\d{1,4})/$', FeedbackUpdateView.as_view(), name='feedback_edit'), |
||||||
|
url(r'^feedback/delete/(?P<pk>\d{1,4})/$', FeedbackDeleteView.as_view(), name='feedback_delete'), |
||||||
|
) |
||||||
@ -0,0 +1,65 @@ |
|||||||
|
# -*- coding: utf-8 -*- |
||||||
|
from django import forms |
||||||
|
from hvad.forms import TranslatableModelForm |
||||||
|
from .models import Specialist, SpecialistCatalog, Feedback, City, Country |
||||||
|
from ckeditor.widgets import CKEditorWidget |
||||||
|
from django.utils.translation import get_language |
||||||
|
|
||||||
|
country_choices = [(c.id, c.name) for c in Country.objects.all()] |
||||||
|
lang_code = get_language()[:2] |
||||||
|
|
||||||
|
default_text = u"Планируете посетить выставку в %s?" \ |
||||||
|
u" Мы предлагаем Вам подобрать переводчика именно под Ваши цели и потребности. " \ |
||||||
|
u"Специализируясь уже более 7 лет на предоставлении переводчиков на выставки и конференции " \ |
||||||
|
u"%s, мы можем предоставить профессионалов со знанием разных " \ |
||||||
|
u"языков на гибких для Вас условиях. Каждый заказ индивидуален для нас, " \ |
||||||
|
u"и итоговая цена зависит от вида перевода, тематики, срочности подбора " \ |
||||||
|
u"специалиста, города и объема работы." |
||||||
|
default_title = u"Переводчики в %s" |
||||||
|
|
||||||
|
|
||||||
|
class SpecialistCatalogForm(TranslatableModelForm): |
||||||
|
|
||||||
|
class Meta: |
||||||
|
model = SpecialistCatalog |
||||||
|
fields = ['price', 'currency', 'logo_preview', 'main_descr', 'place_photo', |
||||||
|
'specialists', 'city', 'country', 'type', 'title', 'benefits', 'big_cities'] |
||||||
|
widgets = { |
||||||
|
'type': forms.Select(choices=(('1', 'Country'), ('2', 'City'))), |
||||||
|
'city': forms.HiddenInput(attrs={'id': 'id_city'}), |
||||||
|
'country': forms.Select(choices=country_choices, attrs={'id': 'id_country'}), |
||||||
|
'main_descr': CKEditorWidget, |
||||||
|
'benefits': CKEditorWidget, |
||||||
|
'big_cities': CKEditorWidget, |
||||||
|
} |
||||||
|
|
||||||
|
def save(self, commit=True): |
||||||
|
place = self.cleaned_data.get('city') or self.cleaned_data.get('country') |
||||||
|
place_inflect = place.inflect or place.name |
||||||
|
if not self.cleaned_data['title']: |
||||||
|
self.cleaned_data['title'] = default_title % place_inflect |
||||||
|
if not self.cleaned_data['main_descr']: |
||||||
|
self.cleaned_data['main_descr'] = default_text % (place_inflect, place_inflect) |
||||||
|
return super(SpecialistCatalogForm, self).save(commit=True) |
||||||
|
|
||||||
|
|
||||||
|
class SpecialistForm(forms.ModelForm): |
||||||
|
|
||||||
|
class Meta: |
||||||
|
model = Specialist |
||||||
|
fields = ['name','country', 'city', 'photo', 'languages'] |
||||||
|
widgets = { |
||||||
|
'city': forms.HiddenInput(attrs={'id': 'id_city'}), |
||||||
|
'country': forms.Select(choices=country_choices, attrs={'id': 'id_country'}) |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
class FeedbackForm(forms.ModelForm): |
||||||
|
|
||||||
|
class Meta: |
||||||
|
model = Feedback |
||||||
|
fields = ['company', 'name', 'text', 'logo', 'catalog'] |
||||||
|
widgets = { |
||||||
|
'text':CKEditorWidget |
||||||
|
} |
||||||
|
|
||||||
@ -0,0 +1 @@ |
|||||||
|
__author__ = 'dart_vaider' |
||||||
@ -0,0 +1 @@ |
|||||||
|
__author__ = 'dart_vaider' |
||||||
@ -0,0 +1,41 @@ |
|||||||
|
# -*- coding: utf-8 -*- |
||||||
|
from django.core.management.base import BaseCommand |
||||||
|
from django.utils.translation import activate |
||||||
|
from city.models import City |
||||||
|
from specialist_catalog.models import SpecialistCatalog |
||||||
|
|
||||||
|
default_text = u"Планируете посетить выставку %s?" \ |
||||||
|
u" Мы предлагаем Вам подобрать переводчика именно под Ваши цели и потребности. " \ |
||||||
|
u"Специализируясь уже более 7 лет на предоставлении переводчиков на выставки и конференции " \ |
||||||
|
u"%s, мы можем предоставить профессионалов со знанием разных " \ |
||||||
|
u"языков на гибких для Вас условиях. Каждый заказ индивидуален для нас, " \ |
||||||
|
u"и итоговая цена зависит от вида перевода, тематики, срочности подбора " \ |
||||||
|
u"специалиста, города и объема работы." |
||||||
|
default_title = u"Переводчики %s" |
||||||
|
|
||||||
|
default_benefits = """<ul class="content_list"> |
||||||
|
<li>Эффективная цена</li> |
||||||
|
<li>Опыт и профессионализм специалистов</li> |
||||||
|
<li>Знание разных менталитетов и психологических аспектов проведения переговоров с зарубежными бизнесменами</li> |
||||||
|
<li>Ориентированность в мировых выставочных комплексах</li> |
||||||
|
<li>Гарантии, отчетность по договору, прозрачные безналичные расчеты в России</li> |
||||||
|
</ul>""" |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
class Command(BaseCommand): |
||||||
|
def handle(self, *args, **options): |
||||||
|
activate('ru') |
||||||
|
cities = set(City.used.expo_cities()) |
||||||
|
for cty in cities: |
||||||
|
name = cty.inflect or cty.name |
||||||
|
sc = SpecialistCatalog( |
||||||
|
type=2, |
||||||
|
country=cty.country, |
||||||
|
city=cty, |
||||||
|
title=default_title % name, |
||||||
|
main_descr=default_text % (name, name), |
||||||
|
benefits = default_benefits |
||||||
|
) |
||||||
|
sc.save() |
||||||
|
print cty.url, " -> ", cty.country.url |
||||||
@ -0,0 +1,42 @@ |
|||||||
|
# -*- coding: utf-8 -*- |
||||||
|
from django.core.management.base import BaseCommand |
||||||
|
from django.utils.translation import activate |
||||||
|
from country.models import Country |
||||||
|
from specialist_catalog.models import SpecialistCatalog |
||||||
|
from django.utils.translation import activate |
||||||
|
|
||||||
|
activate('ru') |
||||||
|
|
||||||
|
default_text = u"Планируете посетить выставку %s?" \ |
||||||
|
u" Мы предлагаем Вам подобрать переводчика именно под Ваши цели и потребности. " \ |
||||||
|
u"Специализируясь уже более 7 лет на предоставлении переводчиков на выставки и конференции " \ |
||||||
|
u"%s, мы можем предоставить профессионалов со знанием разных " \ |
||||||
|
u"языков на гибких для Вас условиях. Каждый заказ индивидуален для нас, " \ |
||||||
|
u"и итоговая цена зависит от вида перевода, тематики, срочности подбора " \ |
||||||
|
u"специалиста, города и объема работы." |
||||||
|
default_title = u"Переводчики %s" |
||||||
|
default_benefits = """<ul class="content_list"> |
||||||
|
<li>Эффективная цена</li> |
||||||
|
<li>Опыт и профессионализм специалистов</li> |
||||||
|
<li>Знание разных менталитетов и психологических аспектов проведения переговоров с зарубежными бизнесменами</li> |
||||||
|
<li>Ориентированность в мировых выставочных комплексах</li> |
||||||
|
<li>Гарантии, отчетность по договору, прозрачные безналичные расчеты в России</li> |
||||||
|
</ul>""" |
||||||
|
|
||||||
|
|
||||||
|
class Command(BaseCommand): |
||||||
|
def handle(self, *args, **options): |
||||||
|
activate('ru') |
||||||
|
countries = set(Country.objects.expo_countries()) |
||||||
|
|
||||||
|
for cntry in countries: |
||||||
|
name = cntry.inflect or cntry.name |
||||||
|
sc = SpecialistCatalog( |
||||||
|
type='1', |
||||||
|
country=cntry, |
||||||
|
title=default_title % name, |
||||||
|
main_descr=default_text % (name, name), |
||||||
|
benefits = default_benefits |
||||||
|
) |
||||||
|
sc.save() |
||||||
|
print "created for: %s" % cntry.url |
||||||
@ -0,0 +1,107 @@ |
|||||||
|
# -*- coding: utf-8 -*- |
||||||
|
from django.db import models |
||||||
|
from django.conf import settings |
||||||
|
from hvad.models import TranslatableModel, TranslatedFields, TranslationManager |
||||||
|
from city.models import City |
||||||
|
from country.models import Country |
||||||
|
from django.core.urlresolvers import reverse_lazy |
||||||
|
from django.utils.translation import get_language |
||||||
|
import copy |
||||||
|
|
||||||
|
# types of catalog |
||||||
|
_country = 1 |
||||||
|
_city = 2 |
||||||
|
|
||||||
|
|
||||||
|
class Specialist(models.Model): |
||||||
|
name = models.CharField(max_length=255, verbose_name=u"Полное имя", blank=False) |
||||||
|
languages = models.CharField(max_length=255, verbose_name=u"Языки") |
||||||
|
city = models.ForeignKey(City, on_delete=models.PROTECT, verbose_name=u"Город", blank=True) |
||||||
|
country = models.ForeignKey(Country, on_delete=models.PROTECT, verbose_name=u"Страна") |
||||||
|
photo = models.ImageField(verbose_name=u"Фото", upload_to="specialist_catalog/specialist_photo/", blank=True) |
||||||
|
|
||||||
|
|
||||||
|
def __unicode__(self): |
||||||
|
return u"%s" % self.name |
||||||
|
|
||||||
|
|
||||||
|
class SpecialistCatalog(TranslatableModel): |
||||||
|
price = models.IntegerField(verbose_name=u"Цена", default=200) |
||||||
|
currency = models.CharField(max_length=255, verbose_name=u"Валюта", default=u"EUR") |
||||||
|
logo_preview = models.ImageField(verbose_name=u"Логотип", blank=True, upload_to='specialist_catalog/logo_preview/') |
||||||
|
place_photo = models.ImageField(verbose_name=u"Фото для города", blank=True, upload_to='specialist_catalog/place_photo/') |
||||||
|
specialists = models.ManyToManyField(Specialist, verbose_name=u"Специалисты", blank=True) |
||||||
|
city = models.ForeignKey(City, on_delete=models.PROTECT, verbose_name=u"Город", blank=True, null=True) |
||||||
|
country = models.ForeignKey(Country, on_delete=models.PROTECT, verbose_name=u"Страна", blank=False) |
||||||
|
type = models.PositiveSmallIntegerField(verbose_name=u"Тип(Страна/Город)", default=2) |
||||||
|
|
||||||
|
|
||||||
|
translations = TranslatedFields( |
||||||
|
title=models.CharField(max_length=255, verbose_name=u"Заголовок"), |
||||||
|
main_descr=models.CharField(max_length=1000, verbose_name=u"Краткое описание"), |
||||||
|
benefits=models.CharField(max_length=2000, verbose_name=u"Преимущества"), |
||||||
|
big_cities=models.TextField(verbose_name=u"Крупные города", blank=True) |
||||||
|
) |
||||||
|
|
||||||
|
def __init__(self, *args, **kwargs): |
||||||
|
super(SpecialistCatalog, self).__init__(*args, **kwargs) |
||||||
|
self.cache_fields = ['title', 'main_descr', 'benefits'] |
||||||
|
self.is_new = True |
||||||
|
|
||||||
|
def get_absolute_url(self): |
||||||
|
global _country, _city |
||||||
|
if self.type == _country: |
||||||
|
return reverse_lazy('spec_catalog_country', kwargs={'slug': self.country.url}) |
||||||
|
return reverse_lazy('spec_catalog_city', kwargs={'slug': self.city.url}) |
||||||
|
|
||||||
|
def save(self, *args, **kwargs): |
||||||
|
super(SpecialistCatalog, self).save(*args, **kwargs) |
||||||
|
self.initial_language = get_language()[:2] or 'ru' |
||||||
|
|
||||||
|
new_values = {field: getattr(self, field) for field in self.cache_fields} |
||||||
|
langs = [code for code, _ in settings.LANGUAGES] |
||||||
|
if self.is_new: |
||||||
|
for lang in langs: |
||||||
|
if lang not in self.get_available_languages(): |
||||||
|
self.translate(lang) |
||||||
|
for key, value in new_values.items(): |
||||||
|
setattr(self, key, value) |
||||||
|
self.save_translations(self) |
||||||
|
else: |
||||||
|
translations = {obj.language_code: obj for obj in list(self.translations.all())} |
||||||
|
for lang in langs: |
||||||
|
if lang is not self.initial_language: |
||||||
|
tr = translations[lang] |
||||||
|
for key, value in new_values.items(): |
||||||
|
#if u'%s' % getattr(tr, key) is u'%s' % self.var_cache[key]: |
||||||
|
setattr(tr, key, value) |
||||||
|
tr.save() |
||||||
|
|
||||||
|
self.lazy_translation_getter(self.initial_language) |
||||||
|
self.var_cache = {var: copy.copy(getattr(self, var)) for var in self.cache_fields} |
||||||
|
self.is_new = False |
||||||
|
return self |
||||||
|
|
||||||
|
def __unicode__(self): |
||||||
|
return self.lazy_translation_getter('title', unicode(self.pk)) |
||||||
|
|
||||||
|
def place(self): |
||||||
|
if self.type == _country: |
||||||
|
return self.country |
||||||
|
elif self.type == _city: |
||||||
|
return self.city |
||||||
|
else: |
||||||
|
return None |
||||||
|
|
||||||
|
|
||||||
|
class Feedback(models.Model): |
||||||
|
company = models.CharField(max_length=255, verbose_name=u"Название компании") |
||||||
|
name = models.CharField(max_length=100, verbose_name=u"Имя") |
||||||
|
text = models.CharField(max_length=5000, verbose_name=u"Текст отзыва") |
||||||
|
logo = models.ImageField(verbose_name=u"Логотип компании", upload_to='specialist_catalog/feedback_logo/', blank=True) |
||||||
|
catalog = models.ForeignKey(SpecialistCatalog, verbose_name=u"Страница", blank=False) |
||||||
|
|
||||||
|
def __unicode__(self): |
||||||
|
return "Feedback from %s" % self.company |
||||||
|
|
||||||
|
|
||||||
@ -0,0 +1,16 @@ |
|||||||
|
""" |
||||||
|
This file demonstrates writing tests using the unittest module. These will pass |
||||||
|
when you run "manage.py test". |
||||||
|
|
||||||
|
Replace this with more appropriate tests for your application. |
||||||
|
""" |
||||||
|
|
||||||
|
from django.test import TestCase |
||||||
|
|
||||||
|
|
||||||
|
class SimpleTest(TestCase): |
||||||
|
def test_basic_addition(self): |
||||||
|
""" |
||||||
|
Tests that 1 + 1 always equals 2. |
||||||
|
""" |
||||||
|
self.assertEqual(1 + 1, 2) |
||||||
@ -0,0 +1,11 @@ |
|||||||
|
# -*- coding: utf-8 -*- |
||||||
|
from django.conf.urls import url, patterns |
||||||
|
from .views import CatalogDetailedView, SpecCatalog |
||||||
|
|
||||||
|
urlpatterns = patterns('', |
||||||
|
url(r'^city/$', SpecCatalog.as_view(), {'type': 'city'}, name="spec_city"), |
||||||
|
url(r'^country/$', SpecCatalog.as_view(), {'type': 'country'}, name="spec_country"), |
||||||
|
|
||||||
|
url(r'^city/(?P<slug>.*)/$', CatalogDetailedView.as_view(), {'type': 'city'}, name="spec_catalog_city"), |
||||||
|
url(r'^country/(?P<slug>.*)/$', CatalogDetailedView.as_view(), {'type': 'country'}, name="spec_catalog_country"), |
||||||
|
) |
||||||
@ -0,0 +1,225 @@ |
|||||||
|
# -*- coding: utf-8 -*- |
||||||
|
from django.views.generic import CreateView, UpdateView, DeleteView, ListView, FormView, DetailView |
||||||
|
from django.views.generic.detail import SingleObjectMixin |
||||||
|
from django.utils.translation import ugettext as _ |
||||||
|
from .forms import * |
||||||
|
from django.core.urlresolvers import reverse_lazy |
||||||
|
from django.conf import settings |
||||||
|
from django.shortcuts import get_object_or_404 |
||||||
|
from service.order_forms import TranslationForm |
||||||
|
from django.http import HttpResponseRedirect, Http404 |
||||||
|
from .models import _city, _country |
||||||
|
|
||||||
|
|
||||||
|
# =========== ADMIN VIEWS =========== |
||||||
|
|
||||||
|
# Specialist views |
||||||
|
|
||||||
|
|
||||||
|
class SpecialistCreateView(CreateView): |
||||||
|
form_class = SpecialistForm |
||||||
|
model = Specialist |
||||||
|
template_name = 'admin/specialist/specialist_new.html' |
||||||
|
success_url = reverse_lazy("specialist_all") |
||||||
|
|
||||||
|
|
||||||
|
from hvad.utils import get_translation_aware_manager |
||||||
|
|
||||||
|
|
||||||
|
class SpecialistListView(ListView): |
||||||
|
model = Specialist |
||||||
|
template_name = 'admin/specialist/specialist_all.html' |
||||||
|
paginate_by = settings.ADMIN_PAGINATION |
||||||
|
|
||||||
|
def get_queryset(self): |
||||||
|
name = self.request.GET.get('name', None) |
||||||
|
city = self.request.GET.get('city', None) |
||||||
|
qs = get_translation_aware_manager(Specialist).all() |
||||||
|
if name: |
||||||
|
qs = qs.filter(name__icontains=name) |
||||||
|
if city: |
||||||
|
qs = qs.filter(city__name__icontains=city) |
||||||
|
return qs |
||||||
|
|
||||||
|
|
||||||
|
class SpecialistUpdateView(UpdateView): |
||||||
|
form_class = SpecialistForm |
||||||
|
model = Specialist |
||||||
|
template_name = 'admin/specialist/specialist_new.html' |
||||||
|
success_url = reverse_lazy("specialist_all") |
||||||
|
|
||||||
|
def get_form(self, form_class): |
||||||
|
form = super(SpecialistUpdateView, self).get_form(form_class) |
||||||
|
form.fields['city'].widget.attrs['data-init-text'] = self.object.city.name |
||||||
|
return form |
||||||
|
|
||||||
|
|
||||||
|
class SpecialistDeleteView(DeleteView): |
||||||
|
model = Specialist |
||||||
|
template_name = 'admin/specialist/specialist_confirm_delete.html' |
||||||
|
success_url = reverse_lazy("specialist_all") |
||||||
|
|
||||||
|
|
||||||
|
# Catalog views |
||||||
|
|
||||||
|
|
||||||
|
class CatalogCreateView(CreateView): |
||||||
|
form_class = SpecialistCatalogForm |
||||||
|
model = SpecialistCatalog |
||||||
|
template_name = 'admin/specialist/catalog_new.html' |
||||||
|
success_url = reverse_lazy("catalog_all") |
||||||
|
|
||||||
|
|
||||||
|
class CatalogListView(ListView): |
||||||
|
model = SpecialistCatalog |
||||||
|
template_name = 'admin/specialist/catalog_all.html' |
||||||
|
paginate_by = settings.ADMIN_PAGINATION |
||||||
|
|
||||||
|
|
||||||
|
class CatalogCityView(ListView): |
||||||
|
model = SpecialistCatalog |
||||||
|
template_name = 'admin/specialist/catalog_all.html' |
||||||
|
paginate_by = settings.ADMIN_PAGINATION |
||||||
|
|
||||||
|
def get_queryset(self): |
||||||
|
query = self.request.GET.get('query', None) |
||||||
|
qs = self.model.objects.language().filter(type=2) |
||||||
|
if query: |
||||||
|
qs = qs.filter(title__icontains=query) |
||||||
|
return qs |
||||||
|
|
||||||
|
|
||||||
|
class CatalogCountryView(ListView): |
||||||
|
model = SpecialistCatalog |
||||||
|
template_name = 'admin/specialist/catalog_all.html' |
||||||
|
paginate_by = settings.ADMIN_PAGINATION |
||||||
|
|
||||||
|
def get_queryset(self): |
||||||
|
query = self.request.GET.get('query', None) |
||||||
|
qs = self.model.objects.language().filter(type=1) |
||||||
|
if query: |
||||||
|
qs = qs.filter(title__icontains=query) |
||||||
|
return qs |
||||||
|
|
||||||
|
|
||||||
|
class CatalogUpdateView(UpdateView): |
||||||
|
form_class = SpecialistCatalogForm |
||||||
|
model = SpecialistCatalog |
||||||
|
template_name = 'admin/specialist/catalog_new.html' |
||||||
|
success_url = reverse_lazy("catalog_all") |
||||||
|
|
||||||
|
def get_form(self, form_class): |
||||||
|
form = super(CatalogUpdateView, self).get_form(form_class) |
||||||
|
if self.object.type is 2: # city |
||||||
|
form.fields['city'].widget.attrs['data-init-text'] = self.object.city.name |
||||||
|
return form |
||||||
|
|
||||||
|
|
||||||
|
class CatalogDeleteView(DeleteView): |
||||||
|
model = SpecialistCatalog |
||||||
|
template_name = 'admin/specialist/catalog_confirm_delete.html' |
||||||
|
success_url = reverse_lazy("catalog_all") |
||||||
|
|
||||||
|
|
||||||
|
# Feedback views |
||||||
|
|
||||||
|
|
||||||
|
class FeedbackCreateView(CreateView): |
||||||
|
form_class = FeedbackForm |
||||||
|
model = Feedback |
||||||
|
template_name = 'admin/specialist/feedback_new.html' |
||||||
|
success_url = reverse_lazy("catalog_all") |
||||||
|
|
||||||
|
def get_initial(self): |
||||||
|
catalog = get_object_or_404(SpecialistCatalog, pk=self.kwargs.get('catalog_pk')) |
||||||
|
return {'catalog': catalog} |
||||||
|
|
||||||
|
|
||||||
|
class FeedbackUpdateView(UpdateView): |
||||||
|
form_class = FeedbackForm |
||||||
|
model = Feedback |
||||||
|
template_name = 'admin/specialist/feedback_new.html' |
||||||
|
success_url = reverse_lazy("catalog_all") |
||||||
|
|
||||||
|
def get_initial(self): |
||||||
|
catalog = get_object_or_404(SpecialistCatalog, pk=self.kwargs.get('catalog_pk')) |
||||||
|
return {'catalog': catalog} |
||||||
|
|
||||||
|
|
||||||
|
class FeedbackDeleteView(DeleteView): |
||||||
|
model = Feedback |
||||||
|
template_name = 'admin/specialist/feedback_confirm_delete.html' |
||||||
|
success_url = reverse_lazy("catalog_all") |
||||||
|
|
||||||
|
|
||||||
|
# ========= CLIENT VIEWS ============ |
||||||
|
|
||||||
|
|
||||||
|
class CatalogDetailedView(SingleObjectMixin, FormView): |
||||||
|
model = SpecialistCatalog |
||||||
|
form_class = TranslationForm |
||||||
|
template_name = "client/specialist_catalog/catalog_detailed.html" |
||||||
|
success_url = reverse_lazy("service_thanks") |
||||||
|
|
||||||
|
def get_catalog_obj(self): |
||||||
|
if self.kwargs.get('type') is "country": |
||||||
|
try: |
||||||
|
return self.model.objects.language().get(type=1, country__url=self.kwargs.get('slug')) |
||||||
|
except self.model.DoesNotExist: |
||||||
|
raise Http404 |
||||||
|
else: |
||||||
|
try: |
||||||
|
return self.model.objects.language().get(type=2, city__url=self.kwargs.get('slug')) |
||||||
|
except self.model.DoesNotExist: |
||||||
|
raise Http404 |
||||||
|
|
||||||
|
def get_object(self, queryset=None): |
||||||
|
obj = self.get_catalog_obj() |
||||||
|
self.object = obj |
||||||
|
return obj |
||||||
|
|
||||||
|
def get_context_data(self, **kwargs): |
||||||
|
self.get_object() |
||||||
|
context = super(CatalogDetailedView, self).get_context_data(**kwargs) |
||||||
|
context['object'] = self.object |
||||||
|
return context |
||||||
|
|
||||||
|
def form_valid(self, form): |
||||||
|
order = form.save(commit=False) |
||||||
|
order.save() |
||||||
|
return HttpResponseRedirect(self.success_url) |
||||||
|
|
||||||
|
def get_initial(self): |
||||||
|
obj = self.get_object() |
||||||
|
init = {} |
||||||
|
init['country'] = obj.country.name |
||||||
|
if self.kwargs.get('type') is "city": |
||||||
|
init['city'] = obj.city.name |
||||||
|
return init |
||||||
|
|
||||||
|
class SpecCatalog(ListView): |
||||||
|
model = SpecialistCatalog |
||||||
|
template_name = 'client/specialist_catalog/catalog.html' |
||||||
|
|
||||||
|
def get_queryset(self): |
||||||
|
|
||||||
|
if self.kwargs.get('type') == "country": |
||||||
|
ctype = _country |
||||||
|
else: |
||||||
|
ctype = _city |
||||||
|
|
||||||
|
qs = list(self.model.objects.language().select_related('country', 'city').filter(type=ctype)) |
||||||
|
if ctype == _country: |
||||||
|
result = sorted(qs, key=lambda x: x.country.name) |
||||||
|
else: |
||||||
|
result = sorted(qs, key=lambda x: x.city.name) |
||||||
|
|
||||||
|
return result |
||||||
|
|
||||||
|
def get_context_data(self, **kwargs): |
||||||
|
context = super(SpecCatalog, self).get_context_data(**kwargs) |
||||||
|
if self.kwargs.get('type') == "country": |
||||||
|
context['title'] = _(u'Переводчики по странам') |
||||||
|
else: |
||||||
|
context['title'] = _(u'Переводчики по городам') |
||||||
|
return context |
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue