From 89fa80c9157eac6e6910b828ae8944f8c13c20aa Mon Sep 17 00:00:00 2001 From: Alexander Burdeinyi Date: Fri, 9 Dec 2016 14:02:22 +0200 Subject: [PATCH] m --- emencia/django/newsletter/mailer.py | 2 + .../templates/newsletter/AutomaticEmail.html | 9 +- .../newsletter/AutomaticEmail_v2.html | 663 ++++++++++++++++++ .../newsletter/AutomaticEmail_web.html | 399 ++++++----- proj/middleware.py | 2 +- 5 files changed, 906 insertions(+), 169 deletions(-) create mode 100644 emencia/django/newsletter/templates/newsletter/AutomaticEmail_v2.html diff --git a/emencia/django/newsletter/mailer.py b/emencia/django/newsletter/mailer.py index 0bf0b09f..f52a6095 100644 --- a/emencia/django/newsletter/mailer.py +++ b/emencia/django/newsletter/mailer.py @@ -117,6 +117,8 @@ dailymail_attahcments = { 'expo': 'newsletter/images/expo.png', # 'news2': 'newsletter/images/news2.jpg', 'b': 'newsletter/images/b.png', + 'arrow': 'newsletter/images/arrow.png', + 'white_arrow': 'newsletter/images/white_arrow.png', 'site_logo': 'newsletter/images/site_logo.png', 'instagram': 'newsletter/images/instagram.png', 'youtube': 'newsletter/images/youtube.png', diff --git a/emencia/django/newsletter/templates/newsletter/AutomaticEmail.html b/emencia/django/newsletter/templates/newsletter/AutomaticEmail.html index 8355ef84..093f9cb6 100644 --- a/emencia/django/newsletter/templates/newsletter/AutomaticEmail.html +++ b/emencia/django/newsletter/templates/newsletter/AutomaticEmail.html @@ -107,7 +107,7 @@ - + {{ obj.get_dates }}, {{ obj.get_event_place_name }} @@ -241,7 +241,7 @@ {% if obj.get_event_place_name %} - + {{ obj.get_event_place_name }} {% endif %} @@ -507,6 +507,7 @@ + {% url 'newsletter-authmailingsettings' uidb36=uidb36 token=token as settings_url %} @@ -519,7 +520,7 @@
- {% trans "Настроить" %} + {% trans "Настроить" %}
@@ -590,7 +591,7 @@ {% trans "Вы получили это письмо, так как подписаны на рассылку" %} www.expomap.ru - {% trans "Переслать другу" %} {% trans "или" %} {% trans "Отписаться" %} + {% trans "Переслать другу" %} {% trans "или" %} {% trans "Отписаться" %} © 2008 — 2016 Expomap.ru diff --git a/emencia/django/newsletter/templates/newsletter/AutomaticEmail_v2.html b/emencia/django/newsletter/templates/newsletter/AutomaticEmail_v2.html new file mode 100644 index 00000000..ff9de28d --- /dev/null +++ b/emencia/django/newsletter/templates/newsletter/AutomaticEmail_v2.html @@ -0,0 +1,663 @@ +{% load i18n %} +{#{% load static %}#} +{#{% load thumbnail %}#} + +{# {% trans "ПОСМОТРЕТЬ ВСЕ" %} > #} +{# {% trans "ПОСМОТРЕТЬ ВСЕ" %} > #} +{# {% trans "ПОСМОТРЕТЬ ВСЕ" %} > #} +{# {% trans "НАСТРОИТЬ" %} > #} + + + + + + + {% comment %} + + + + {% endcomment %} + + + + + +
 
+ + {% comment %} + + + + + + + +
+ {% endcomment %} + + + + + + +
+ + + + + + +
+ + + +
+
+ + {% if recommended %} + {% with recommended.object as obj %} + + + + + +
+ + + + +
{% trans "Самые важные события для вас" %}
+ + + + + + + +
+{# {% thumbnail obj.get_logo '281' as im %}#} + +{# {% endthumbnail %}#} + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + {{ obj.get_event_place_name }} +
{{ obj.name|safe }}
+ + {{ obj.get_dates }}, {{ obj.get_event_place_name }} +
+ {{ obj.main_title|safe }} +
+ {% for tag in obj.tags %} + {{ tag.name }}{% if not forloop.last %},{% endif %} + {% endfor %} +
+ {% trans "посмотреть Подробнее" %} +
+
+
+ {% endwith %} + {% endif %} + + {% if moscow %} + + + + + + +
+ + + + +
+ + + + +
{% trans "в москве" %}
+ {% for sqs_obj in moscow %} + {% with sqs_obj.object as obj %} + + + + + +
+ +{# {% thumbnail obj.get_logo '90x90' as im %}#} + +{# {% endthumbnail %}#} + + + + + + + + + + + + + + + + + + + + + + +
{{ obj.name|safe }}
{{ obj.main_title|safe }}
+ + {{ obj.get_dates }} +
+ {% if obj.get_event_place_name %} + + {{ obj.get_event_place_name }} + {% endif %} +
+ {% trans "подробнее" %} +
+
+ {% endwith %} + {% endfor %} + + + + +
+ {% trans "посмотреть все" %} +
+
+
+ {% endif %} + + + + {% if russia %} + + + + + +
+ + + + +
+ + + + +
{% trans "В России" %}
+ {% for sqs_obj in russia %} + {% with sqs_obj.object as obj %} + + + + + +
+ +{# {% thumbnail obj.get_logo '100x100' as im %}#} + +{# {% endthumbnail %}#} + + + + + {% if forloop.first %} + + {% elif forloop.counter == 2 %} + + {% elif forloop.counter == 3 %} + + {% endif %} + + + + + + + + + + + + + + + + + +
+ {% if obj.get_event_place_name %} + + {{ obj.get_event_place_name }} + {% endif %} + + {% if obj.get_event_place_name %} + + {{ obj.get_event_place_name }} + {% endif %} + + {% if obj.get_event_place_name %} + + {{ obj.get_event_place_name }} + {% endif %} +
{{ obj.name|safe }}
{{ obj.main_title|safe }}
+ + {{ obj.get_dates }} +
+ {% trans "подробнее" %} +
+
+ {% endwith %} + {% endfor %} + + + + + +
+ {% trans "все события" %} +
+ +
+
+ {% endif %} + + + + {% if foreign %} + + + + + +
+ + + + + + + + + + + + +
{% trans "За рубежом" %}
+ + + {% for sqs_obj in foreign %} + {% with sqs_obj.object as obj %} + + {% endwith %} + {% endfor %} + +
+ + + + + + + + + + + + + + + + +
+ +{# {% thumbnail obj.get_logo '120x120' as im %}#} + +{# {% endthumbnail %}#} + +
+ {% if obj.get_event_place_name %} + + {{ obj.get_event_place_name }} + {% endif %} +
{{ obj.name|safe }}
+ + {{ obj.get_dates }} +
+ {% for tag in obj.tags %} + {{ tag.name }}{% if not forloop.last %},{% endif %} + {% endfor %} +
+
+
+ {% trans "Посмотреть все" %} +
+
+ {% endif %} + +{# -------------- БАНЕР --------------- #} + {% if newsletter.banner %} +{# {% thumbnail newsletter.banner '129x600' as im %}#} + +{# {% endthumbnail %}#} + {% endif %} + + {% if news %} + + + + + +
+ + + + + + + + + +
{% trans "Новости событий" %}
+{# {% thumbnail news.logo "272" as im %}#} + +{# {% endthumbnail %}#} + + + + + + + + + + + + + + +
{{ news.main_title|safe }}
+ + {{ news.publish_date|date:"d E Y" }} +
{{ news.preview|safe|truncatewords_html:25 }}
+ {% trans "Все новости" %} +
+
+
+ {% endif %} + +
+ + {% if blog %} + + + {% comment %} + + + + {% endcomment %} + + + + +
{% trans "Новенькое из блога" %}
+ + + + + + + + + +
{% trans "Новенькое из блога" %}
+{# {% thumbnail blog.logo "272" as im %}#} + +{# {% endthumbnail %}#} + + + + + + + + + + + + + +
{{ blog.main_title|safe }}
{{ blog.preview|safe|striptags }}
+ {% trans "посмотреть Подробнее" %} +
+
+
+ {% endif %} + + + + + + + +
+ + + + + + +
{% trans "Следуйте за нами" %}: + + + + + + + +
+
+ + + + + + + + + + + + + + + +
{% trans "Управление подпиской:" %}
{% trans "Вы можете настроить включение различных блоков информации в свое письмо, выбратьфильтры по темам, странам и городам, а также выбрать комфортную периодичность получения писем." %}
+ {% trans "Настроить" %} +
+ + + + + + + +
+ + + + + + +
+ + + + + + + + +
{% trans "Хорошего Вам дня!" %}
+
+ + + + + + + + +
+ {% trans "Поисковик деловых событий" %}
+ expomap.ru
+ mail@expomap.ru +
+ {% trans "По вопросам участия в выставках звоните" %}:
+ +7 (499) 999 -12-07 +
+
+
+ + + + + + + +
+ + + + + + + + + + + + +
{% trans "Выставки" %}/{% trans "Конференции" %}/{% trans "Участие в выставках" %}/{% trans "Новости" %}/{% trans "Статьи" %}
+
+ + + + + + + + + + + + + +
{% trans "Вы получили это письмо, так как подписаны на рассылку" %} https://www.expomap.ru
{% trans "Переслать другу" %} {% trans "или" %} {% trans "Отписаться" %}
© 2008 — 2016 Expomap.ru
+ + {% comment %} + +
+ {% endcomment %} + +
diff --git a/emencia/django/newsletter/templates/newsletter/AutomaticEmail_web.html b/emencia/django/newsletter/templates/newsletter/AutomaticEmail_web.html index 3684abd7..20a03dae 100644 --- a/emencia/django/newsletter/templates/newsletter/AutomaticEmail_web.html +++ b/emencia/django/newsletter/templates/newsletter/AutomaticEmail_web.html @@ -37,6 +37,35 @@ text-decoration: none; } + .event_image{ + display: block; + border: 1px solid #eaeaea; + text-align: center; + width: 110px; + height: 110px; + background-color: #ffffff; + line-height: 108px; + } + + .event_image img{ + vertical-align: middle; + } + + .foreign_image{ + display: block; + width: 128px; + height: 128px; + line-height: 128px; + background-color: #fff; + border: 1px solid #eaeaea; + text-align: center; + } + + .foreign_image img{ + display: inline-block; + vertical-align: middle; + } + @media screen and (max-width: 600px) { .mobile100 {width:100% !important;} } @@ -72,7 +101,7 @@ - @@ -90,17 +119,17 @@
+
-
+
{% trans "Самые важные события для вас" %}
- +
@@ -115,7 +144,7 @@ - + @@ -132,7 +161,7 @@ -
- {% thumbnail obj.get_logo '281x225' as im %} + {% thumbnail obj.get_logo '281' as im %} {% endthumbnail %}
{{ obj.name|safe }}{{ obj.name|safe }}
+ {% for tag in obj.tags %} {{ tag.name }}{% if not forloop.last %},{% endif %} {% endfor %} @@ -141,7 +170,7 @@
- {% trans "посмотреть Подробнее" %} + {% trans "посмотреть Подробнее" %}
@@ -156,68 +185,77 @@ {% if moscow %} - +
-
- + +
+ - - -
{% trans "в москве" %}
- {% for sqs_obj in moscow %} - {% with sqs_obj.object as obj %} - - - - - -
- {% thumbnail obj.get_logo '109x114' as im %} - - {% endthumbnail %} - + - - - - - - - - - - - - - - - - - - - + + + +
{{ obj.name|safe }}
{{ obj.main_title|safe }}
- - {{ obj.get_dates }} -
- {% if obj.get_event_place_name %} - - {{ obj.get_event_place_name }} - {% endif %} -
- {% trans "подробнее" %} -
{% trans "в москве" %}
+ {% for sqs_obj in moscow %} + {% with sqs_obj.object as obj %} + + + + + +
+ + {% thumbnail obj.get_logo '90x90' as im %} + + {% endthumbnail %} + + + + + + + + + + + + + + + + + + + + + + +
{{ obj.name|safe }}
{{ obj.main_title|safe }}
+ + {{ obj.get_dates }} +
+ {% if obj.get_event_place_name %} + + {{ obj.get_event_place_name }} + {% endif %} +
+ {% trans "подробнее" %} +
+
+ {% endwith %} + {% endfor %} + + + +
+ {% trans "посмотреть все" %} +
-
- {% endwith %} - {% endfor %} - - -
- {% trans "посмотреть все" %}
{% endif %} @@ -228,63 +266,88 @@ - - +
- +
+ - - -
{% trans "В России" %}
- {% for sqs_obj in russia %} - {% with sqs_obj.object as obj %} - - - - - -
- {% thumbnail obj.get_logo '109x114' as im %} - - {% endthumbnail %} - + - - - - - - - - - + - - -
- {% if obj.get_event_place_name %} - - {{ obj.get_event_place_name }} - {% endif %} -
{{ obj.name|safe }}
{{ obj.main_title|safe }}{% trans "В России" %}
- - {{ obj.get_dates }} +
+ {% for sqs_obj in russia %} + {% with sqs_obj.object as obj %} + + + + +
+ + {% thumbnail obj.get_logo '100x100' as im %} + + {% endthumbnail %} + + + + + {% if forloop.first %} + + {% elif forloop.counter == 2 %} + + {% elif forloop.counter == 3 %} + + {% endif %} + + + + + + + + + + + + + + + + + +
+ {% if obj.get_event_place_name %} + + {{ obj.get_event_place_name }} + {% endif %} + + {% if obj.get_event_place_name %} + + {{ obj.get_event_place_name }} + {% endif %} + + {% if obj.get_event_place_name %} + + {{ obj.get_event_place_name }} + {% endif %} +
{{ obj.name|safe }}
{{ obj.main_title|safe }}
+ + {{ obj.get_dates }} +
+ {% trans "подробнее" %} +
+ {% endwith %} + {% endfor %} + -
- {% trans "подробнее" %} + + {% trans "все события" %}
-
- {% endwith %} - {% endfor %} - - -
- {% trans "все события" %}
@@ -297,62 +360,70 @@ {% if foreign %} - - - - - +
{% trans "За рубежом" %}
- - - + + +
- +
+ + + + - {% for sqs_obj in foreign %} - {% with sqs_obj.object as obj %} - - {% endwith %} - {% endfor %} -
{% trans "За рубежом" %}
- - - - - - - - - - - - - - - +
- {% thumbnail obj.get_logo '109x114' as im %} - - {% endthumbnail %} -
- {% if obj.get_event_place_name %} - - {{ obj.get_event_place_name }} - {% endif %} -
{{ obj.name|safe }}
- - {{ obj.get_dates }} -
- {% for tag in obj.tags %} - {{ tag.name }}{% if not forloop.last %},{% endif %} + + + + {% for sqs_obj in foreign %} + {% with sqs_obj.object as obj %} + + {% endwith %} {% endfor %} - - -
+ + + + + + + + + + + + + + + + +
+ + {% thumbnail obj.get_logo '120x120' as im %} + + {% endthumbnail %} + +
+ {% if obj.get_event_place_name %} + + {{ obj.get_event_place_name }} + {% endif %} +
{{ obj.name|safe }}
+ + {{ obj.get_dates }} +
+ {% for tag in obj.tags %} + {{ tag.name }}{% if not forloop.last %},{% endif %} + {% endfor %} +
+
+
-
- {% trans "Посмотреть все" %} +
+ {% trans "Посмотреть все" %} +
@@ -393,11 +464,11 @@
{{ news.preview|safe|striptags }}{{ news.preview|safe|truncatewords_html:25 }}
- {% trans "Все новости" %} + {% trans "Все новости" %}
@@ -445,7 +516,7 @@
- {% trans "посмотреть Подробнее" %} + {% trans "посмотреть Подробнее" %}
@@ -469,11 +540,11 @@
- - - - - + + + + +
@@ -494,7 +565,7 @@ - {% trans "Настроить" %} + {% trans "Настроить" %} diff --git a/proj/middleware.py b/proj/middleware.py index 62b2d743..15b61b69 100644 --- a/proj/middleware.py +++ b/proj/middleware.py @@ -120,7 +120,7 @@ MIDDLEWARE_CLASSES += ('core_utils.middleware.SpacelessMiddleware',) class SpacelessMiddleware(object): """ trim spaces between tags if not in DEBUG """ def process_response(self, request, response): - if response.get('Content-Type').startswith('text/html'): + if response.get('Content-Type', '').startswith('text/html'): cont = strip_spaces_between_tags(response.content) response.content = re.sub(r'^\s+<','<', cont) return response