diff --git a/django_messages/locale/en/LC_MESSAGES/django.po b/django_messages/locale/en/LC_MESSAGES/django.po new file mode 100644 index 00000000..5831c0f2 --- /dev/null +++ b/django_messages/locale/en/LC_MESSAGES/django.po @@ -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 , 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 \n" +"Language-Team: LANGUAGE \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 %(message)s." +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 %(message)s " +"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 %(message)s." +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 %(message_parent_msg)s " +"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 %(message)s 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 "" diff --git a/functions/overrides.py b/functions/overrides.py new file mode 100644 index 00000000..8a132cb7 --- /dev/null +++ b/functions/overrides.py @@ -0,0 +1,19 @@ +from django.core.paginator import Paginator, PageNotAnInteger, EmptyPage + +class SeoPaginator(Paginator): + + def validate_number(self, number): + "Validates the given 1-based page number." + try: + number = int(number) + except (TypeError, ValueError): + raise PageNotAnInteger('That page number is not an integer') + if number < 1: + raise EmptyPage('That page number is less than 1') + if number > self.num_pages: + if number == 1 and self.allow_empty_first_page: + pass + else: + number = 1 + return number + diff --git a/password_reset/locale/en/LC_MESSAGES/django.po b/password_reset/locale/en/LC_MESSAGES/django.po new file mode 100644 index 00000000..ec6d3d10 --- /dev/null +++ b/password_reset/locale/en/LC_MESSAGES/django.po @@ -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 , 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 \n" +"Language-Team: LANGUAGE \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 request a new one." +msgstr "" + +#: password_reset/templates/password_reset/reset.html:7 +#, python-format +msgid "Hi, %(username)s. 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 %(email)s %(ago)s ago. Use the link in " +"it to set a new password." +msgstr "" diff --git a/templates/admin/article/article_confirm_delete.html b/templates/admin/article/article_confirm_delete.html new file mode 100644 index 00000000..ac15985c --- /dev/null +++ b/templates/admin/article/article_confirm_delete.html @@ -0,0 +1,11 @@ +{% extends 'base.html' %} +{% block sidebar %}{% endblock %} +{% block body %} +
{% csrf_token %} +
+

Вы точно хотите удалить "{{ object }}" ?

+ + Нет +
+
+{% endblock %} \ No newline at end of file diff --git a/templates/admin/expobanner/link_list.html b/templates/admin/expobanner/link_list.html new file mode 100644 index 00000000..4a7ff172 --- /dev/null +++ b/templates/admin/expobanner/link_list.html @@ -0,0 +1,38 @@ +{% extends 'base.html' %} + +{% block body %} + +
+
+

{{ verbose }}

+
+
+ {% block list_table %} + + + + + + + + + + + + {% for item in object_list %} + + + + + + + {% endfor %} + +
Объектссылка для отслеживания  
{{ item }}{{request.get_host}}{{ item.get_click_link }}Изменить Статистика
+ {% endblock %} +
+ {# pagination #} + {% include 'admin/includes/admin_pagination.html' with page_obj=object_list %} +
+ +{% endblock %} \ No newline at end of file diff --git a/templates/admin/expobanner/main_list.html b/templates/admin/expobanner/main_list.html new file mode 100644 index 00000000..a06a2411 --- /dev/null +++ b/templates/admin/expobanner/main_list.html @@ -0,0 +1,55 @@ +{% extends 'admin/base.html' %} + +{% block body %} + +
+
+

Список выставок на главной

+
+
+ {% block list_table %} + +
+
+ Только опубликование +
+
+ + + + + + + + + + + + {% for item in object_list %} + + + + + + + + {% endfor %} + +
ВыставкаПозиция   
{{ item }}{{ item.main.position }}Изменить {% if item.main.public %}отключить{% else %}включить{% endif %} Статистика
+ {% endblock %} +
+ {# pagination #} + {% include 'admin/includes/admin_pagination.html' with page_obj=object_list %} +
+ +{% endblock %} \ No newline at end of file diff --git a/templates/admin/expobanner/main_stat.html b/templates/admin/expobanner/main_stat.html new file mode 100644 index 00000000..d186b92f --- /dev/null +++ b/templates/admin/expobanner/main_stat.html @@ -0,0 +1,90 @@ +{% extends 'admin/base.html' %} +{% load static %} +{% load i18n %} +{% block scripts %} + {# datetimepicker #} + + + +{% endblock %} + + +{% block body %} +
+
+
+

{{ object.get_event }}

+
+
+
+
Линк на статистику: {{ request.get_host }}/expo-b/banner/{{ object.link.id }}/stat/
+
Пароль: {{ object.link.stat_pswd }}
+
+ +
+
+
+ + + + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + {% with stats=stats %} + {% for stat in stats %} + + + + + + + + + {% endfor %} + {% endwith %} + +
ДатаПоказыКликиУникальные показыУникальные клики
Всего{{ all.views }}{{ all.clicks }}{{ all.unique_views}}{{ all.unique_clicks }}
{{ stat.date|date:"Y-m-d" }}{{ stat.view }}{{ stat.click }}{{ stat.unique_view }}{{ stat.unique_click }}
+
+
+
+ +{% endblock %} \ No newline at end of file diff --git a/templates/client/includes/banners/detail_inner_3.html b/templates/client/includes/banners/detail_inner_3.html new file mode 100644 index 00000000..7315e28e --- /dev/null +++ b/templates/client/includes/banners/detail_inner_3.html @@ -0,0 +1,11 @@ +
+ + + + +
\ No newline at end of file diff --git a/templates/client/includes/banners/popup.html b/templates/client/includes/banners/popup.html new file mode 100644 index 00000000..6152147d --- /dev/null +++ b/templates/client/includes/banners/popup.html @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/templates/client/includes/banners/popup_2.html b/templates/client/includes/banners/popup_2.html new file mode 100644 index 00000000..75c55929 --- /dev/null +++ b/templates/client/includes/banners/popup_2.html @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/templates/client/includes/conference/default_description.html b/templates/client/includes/conference/default_description.html new file mode 100644 index 00000000..b1c15031 --- /dev/null +++ b/templates/client/includes/conference/default_description.html @@ -0,0 +1,21 @@ +{% load i18n %} +
+{% blocktrans with name=conf.name%} +

Конференция {{name}} проходит {% endblocktrans %}{% include 'client/includes/show_date_block.html' with obj=conf %} +{% blocktrans with city=conf.name country=country.name name=conf.name id=conf.city.id code=request.LANGUAGE_CODE date1=conf.data_begin|date:'j' date2=conf.data_begin|date:'Y' date3=conf.data_begin|date:'n' date4=conf.data_end|date:'j' date5=conf.data_end|date:'Y' date6=conf.data_end|date:'n' %} + в городе {{city}}, {{country}}. +Посмотреть, как проехать в место проведения конференции, можно на сайте конгрессной площадки. +Деловая программа {{name}} разбита на секции по дням и размещается на сайте мероприятия с подробным списком +докладчиков конференции. Спикеров конференции {{name}} обычно окончательно утверждают за 1-2 месяца до начала конференции.

+

Ваши деловые контакты на {{name}}

+

Добавьте конференцию {{name}} в расписание, чтобы не потерять важное событие, + где встречаются профессионалы нужной Вам отрасли. Создавайте свой календарь мероприятий, просто нажав кнопку + "Добавить в календарь".

+

Планируете самостоятельную поездку на {{name}} ?

+

Если Вам требуется размещение, мы рекомендуем посмотреть отели и цены в период проведения конференции здесь. +Не забудьте проверить место и даты конференции на официальном сайте и в календаре организатора. Событие могут перенести, +отменить, объединить с проектом схожей тематики. Expomap не несет ответственности за неточности +предоставляемой информации. +Есть вопрос по участию в {{name}} ? Ответим по тел. +7 (499) 999-12-07

+ {% endblocktrans %} +
\ No newline at end of file diff --git a/templates/client/includes/exposition/default_description.html b/templates/client/includes/exposition/default_description.html new file mode 100644 index 00000000..df26b1ea --- /dev/null +++ b/templates/client/includes/exposition/default_description.html @@ -0,0 +1,34 @@ +{% load i18n %} +
+ {% blocktrans with name=expo.name %} +

Выставка {{ name }} проводится{% endblocktrans %} + {% include 'client/includes/show_date_block.html' with obj=expo %} + {% blocktrans with city=expo.city.name country=expo.country.name %} в городе {{ city }}, {{ country }} + .{% endblocktrans %} + {% blocktrans with name=expo.name id=expo.city.id code=request.LANGUAGE_CODE date1=expo.data_begin|date:'j' date2=expo.data_begin|date:'Y' date3=expo.data_begin|date:'n' date4=expo.data_end|date:'j' date5=expo.data_end|date:'Y' date6=expo.data_end|date:'n' %} + Экспонируемые продукты и разделы выставки Вы можете посмотреть ниже, в блоке + «Дополнительная информация». + Полный список участников {{ name }} размещается на официальном сайте выставки и постоянно обновляется. + Там же Вы сможете найти экспонентов предыдущего года. Деловая программа {{ name }} обычно публикуется ближе к + началу события.

+ +

Ваш личный календарь

+

Добавьте выставку {{ name }} в календарь, чтобы не + потерять важное событие. Создавайте свой календарь мероприятий, + просто нажав кнопку Добавить в календарь.

+ +

Планируете самостоятельную поездку на {{ name }}?

+

Мы рекомендуем посмотреть отели и цены в период проведения выставки + здесь. + {% endblocktrans %}{% if expo.place %} + {% blocktrans with name=expo.place.name url=expo.place.url %}Как добраться до выставочного центра {{ name }} можно + посмотреть + здесь.{% endblocktrans %} +{% endif %} + {% blocktrans with name=expo.name %} + Не забудьте проверить место и даты выставки на официальном сайте и в календаре выставочного комплекса. + Событие могут перенести, отменить, объединить с проектом схожей тематики. + Expomap не несет ответственности за неточности предоставляемой информации. + Есть вопрос о посещении или участии в {{ name }}? Ответим по тел. +7 (499) 999-12-07

+ {% endblocktrans %} +
\ No newline at end of file diff --git a/templates/client/specialist_catalog/catalog.html b/templates/client/specialist_catalog/catalog.html new file mode 100644 index 00000000..bd24ce8d --- /dev/null +++ b/templates/client/specialist_catalog/catalog.html @@ -0,0 +1,32 @@ +{% extends "client/base_catalog.html" %} +{% load static %} +{% load i18n %} +{% load template_filters %} + +{% block bread_scrumbs %} + +{% endblock %} + + +{% block content_list %} + {% with objects=object_list %} + {% for obj in objects %} + {% set cur_word = obj.place.name %} + {% if cur_word|slice:":1"|lower != prev_word|slice:":1"|lower and forloop.counter != 1 %} + + {% endif %} + {% if cur_word|slice:":1"|lower != prev_word|slice:":1"|lower %} +
    +
    {{ cur_word|slice:":1"|upper }}
    + {% endif %} +
  • + {{ obj.place }} +
  • + {% set prev_word = obj.place.name %} + {% endfor %} + {% endwith %} + +{% endblock %} \ No newline at end of file diff --git a/templates/client/static_client/js/rejs/banners.js b/templates/client/static_client/js/rejs/banners.js new file mode 100644 index 00000000..70e4998b --- /dev/null +++ b/templates/client/static_client/js/rejs/banners.js @@ -0,0 +1,113 @@ +(function () { + "use strict"; + + var API_URL_ROOT = "/expo-b/get-banners/"; + + var getUrl = function () { + var search = []; + + var parts = /^\/([^\/]+)(?:\/|$)/i.exec(location.pathname); + if (parts) { + search.push("catalog=" + encodeURIComponent(parts[1])); + } else { + search.push("catalog="); + } + + var elements = $("[id^=\"expo_b_\"]"); + for (var j = 0; j < elements.length; j++) { + search.push("places=" + encodeURIComponent($(elements[j]).attr("id"))); + } + + var data = window.sendData; + if (data instanceof Object) { + for (var key in data) { + if (data.hasOwnProperty(key)) { + var value = data[key]; + + if (value instanceof Array) { + for (var i = 0, l = value.length; i < l; i++) { + search.push(encodeURIComponent(key) + "=" + encodeURIComponent(value[i])); + } + } else { + search.push(encodeURIComponent(key) + "=" + encodeURIComponent(value)); + } + } + } + } + + return API_URL_ROOT + "?" + search.join("&"); + }; + + var getBanners = function (url, callback) { + var xhr = new XMLHttpRequest(); + xhr.open("GET", url, true); + + xhr.onreadystatechange = function (event) { + if (event.target.readyState === 4) { + if (event.target.status === 200) { + try { + callback(JSON.parse(event.target.responseText)); + } catch (error) { + // do nothing + } + } + } + }; + + xhr.send(); + }; + + var addBanner = function (banner) { + var parent = document.getElementById(banner.id); + + if (parent) { + if (banner.is_popup) { + if (banner.is_img) { + parent.innerHTML = + "
    " + + "\""
    "; + } else if (banner.is_html) { + parent.innerHTML = banner.text; + } + + $("#expo-form-popup").on("submit", function(e) { + e.preventDefault(); + window.location = $("#expo-form-popup").attr("action"); + }); + + setTimeout(function(){ + $.fancybox.open([{"href": "#" + banner.id}], {}); + }, 5000); + } else { + if (banner.is_img) { + var a = document.createElement("a"); + a.href = banner.url; + + var img = document.createElement("img"); + img.src = banner.img; + img.alt = banner.alt; + + a.appendChild(img); + parent.appendChild(a); + } else if (banner.is_html) { + parent.innerHTML = banner.text; + } + } + } + + }; + + var insertBanners = function (data) { + if (data instanceof Array) { + for (var i = 0, l = data.length; i < l; i++) { + addBanner(data[i]); + } + } + }; + + var main = function () { + getBanners(getUrl(), insertBanners); + }; + + window.addEventListener("load", main); +})(); diff --git a/templates/client/static_client/js/rejs/tops.js b/templates/client/static_client/js/rejs/tops.js new file mode 100644 index 00000000..31bee27b --- /dev/null +++ b/templates/client/static_client/js/rejs/tops.js @@ -0,0 +1,69 @@ +(function () { + "use strict"; + + var API_URL_ROOT = "/expo-b/get-tops/"; + var PARENT_ID = "expo_top_events"; + + var getUrl = function () { + var search = []; + + var parts = /^\/([^\/]+)(?:\/|$)/i.exec(location.pathname); + if (parts) { + search.push("catalog=" + encodeURIComponent(parts[1])); + } else { + search.push("catalog="); + } + + var data = window.sendData; + if (data instanceof Object) { + for (var key in data) { + if (data.hasOwnProperty(key)) { + var value = data[key]; + + if (value instanceof Array) { + for (var i = 0, l = value.length; i < l; i++) { + search.push(encodeURIComponent(key) + "=" + encodeURIComponent(value[i])); + } + } else { + search.push(encodeURIComponent(key) + "=" + encodeURIComponent(value)); + } + } + } + } + + return API_URL_ROOT + "?" + search.join("&"); + }; + + var getTops = function (url, callback) { + var xhr = new XMLHttpRequest(); + xhr.open("GET", url, true); + + xhr.onreadystatechange = function (event) { + if (event.target.readyState === 4) { + if (event.target.status === 200) { + try { + callback(event.target.responseText); + } catch (error) { + // do nothing + } + } + } + }; + + xhr.send(); + }; + + var insertTops = function (text) { + var parent = document.getElementById(PARENT_ID); + + if (parent) { + parent.innerHTML = text; + } + }; + + var main = function () { + getTops(getUrl(), insertTops); + }; + + window.addEventListener("load", main); +})(); diff --git a/wizard/description.txt b/wizard/description.txt new file mode 100644 index 00000000..9da7860c --- /dev/null +++ b/wizard/description.txt @@ -0,0 +1,2 @@ +Должен был быть модуль для добавления событий и других даных через кабинет пользователя. +Остановленна разработка по ненадобности, так как делается функционал добавление событий через црм \ No newline at end of file