diff --git a/exposition/views.py b/exposition/views.py index fc5dfba7..22ab24bd 100644 --- a/exposition/views.py +++ b/exposition/views.py @@ -344,6 +344,8 @@ class ExpoCatalog(MetadataMixin, ListView): context['year'] = self.year context['month'] = self.month context['catalog_url'] = self.catalog_url + if self.kwargs.get('tag'): + context['tag_for_filter'] = self.kwargs['tag'] return context class ExpoCountryCatalog(ExpoCatalog): diff --git a/proj/settings.py b/proj/settings.py index 5331016b..c1c02a3d 100644 --- a/proj/settings.py +++ b/proj/settings.py @@ -404,6 +404,7 @@ MONTHES = {'jan': {'value': 1, 'name': _(u'Январь')}, 'feb': {'value': 2, SNG_COUNTRIES = [159, 186, 31, 6, 99, 13, 189, 64] + CLIENT_DATE_FORMAT = ["%d.%m.%Y"] # cache pages in random seconds. random in this range diff --git a/proj/views.py b/proj/views.py index 86de716f..a8e97c2d 100644 --- a/proj/views.py +++ b/proj/views.py @@ -17,9 +17,12 @@ from functions.custom_views import ExpoListView from accounts.forms import RegistrationCompleteForm def expo_context(request): + banners_themes = [24, 34, 4] + banner_tags = [141, 142, 143, 156, 206, 231, 232, 390, 391, 400, 457, 500, 536, 537, 539, 457, 500, 686, 715, 765, 766, 857, 927, 964, 971, 972, 987, 1009, 1010, 1021, 2508, 2509, 2516, 2518, 2536, 2568, 2583, 2585, 3811, 3940, 4130, 4192, 4236, 4512, 4841, 5353, 5532, 5854, 106, 107, 195, 380, 930, 931, 932, 3845, 3846, 3863, 3873, 4141, 4142, 4343, 4344, 4347, 211, 212, 277, 631] cont = {'theme_search_form': ThemeSearch(), 'expo_catalog': Exposition.catalog, 'book_aid': settings.BOOKING_AID, 'blogs': Article.objects.main_page_blogs(), - 'news_list': Article.objects.main_page_news(), 'sng_countries': settings.SNG_COUNTRIES + 'news_list': Article.objects.main_page_news(), 'sng_countries': settings.SNG_COUNTRIES, + 'banner_themes' : banners_themes, 'banner_tags' : banner_tags } user = request.user diff --git a/templates/client/exposition/exposition_list.html b/templates/client/exposition/exposition_list.html index 066233b2..e0ed9b03 100644 --- a/templates/client/exposition/exposition_list.html +++ b/templates/client/exposition/exposition_list.html @@ -24,7 +24,8 @@ {% block page_title %}

{% if meta %}{{ meta.h1 }}{% else %}{% trans 'Выставки' %}{% endif %}

- + {% with a=[111,2] %} + {% endwith %}
{% include 'includes/exposition/catalog_filter_period.html' %} diff --git a/templates/client/includes/banners/expo_detail.html b/templates/client/includes/banners/expo_detail.html new file mode 100644 index 00000000..cf20ae7b --- /dev/null +++ b/templates/client/includes/banners/expo_detail.html @@ -0,0 +1,13 @@ +{% load static %} +{% load template_filters %} + +
+{% with themes=object.theme.all %} + {% for theme in themes %} + {% if theme.id in banner_themes %} + + {% endif %} + + {% endfor %} +{% endwith %} +
\ No newline at end of file diff --git a/templates/client/includes/banners/expo_list_baner.html b/templates/client/includes/banners/expo_list_baner.html new file mode 100644 index 00000000..4044fc53 --- /dev/null +++ b/templates/client/includes/banners/expo_list_baner.html @@ -0,0 +1,6 @@ +{% load static %} +
+ {% if theme_for_filter.id in banner_themes or tag_for_filter.id in banner_tags %} + + {% endif %} +
\ No newline at end of file diff --git a/templates/client/includes/exposition/exposition_list.html b/templates/client/includes/exposition/exposition_list.html index 92e7eede..6db0694b 100644 --- a/templates/client/includes/exposition/exposition_list.html +++ b/templates/client/includes/exposition/exposition_list.html @@ -92,7 +92,9 @@ - + {% if forloop.counter == 5 or objects|length < 5 %} + {% include 'client/includes/banners/expo_list_baner.html' %} + {% endif %} {% if forloop.counter == 8 %} diff --git a/templates/client/includes/exposition/exposition_object.html b/templates/client/includes/exposition/exposition_object.html index 4ec83e81..eca400f2 100644 --- a/templates/client/includes/exposition/exposition_object.html +++ b/templates/client/includes/exposition/exposition_object.html @@ -134,6 +134,7 @@
{% endif %} + {% include 'client/includes/banners/expo_detail.html' %}
{% trans 'Дополнительная информация' %}