Merged. Task 204(new logo)

remotes/origin/1203
Nazar Kotjuk 10 years ago
commit 327e4532cc
  1. 13
      article/admin.py
  2. 3
      article/admin_urls.py
  3. 6
      article/forms.py
  4. 8
      article/urls.py
  5. 26
      article/views.py
  6. 32
      core/utils.py
  7. 4
      core/views.py
  8. 12
      expobanner/admin.py
  9. 37
      functions/custom_views.py
  10. 6
      proj/admin.py
  11. 11
      templates/admin/article/article_confirm_delete.html
  12. 4
      templates/client/accounts/calendar.html
  13. 14
      templates/client/article/article.html
  14. 3
      templates/client/article/blog_list.html
  15. 10
      templates/client/article/catalog.html
  16. 113
      templates/client/base_page.html
  17. 219
      templates/client/exposition/exposition_price.html
  18. 6
      templates/client/includes/article_theme.html
  19. 6
      templates/client/includes/banners/expo_list_baner.html
  20. 19
      templates/client/includes/banners/under_search.html
  21. 154
      templates/client/includes/exposition/expo_list_paid.html
  22. 2
      templates/client/includes/header.html
  23. 2
      templates/client/popups/login.html
  24. 2
      templates/client/popups/register.html
  25. BIN
      templates/client/static_client/img/logo_beta.png
  26. 9
      theme/views.py

@ -5,6 +5,7 @@ from django.core.context_processors import csrf
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.contrib.contenttypes.models import ContentType
from django.views.generic import DeleteView
#models and forms
from forms import ArticleForm, ArticleDeleteForm, Article, NewsForm
from theme.models import Tag
@ -16,6 +17,18 @@ from functions.custom_views import objects_list, add_object_with_file, delete_ob
from functions.views_help import get_referer
class ArticleDeleteView(DeleteView):
model = Article
template_name = "admin/article/article_confirm_delete.html"
def get_success_url(self):
if self.object.type == 1:
type = "blog"
else:
type = "news"
return "/admin/article/%s/all/" % type
def article_all(request):
"""
Return list of all articles with pagination

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
from django.conf.urls import patterns, url
from admin import BlogList, BlogView, NewsList, NewsView
from admin import BlogList, BlogView, NewsList, NewsView, ArticleDeleteView
urlpatterns = patterns('article.admin',
@ -11,6 +11,7 @@ urlpatterns = patterns('article.admin',
#url(r'^all/$', 'article_all'),
url(r'^blog/all/$', BlogList.as_view()),
url(r'^blog/$', BlogView.as_view()),
url(r'^delete/(?P<slug>.*)/$', ArticleDeleteView.as_view()),
url(r'^news/all/$', NewsList.as_view()),
url(r'^news/$', NewsView.as_view()),

@ -19,7 +19,7 @@ from conference.models import Conference
class BlogForm(forms.Form):
type = Article.blog
theme = forms.ModelMultipleChoiceField(label='Тематики', queryset=Theme.objects.all(), required=False,
theme = forms.ModelMultipleChoiceField(label='Тематики', queryset=Theme.objects.exclude(article__id=None), required=False,
widget=forms.SelectMultiple(attrs={'style':'width: 550px'}))
publish_date = forms.DateField(label=u'Дата публикации', input_formats=['%Y-%m-%d', '%d.%m.%Y'], required=False)
tag = forms.CharField(label=u'Теги', widget=forms.HiddenInput(), required=False)
@ -258,7 +258,7 @@ class BlogForm(forms.ModelForm):
class ArticleFilterForm(forms.Form):
theme = forms.MultipleChoiceField(label=_(u'Тематика:'), required=False,
choices=[(item.id, item.name) for item in Theme.objects.language().all()])
choices=[(item.id, item.name) for item in Theme.objects.language().exclude(article__id=None)])
tag = forms.CharField(label=_(u'Теги:'), widget=forms.HiddenInput(), required=False)
'''
@ -295,4 +295,4 @@ class NewsFilterForm(forms.Form):
super(NewsFilterForm, self).__init__(*args, **kwargs)
ids = [item['theme'] for item in list(Article.objects.news().values('theme').distinct())]
self.fields['theme'] = forms.MultipleChoiceField(label=_(u'Тематика:'), required=False,
choices=[(item.id, item.name) for item in Theme.objects.language().filter(id__in=ids)])
choices=[(item.id, item.name) for item in Theme.objects.language().exclude(article__id=None).filter(id__in=ids)])

@ -1,11 +1,13 @@
# -*- coding: utf-8 -*-
from django.conf.urls import patterns, url
from views import BlogList, NewsList, BlogDetail, NewsDetail, NewsTagCatalog, BlogsTagCatalog
from views import BlogList, NewsList, BlogDetail, NewsDetail, NewsTagCatalog, BlogsFilterCatalog
urlpatterns = patterns('',
url(r'^blogs/tag/(?P<slug>.*)/page/(?P<page>\d+)/$', BlogsTagCatalog.as_view(), {'meta_id':75}),
url(r'^blogs/tag/(?P<slug>.*)/page/(?P<page>\d+)/$', BlogsFilterCatalog.as_view(), {'meta_id':75, 'filter':'tag'}),
url(r'^blogs/theme/(?P<slug>.*)/page/(?P<page>\d+)/$', BlogsFilterCatalog.as_view(), {'filter':'theme'}),
url(r'^blogs/page/(?P<page>\d+)/$', BlogList.as_view(), {'meta_id':79}),
url(r'^blogs/tag/(?P<slug>.*)/$', BlogsTagCatalog.as_view(), {'meta_id':75}),
url(r'^blogs/tag/(?P<slug>.*)/$', BlogsFilterCatalog.as_view(), {'meta_id':75, 'filter':'tag'}),
url(r'^blogs/theme/(?P<slug>.*)/$', BlogsFilterCatalog.as_view(), {'filter':'theme'}),
url(r'^blogs/$', BlogList.as_view(), {'meta_id':79}),

@ -5,11 +5,12 @@ from functions.custom_views import ListView
from django.http import HttpResponse
from models import Article
from forms import ArticleFilterForm
from theme.models import Tag
from theme.models import Tag, Theme
from meta.views import MetadataMixin
class NewsList(MetadataMixin, ListView):
model = Article
template_name = 'article/news_list.html'
@ -53,7 +54,6 @@ class NewsList(MetadataMixin, ListView):
return context
class NewsDetail(MetadataMixin, DetailView):
model = Article
slug_field = 'slug'
@ -163,7 +163,7 @@ class NewsTagCatalog(MetadataMixin, ListView):
class BlogsTagCatalog(MetadataMixin, ListView):
class BlogsFilterCatalog(MetadataMixin, ListView):
model = Article
template_name = 'client/article/catalog.html'
catalog_url = '/blogs/tag/'
@ -171,12 +171,19 @@ class BlogsTagCatalog(MetadataMixin, ListView):
year = None
month = None
def get_queryset(self):
def get_queryset(self, **kwargs):
slug = self.kwargs.get('slug')
tag = get_object_or_404(Tag, url=slug)
self.kwargs['tag'] = tag
self.filter_object = tag
qs = Article.objects.blogs().filter(tag=tag)
filter = self.kwargs['filter']
if filter == 'tag':
tag = get_object_or_404(Tag, url=slug)
self.kwargs['tag'] = tag
self.filter_object = tag
qs = Article.objects.blogs().filter(tag=tag)
else:
theme = get_object_or_404(Theme, url=slug)
self.kwargs['theme'] = theme
self.filter_object = theme
qs = Article.objects.blogs().filter(theme = theme)
year = self.kwargs.get('year')
if year:
@ -201,8 +208,9 @@ class BlogsTagCatalog(MetadataMixin, ListView):
def get_context_data(self, **kwargs):
context = super(BlogsTagCatalog, self).get_context_data(**kwargs)
context = super(BlogsFilterCatalog, self).get_context_data(**kwargs)
context['filter_object'] = self.filter_object
context['type'] = 'article'
context['year'] = self.year
context['month'] = self.month
context['catalog_url'] = self.catalog_url

@ -7,6 +7,21 @@ http://www.simplistix.co.uk/presentations/python-excel.pdf
import xlwt
import datetime
from django.core.exceptions import ObjectDoesNotExist
from django.conf import settings
from django.utils.translation import get_language
current_lang = get_language()[:2]
if current_lang == 'ru':
header_list = [u'#', u'Название события',u'Даты',u'Краткое описание',u'Место проведения', u'Заметка', u'Ссылка на событие']
main_header = u'Мой календарь собитий на {month} {year} года'
else:
header_list = [u'#', u'Event',u'Period',u'Short description',u'Place', u'Notes', u'Hyperlink']
main_header = u'My event calendar on {month} {year}'
HEADER_STYLE = xlwt.easyxf('font: bold on')
DEFAULT_STYLE = xlwt.easyxf()
@ -46,6 +61,12 @@ def get_column_cell(obj, name):
def queryset_to_workbook(queryset, columns, report_date = None):
# localization
if current_lang == 'ru':
month_name = settings.MONTHES[report_date.strftime("%b").lower()]['name']
else:
month_name = report_date.strftime("%B")
# defining styles for different types of cells
main_style = xlwt.Style.easyxf(
"font: name Calibri, height 600, bold False;"
@ -63,13 +84,13 @@ def queryset_to_workbook(queryset, columns, report_date = None):
odd_style = xlwt.Style.easyxf(
'font: name Calibri, height 300, bold False;'
'borders: left thin, right thin, top thin, bottom thin;'
'alignment: horizontal center, wrap True;'
'alignment: horizontal center, vertical center, wrap True;'
'pattern: pattern solid, fore_color white;',
)
even_style = xlwt.Style.easyxf(
'font: name Calibri, height 300, bold False;'
'borders: left thin, right thin, top thin, bottom thin;'
'alignment: horizontal center, wrap True;'
'alignment: horizontal center, vertical center, wrap True;'
'pattern: pattern solid, fore_color silver_ega;',
)
# creating workbook and adding sheet
@ -78,14 +99,15 @@ def queryset_to_workbook(queryset, columns, report_date = None):
sheet_name = u'My calendar {0}'.format(report_date.strftime('%Y-%B'))
sheet = workbook.add_sheet(sheet_name)
# drawing head part with image
sheet.write_merge(0, 6, 0, 6, u'Мой календарь собитий на %s года' % report_date.strftime("%B %Y"), main_style)
sheet.write_merge(0, 6, 0, 6, main_header.format(
month = month_name,year = report_date.strftime("%Y")), main_style)
for i in range(7):
sheet.row(i).set_style(xlwt.Style.easyxf('font:height 300;'))
sheet.insert_bitmap('/home/www/proj/media/logo.bmp', row=0, col=5, x=0, y=0, scale_x=0.3, scale_y=2)
sheet.insert_bitmap('/home/www/proj/static/logo.bmp', row=0, col=5, x=0, y=0, scale_x=0.3, scale_y=2)
# drawing headers
header_list = [u'#', u'Название события',u'Даты',u'Краткое описание',u'Место проведения', u'Заметка', u'Ссылка на событие']
for i, column in enumerate(columns):
sheet.write(8, i, header_list[i], header_style)
sheet.col(i).width = 8000

@ -282,9 +282,9 @@ def download_workbook(request):
setattr(obj, 'dates', u'%s - %s'%(obj.data_begin.strftime('%d %B %Y'),obj.data_end.strftime('%d %B %Y')))
setattr(obj, 'full_place', u'%s, %s, %s' % (obj.country, obj.city, getattr(obj.place, 'name', '')))
try:
setattr(obj, 'link', u'http://www.expomap.ru%s)'%obj.get_absolute_url())
setattr(obj, 'link', u'http://www.expomap.ru%s'%obj.get_absolute_url())
except:
setattr(obj, 'link', u'http://www.expomap.ru%s)'%obj.get_permanent_url())
setattr(obj, 'link', u'http://www.expomap.ru%s'%obj.get_permanent_url())
columns = (
'number',

@ -117,10 +117,10 @@ class BannerStat(DetailView):
date_from, date_to = self.request.GET.get('date_from'), self.request.GET.get('date_to')
if date_from:
date_from = datetime.strptime(date_from, "%d.%m.%Y")
qs = qs.filter(date__gt=date_from)
qs = qs.filter(date__gte=date_from)
if date_to:
date_to = datetime.strptime(date_to, "%d.%m.%Y")
qs = qs.filter(date__lt=date_to)
qs = qs.filter(date__lte=date_to)
context['stats'] = qs
return context
@ -195,10 +195,10 @@ class PaidStat(DetailView):
date_from, date_to = self.request.GET.get('date_from'), self.request.GET.get('date_to')
if date_from:
date_from = datetime.strptime(date_from, "%d.%m.%Y")
qs = qs.filter(date__gt=date_from)
qs = qs.filter(date__gte=date_from)
if date_to:
date_to = datetime.strptime(date_to, "%d.%m.%Y")
qs = qs.filter(date__lt=date_to)
qs = qs.filter(date__lte=date_to)
context['stats'] = qs
return context
@ -264,10 +264,10 @@ class MainStat(DetailView):
date_from, date_to = self.request.GET.get('date_from'), self.request.GET.get('date_to')
if date_from:
date_from = datetime.strptime(date_from, "%d.%m.%Y")
qs = qs.filter(date__gt=date_from)
qs = qs.filter(date__gte=date_from)
if date_to:
date_to = datetime.strptime(date_to, "%d.%m.%Y")
qs = qs.filter(date__lt=date_to)
qs = qs.filter(date__lte=date_to)
context['stats'] = qs
return context

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
from django.shortcuts import render_to_response
from django.http import HttpResponseRedirect, HttpResponse
from django.http import HttpResponseRedirect, HttpResponse, Http404
from django.core.context_processors import csrf
from django.conf import settings
from django.contrib.auth.decorators import login_required
@ -20,8 +20,11 @@ import random
from django.views.generic import ListView as OldListView
class ListView(OldListView):
"""
Default Django generic ListView with few overrided methods for redirecting
onto first page of pagination in case of entering big page number(for search engines)
List of modules, where overrided ListView is used:
- accounts.views
- article.views
@ -34,7 +37,37 @@ class ListView(OldListView):
- specialist_catalog.views
- translator.views
"""
paginator_class = settings.DEFAULT_PAGINATOR
def paginate_queryset(self, queryset, page_size):
"""
Paginate the queryset, if needed.
"""
paginator = self.get_paginator(queryset, page_size, allow_empty_first_page=self.get_allow_empty())
page_kwarg = self.page_kwarg
page = self.kwargs.get(page_kwarg) or self.request.GET.get(page_kwarg) or 1
try:
page_number = int(page)
except ValueError:
if page == 'last':
page_number = paginator.num_pages
else:
raise Http404(_("Page is not 'last', nor can it be converted to an int."))
try:
page = paginator.page(page_number)
self.kwargs['home'] = False
except EmptyPage as e:
page = paginator.page(1)
self.kwargs['home'] = True
return (paginator, page, page.object_list, page.has_other_pages())
def get(self, request, *args, **kwargs):
response = super(ListView, self).get(request, *args, **kwargs)
if self.kwargs.get("home"):
path = self.request.path
return HttpResponseRedirect(path[:path.find('page')])
else:
return response
@login_required
def filtered_list(request, objects, template, item_per_page=settings.ADMIN_PAGINATION):

@ -3,7 +3,7 @@ from django.shortcuts import render_to_response
from django.http import HttpResponseRedirect, HttpResponse, Http404
from django.contrib.contenttypes.models import ContentType
from django.conf import settings
from django.views.generic import TemplateView
from django.views.generic import TemplateView, DeleteView
from file.models import TmpFile, FileModel
from file.forms import FileModelForm, FileForm
from city.models import City
@ -13,6 +13,10 @@ from django.db.models.loading import get_model
class AdminIndex(TemplateView):
template_name = 'admin/base.html'

@ -0,0 +1,11 @@
{% extends 'base.html' %}
{% block sidebar %}{% endblock %}
{% block body %}
<form action="" method="post">{% csrf_token %}
<div class="controls">
<p>Вы точно хотите удалить "{{ object }}" ?</p>
<input class="btn btn-large btn-danger delete" type="submit" value="Да" />
<a class="btn btn-large btn-primary" href = "/admin/article/blog/all">Нет</a>
</div>
</form>
{% endblock %}

@ -65,11 +65,11 @@
}
console.log(clear_list);
var query = $.param({data:clear_list});
if(clear_list.Length > 0){
if(clear_list.length > 0){
window.location.href = "/profile/calendar/export/?" + query;
}
else{
alert({% trans "Не выбрано ни одного события!" %})
alert('{% trans "Не выбрано ни одного события!" %}');
}
});

@ -19,7 +19,7 @@
{% include 'client/includes/article/article_logo.html' with obj=object %}
<h1>{{ object.main_title }}</h1>
<strong><span>{{ object.publish_date|date:"d E Y" }}</span><a class="profile_link" href="{{ object.author.get_permanent_url }}" title="">{{ object.author.get_full_name }}</a></strong>
<strong><span>{{ object.created|date:"d E Y" }}</span>{% if object.theme.all.exists %}{% include 'includes/article_theme.html' with obj=object %}{% endif %}</strong>
{% if request.user.is_admin %}
<a target="_blank" class="button green " href="/admin/article/blog/{{ object.slug }}/">{% trans 'изменить' %}</a>
{% endif %}
@ -30,18 +30,6 @@
</div>
<div class="blog_avtor">
<table>
<tr>
<th>{% trans 'Автор' %}:</th>
<td><a href="{{ object.author.get_permanent_url }}" title="">{% include 'includes/show_logo.html' with obj=object.author %}</a></td>
<td>
<h3><a href="{{ object.author.get_permanent_url }}" title="">{{ object.author.get_full_name }}</a></h3>
{% if object.author.profile.fb %}
<a href="{{ object.author.profile.fb }}" title="" class="facebook">{{ object.author.get_full_name }}</a>
{% endif %}
</td>
</tr>
</table>
{% if object.tag.all.exists %}
<div class="blog_avtor_right">
{% include 'includes/article_tags.html' with obj=object %}

@ -45,7 +45,8 @@
<script>
EXPO.newsFilter.init({
theme:{
placeholder:"{% trans 'Укажите тематику' %}"
placeholder:"{% trans 'Укажите тематику' %}",
url:'http://{{ request.get_host }}/theme/get-tag/'
},
tags:{
placeholder:"{% trans 'Выберите ключевые теги' %}",

@ -30,7 +30,15 @@
{% block page_title %}
<div class="page-title">
<h1>{% if meta %}{{ meta.h1 }}{% else %}{% trans 'Новости' %}: <strong>{{ filter_object.name }}</strong>{% endif %}</h1>
<h1>{% if meta %}
{{ meta.h1 }}
{% else %}
{% if type == "article" %}
{% trans 'Статьи' %}:
{% else %}
{% trans 'Новости' %}:
{% endif %}
<strong>{{ filter_object.name }}</strong>{% endif %}</h1>
</div>
{% ifequal catalog_url '/news/tag/' %}

@ -0,0 +1,113 @@
{% extends 'blank.html' %}
{% load static %}
{% load i18n %}
{% load template_filters %}
{% block main_part %}
<section class="layout main-part">
<div class="layout-wrap">
<aside>
<div class="sbg"></div>
{% include 'menu.html' %}
<hr/>
{% include 'client/includes/feedback.html' %}
<hr />
{% include 'client/includes/online_consult.html' %}
{% block aside_banner1 %}
{% if theme_for_filter.id == 27 or theme_for_filter.id == 9 or theme_for_filter.id == 48 %}
<div class="sbnr">
<div class="sbnr-wrap">
<a href="/redirect/redirect/11/" target="_blank">
<img src="{% static 'client/img/partners/ipsa_.gif' %}" alt="" />
</a>
</div>
</div>
{% endif %}
{% endblock %}
{% include 'client/includes/services.html' %}
<hr />
{% include 'client/includes/announces.html' %}
{% block asside_banner2 %}
<!-- task EXPO-145-->
{% comment %}
<div class="sbnr">
<div class="sbnr-wrap">
<a href="/redirect/redirect/11/">
<img src="{% static 'client/img/partners/imgo.jpg' %}" alt="" />
</a>
</div>
</div>
{% endcomment %}
{% endblock %}
{% include 'client/includes/side_confs.html' %}
<hr />
<div class="s-news-list">
{% include 'client/includes/news.html' with news=news_list %}
</div>
{% block aside_vk %}
<div class="vk-widget">
{% include 'client/includes/social_widjet.html' %}
</div>
{% endblock %}
</aside>
<div class="mcl">
{% with search_form=search_form %}
{% include 'client/includes/catalog_search.html' %}
{% endwith %}
{% block under_search_baner %}
{% include 'client/includes/banners/under_search.html' %}
{% endblock %}
{% block bread_scrumbs %}
{% endblock %}
<div class="page-title">
{% block page_title %}
{% endblock %}
</div>
{% block page_filter %}
{% endblock %}
{% block page_body %}
<div class="page-body clearfix">
{% block content_list %}
{% endblock %}
{% block paginator %}
{% endblock %}
{% block content_footer_banner %}
{% endblock %}
</div>
{% block content_text %}
{% comment %}
{% with filter=filter %}
{% include 'includes/event_list_description.html' %}
{% endwith %}
{% endcomment %}
{% endblock %}
{% endblock %}
</div>
</div>
</section>
{% endblock %}

@ -0,0 +1,219 @@
{% extends 'base_catalog.html' %}
{% load static %}
{% load i18n %}
{% load template_filters %}
{% block content_list %}
{% block content_text %}
{% block page_body %}
<div class="m-article">
<div class="item-wrap event clearfix">
<aside>
{% if object_list.0.expohit %}
<div class="hit"></div>
{% endif %}
<div class="i-pict">
{% with obj=object_list.0 %}
{% include 'client/includes/show_logo.html' %}
{% endwith %}
</div>
<!--
<div class="i-rating" title="Рейтинг: 551">551</div>
-->
<div class="i-stats">
{% if object_list.0.visitors %}
<span class="visitors" title="Посетители">{{ object_list.0.visitors }}</span>
{% endif %}
{% if object_list.0.members %}
<span class="participants" title="Участники">{{ object_list.0.members }}</span>
{% endif %}
</div>
<div class="i-discount">
{% if object_list.0.discount %}
<a class="discount-button" href="#">{% trans 'Скидка' %} -{{ object_list.0.discount }}%</a>
<div class="dsc-text">{{ object_list.0.discount_description|safe }}</div>
{% endif %}
</div>
</aside>
<div class="i-info">
<header>
<div class="i-title">
{% if object_list.0.main_title %}
{{ object_list.0.main_title|safe }}
{% else %}
{{ object_list.0.name|safe }}
{% endif %}
</div>
</header>
<div class="i-date">
{% with obj=object_list.0 %}
{% include 'client/includes/show_date_block.html' %}
{% endwith %}
</div>
{% if object_list.0.place %}
<div class="i-address">
<header>
<div class="address">
{{ object_list.0.place.address.address }}
</div>
<div class="show-map"><a class="toggle-map" href="#">{% trans 'Раскрыть карту' %}</a></div>
</header>
<div class="i-map">
<div class="close-map"><a class="toggle-map" href="#">{% trans 'Скрыть карту' %}</a>
</div>
<div class="map-canvas" id="map-canvas"
data-coords="{{ object_list.0.place.address.lat }},{{ exposition.place.address.lng }}"></div>
</div>
</div>
{% endif %}
</div>
</div>
<div class="e-price">
<div class="sect-title">{% trans 'Стоимость посещения и участия' %}</div>
<div class="ep-wrap">
<div class="e-price-wrap">
<div class="epr-layout">
<div class="eprl-col">
<div class="epr-title"><span>{% trans 'Для посещения' %}</span></div>
<div class="epr-subtitle">{% trans 'Стоимость билетов' %}</div>
<div class="tp-wrap">
<ul class="pr-list">
{% if object_list.0.price_day %}
<li>
<div class="prl-value">{{ object_list.0.price_day }} €</div>
<div class="prl-descr"><span>{% trans 'на 1 день' %}</span></div>
</li>
{% endif %}
{% if object_list.0.price_all %}
<li>
<div class="prl-value">{{ object_list.0.price_all }} €</div>
<div class="prl-descr"><span>{% trans 'на все дни' %}</span></div>
</li>
{% endif %}
</ul>
<div class="tp-descr">{% trans 'Предварительная регистрация' %}</div>
</div>
<div class="tp-wrap">
<ul class="pr-list gray">
{% if object_list.0.price_day_bar %}
<li>
<div class="prl-value">{{ object_list.0.price_day_bar }} €</div>
<div class="prl-descr"><span>на 1 день</span></div>
</li>
{% endif %}
{% if object_list.0.price_all_bar %}
<li>
<div class="prl-value">{{ object_list.0.price_all_bar }} €</div>
<div class="prl-descr"><span>{% trans 'на все дни' %}</span></div>
</li>
{% endif %}
</ul>
<div class="tp-descr gray">{% trans 'Регистрация на' %}&nbsp;{% trans 'стойке' %}</div>
</div>
<div class="tp-btn-wrap">
<div class="tp-btn">
<a class="button big orange b-more" href="#">{% trans 'Заказать билет' %}</a>
</div>
<div class="tp-categories">
<div class="tpc-title">{% trans 'Выставка открыта для' %}:</div>
<ul>
{{ object_list.0.get_audience }}
</ul>
</div>
</div>
</div>
<div class="eprl-col">
<div class="epr-title"><span>{% trans 'Для участия' %}</span></div>
<div class="epr-subtitle">{% trans 'Стоимость аренды 1м²' %}</div>
<ul class="pr-list">
{% if object_list.0.max_closed_equipped_area %}
<li>
<div class="prl-value">{{ object_list.0.max_closed_equipped_area }} €</div>
<div class="prl-descr"><span>{% trans 'оборудованная площадь' %}</span></div>
</li>
{% endif %}
{% if object_list.0.max_closed_area %}
<li>
<div class="prl-value">{{ object_list.0.max_closed_area }} €</div>
<div class="prl-descr"><span>{% trans 'необорудованная площадь' %}</span></div>
</li>
{% endif %}
{% if object_list.0.max_open_area %}
<li>
<div class="prl-value">{{ object_list.0.max_open_area }} €</div>
<div class="prl-descr"><span>{% trans 'открытая площадь' %}</span></div>
</li>
{% endif %}
</ul>
<a class="button big orange b-more" href="#">{% trans 'Заявка на участие' %}</a>
<div class="epr-conditons">
{% if object_list.0.min_stand_size %}
<p>{% trans 'Минимальный размер стенда' %} — {{ object_list.0.min_stand_size }}м²</p>
{% endif %}
{% if object_list.0.registration_payment %}
<p>{% trans 'Регистрационный взнос' %} — {{ object_list.0.registration_payment }}€</p>
{% endif %}
{% if object_list.0.application_deadline %}
<p>{% trans 'Крайний срок подачи заявки' %} — {{ object_list.0.application_deadline }}</p>
{% endif %}
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="ed-back">
<a href="/{{ filter|generate_url:'event' }}">{{ object_list.0.name|safe }}</a>
</div>
<div class="i-sub-articles">
<ul>
{% for service in object_list.0.get_services %}
<li><a href="#">{{ service.name }}</a></li>
{% endfor %}
</ul>
</div>
{% endblock %}
{% endblock %}
{% endblock %}

@ -0,0 +1,6 @@
{% with theme=obj.theme.all %}
{% for theme in obj.theme.all %}
<a href="{{ obj.get_catalog }}theme/{{ theme.url }}/" title="">{{ theme.name }}</a>{% if forloop.counter != themes|length %},{% endif %}
{% endfor %}
{% endwith %}

@ -0,0 +1,6 @@
{% load static %}
<div class="abn">
{% if theme_for_filter.id in banner_themes or tag_for_filter.id in banner_tags %}
<a target="_blank" href="/redirect/redirect/24/"><img src="{% static 'client/img/partners/unnamed_2.gif' %}" alt="" /></a>
{% endif %}
</div>

@ -0,0 +1,19 @@
{% load static %}
{% load template_filters %}
<div class="abn">
{% with r=False|random4 %}
{% ifequal r 0 %}
<a target="_blank" href="/redirect/redirect/57/"><img src="{% static 'client/img/partners/cemat15_900x130_bilet.gif' %}" alt="" /></a>
{% endifequal %}
{% ifequal r 1 %}
<a target="_blank" href="/redirect/redirect/58/"><img src="{% static 'client/img/partners/beach.png' %}" alt="" /></a>
{% endifequal %}
{% ifequal r 2 %}
<a target="_blank" href="/redirect/redirect/59/"><img src="{% static 'client/img/partners/mims15_900x130_bilet.gif' %}" alt="" /></a>
{% endifequal %}
{% ifequal r 3 %}
<a target="_blank" href="/redirect/redirect/61/"><img src="{% static 'client/img/partners/IPSA_2015_web_900x130.gif' %}" alt="" /></a>
{% endifequal %}
{% endwith %}
</div>

@ -0,0 +1,154 @@
{% load static %}
{% load i18n %}
{% load template_filters %}
{% with objects=object_list %}
{% if objects %}
<ul class="cat-list cl-exhibitions">
{% for obj in objects %}
<li class="cl-item {% if obj.canceled %}canceled{% endif %}">
<div class="cl-item-wrap clearfix">
<a href="{{ obj.get_permanent_url }}">
{% if obj.canceled %}
<div class="cancel"></div>
{% else %}
{% if obj.expohit %}
<div class="hit"></div>
{% endif %}
{% endif %}
<div class="cli-pict">
{% with obj=obj %}
{% include 'client/includes/show_logo.html' %}
{% endwith %}
</div>
</a>
<div class="cli-info">
<div class="cli-top clearfix">
{% if obj.quality_label.ufi.is_set %}
<div class="cli-approved">
<img src="{% static 'client/img/approved-logo.png' %}" alt="" title="Approved Event" />
</div>
{% endif %}
<header>
<div class="cli-title"><a href="{{ obj.get_permanent_url }}">{{ obj.name|safe }}</a></div>
</header>
<div class="cli-descr">
{{ obj.main_title|safe }}
</div>
</div>
<div class="cli-bot clearfix">
<div class="cli-date">
{% with obj=obj %}
{% include 'client/includes/show_date_block.html' %}
{% endwith %}
</div>
{% if obj.country %}
<div class="cli-place">
<a href="{{ obj.catalog }}country/{{ obj.country.url }}/">{{ obj.country }}</a>, <a href="{{ obj.catalog }}city/{{ obj.city.url }}/">{{ obj.city }}</a>
{% if obj.place %}
, <a href="/places/{{ obj.place.url }}/">{{ obj.place }}</a>
{% endif %}
</div>
{% endif %}
</div>
</div>
<div class="cli-buttons clearfix">
<div class="cli-m-buttons">
{% include 'client/includes/exposition/services.html' with obj=obj %}
{% include 'client/includes/calendar_button.html' with obj=obj%}
<div class="{% if request.user.is_authenticated%}note-wrap{% else %}note-wrap-disabled{% endif %}">
{% with note=obj|note_by_user:request.user %}
<a class="button green icon-note {% if note %}active{% endif %} note-button" href="/expo/add-note/{{ obj.url }}/">{% trans 'заметка' %}</a>
<div class="note-overlay">
<form action="">
<textarea name="note_text" class="note-text"> {{ note }}</textarea>
</form>
</div>
{% endwith %}
</div>
{% if request.user.is_admin %}
<div class="note-wrap">
<a class="button green " href="/admin/exposition/{{ obj.url }}/">{% trans 'изменить' %}</a>
</div>
{% endif %}
<div></div>
</div>
<div class="cli-s-buttons">
{% include 'client/buttons/booking_button.html' with object=obj %}
</div>
</div>
</div>
<footer class="clearfix">
<div class="cli-stats">
{% if obj.visitors %}
<span class="visitors" title="Посетители">{{ obj.visitors }}</span>
{% endif %}
{% if obj.members %}
<span class="participants" title="Участники">{{ obj.members }}</span>
{% endif %}
</div>
<div class="cli-tags">
{% include 'client/includes/exposition/tags.html' with obj=obj %}
</div>
</footer>
</li>
{% if forloop.counter == 8 %}
<!-- Яндекс.Директ -->
<script type="text/javascript">
yandex_partner_id = 58151;
yandex_site_bg_color = 'FFFFFF';
yandex_ad_format = 'direct';
yandex_font_size = 1;
yandex_direct_type = 'horizontal';
yandex_direct_border_type = 'block';
yandex_direct_limit = 3;
yandex_direct_title_font_size = 3;
yandex_direct_border_radius = true;
yandex_direct_links_underline = false;
yandex_direct_header_bg_color = 'FEEAC7';
yandex_direct_bg_color = 'FFF9F0';
yandex_direct_border_color = 'FBE5C0';
yandex_direct_title_color = '666666';
yandex_direct_url_color = '000000';
yandex_direct_text_color = '000000';
yandex_direct_hover_color = 'FF3333';
yandex_direct_sitelinks_color = '666666';
yandex_direct_favicon = false;
yandex_no_sitelinks = false;
document.write('<scr'+'ipt type="text/javascript" src="//an.yandex.ru/system/context.js"></scr'+'ipt>');
</script>
{%endif %}
{% endfor %}
</ul>
{% else %}
<p class="message-not-found">
<span class="message">
{% trans "Выставки по указанным параметрам не найдены. Попробуйте задать менее точный запрос по теме или расширить период времени" %}
</span>
</p>
{% endif %}
{% endwith %}
{% block scripts %}
{% if request.GET.debug == '1' %}
<script src="{% static 'client/js/_modules/block.exposition.list.js' %}"></script>
{% else %}
<script src="{% static 'client/js_min/_modules/block.exposition.list.min.js' %}"></script>
{% endif %}<script>
EXPO.exposition.list.init({
note:{
wrapClass:'note-wrap',
wrapDisabledClass:'note-wrap-disabled',
buttonClass:'note-button',
inputClass:'note-text'
},
addCalendarText:"{% trans 'В расписание' %}",
removeCalendarText:"{% trans 'Из расписания' %}"
});
</script>
{% endblock %}

@ -5,7 +5,7 @@
<header class="layout">
<div class="header-wrap layout-wrap">
<div class="logo beta">
<h2><a href="/"><strong>Expomap</strong> <b>{% trans 'Выставки, конференции, семинары' %}</b></a></h2>
<h2><a href="/"><strong style="padding-top: 89px; width: 235px;">Expomap</strong> </a></h2>
</div>
<div class="header-body mcl">

@ -36,8 +36,6 @@
<ul>
<li><a href="{% url 'social:begin' 'facebook' %}?next={{ request.path }}"><img src="{% static 'client/img/soc-medias/icon-fb.png' %}" alt="" /></a></li>
<li><a href="{% url 'social:begin' 'twitter' %}?next={{ request.path }}"><img src="{% static 'client/img/soc-medias/icon-twit.png' %}" alt="" /></a></li>
<li><a href="{% url 'social:begin' 'google-oauth' %}?next={{ request.path }}"><img src="{% static 'client/img/soc-medias/icon-goog.png' %}" alt="" /></a></li>
<li><a href="{% url 'social:begin' 'linkedin' %}?next={{ request.path }}"><img src="{% static 'client/img/soc-medias/icon-lin.png' %}" alt="" /></a></li>
<li><a href="{% url 'social:begin' 'odnoklassniki-oauth2' %}?next={{ request.path }}"><img src="{% static 'client/img/soc-medias/icon-ok.png' %}" alt="" /></a></li>
<li><a href="{% url 'social:begin' 'mailru-oauth2' %}?next={{ request.path }}"><img src="{% static 'client/img/soc-medias/icon-mailr.png' %}" alt="" /></a></li>
<li><a href="{% url 'social:begin' 'vk-oauth2' %}?next={{ request.path }}"><img src="{% static 'client/img/soc-medias/icon-vk.png' %}" alt="" /></a></li>

@ -56,8 +56,6 @@
<ul>
<li><a href="{% url 'social:begin' 'facebook' %}?next={{ request.path }}"><img src="{% static 'client/img/soc-medias/icon-fb.png' %}" alt="" /></a></li>
<li><a href="{% url 'social:begin' 'twitter' %}?next={{ request.path }}"><img src="{% static 'client/img/soc-medias/icon-twit.png' %}" alt="" /></a></li>
<li><a href="{% url 'social:begin' 'google-oauth' %}?next={{ request.path }}"><img src="{% static 'client/img/soc-medias/icon-goog.png' %}" alt="" /></a></li>
<li><a href="{% url 'social:begin' 'linkedin' %}?next={{ request.path }}"><img src="{% static 'client/img/soc-medias/icon-lin.png' %}" alt="" /></a></li>
<li><a href="{% url 'social:begin' 'odnoklassniki-oauth2' %}?next={{ request.path }}"><img src="{% static 'client/img/soc-medias/icon-ok.png' %}" alt="" /></a></li>
<li><a href="{% url 'social:begin' 'mailru-oauth2' %}?next={{ request.path }}"><img src="{% static 'client/img/soc-medias/icon-mailr.png' %}" alt="" /></a></li>
<li><a href="{% url 'social:begin' 'vk-oauth2' %}?next={{ request.path }}"><img src="{% static 'client/img/soc-medias/icon-vk.png' %}" alt="" /></a></li>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 10 KiB

@ -7,10 +7,11 @@ def get_tag(request):
#if request.is_ajax():
themes = request.GET.getlist('themes[]')
term = request.GET['term'].capitalize()
if not term:
qs = Tag.objects.language().filter(theme__id__in=themes).order_by('translations__name').distinct()
else:
qs = Tag.objects.language().filter(theme__id__in=themes, translations__name__contains=term).distinct()
qs = Tag.objects.language().exclude(theme__article__id=None).distinct()
if term:
qs = qs.filter(translations__name__contains=term)
if themes:
qs = qs.filter(theme__id__in=themes).order_by('translations__name')
result = [{'id': tag.id, 'label': '%s (%s)'%(tag.name, tag.theme.name)} for tag in qs]
result = sorted(result, key=lambda x:x['label'])

Loading…
Cancel
Save