Merged from develop 28.09.2015

remotes/origin/1203
Nazar Kotjuk 10 years ago
commit bfd487e425
  1. 13
      article/admin.py
  2. 3
      article/admin_urls.py
  3. 8
      article/forms.py
  4. 2
      article/models.py
  5. 8
      article/urls.py
  6. 26
      article/views.py
  7. 33
      core/utils.py
  8. 6
      core/views.py
  9. 12
      expobanner/admin.py
  10. 37
      functions/custom_views.py
  11. 14
      functions/form_check.py
  12. 6
      proj/admin.py
  13. 6
      settings/templatetags/template_filters.py
  14. 4
      static/custom_js/main.js
  15. 11
      templates/admin/article/article_confirm_delete.html
  16. 2
      templates/client/accounts/calendar.html
  17. 14
      templates/client/article/article.html
  18. 5
      templates/client/article/blog_list.html
  19. 10
      templates/client/article/catalog.html
  20. 113
      templates/client/base_page.html
  21. 219
      templates/client/exposition/exposition_price.html
  22. 6
      templates/client/includes/article_theme.html
  23. 6
      templates/client/includes/banners/expo_list_baner.html
  24. 19
      templates/client/includes/banners/under_search.html
  25. 8
      templates/client/includes/conference/default_description.html
  26. 13
      templates/client/includes/exposition/default_description.html
  27. 154
      templates/client/includes/exposition/expo_list_paid.html
  28. 1
      templates/client/includes/exposition/exposition_object.html
  29. 16
      templates/client/includes/exposition/price.html
  30. 2
      templates/client/includes/header.html
  31. 2
      templates/client/popups/login.html
  32. 2
      templates/client/popups/register.html
  33. BIN
      templates/client/static_client/img/logo_beta.png
  34. 1
      theme/urls.py
  35. 33
      theme/views.py

@ -5,6 +5,7 @@ from django.core.context_processors import csrf
from django.conf import settings from django.conf import settings
from django.contrib.auth.decorators import login_required from django.contrib.auth.decorators import login_required
from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes.models import ContentType
from django.views.generic import DeleteView
#models and forms #models and forms
from forms import ArticleForm, ArticleDeleteForm, Article, NewsForm from forms import ArticleForm, ArticleDeleteForm, Article, NewsForm
from theme.models import Tag 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 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): def article_all(request):
""" """
Return list of all articles with pagination Return list of all articles with pagination

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

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

@ -81,7 +81,7 @@ class Article(TranslatableModel):
old_id = models.IntegerField(blank=True, null=True) old_id = models.IntegerField(blank=True, null=True)
logo = ImageField(upload_to='articles_preview', blank=True) logo = ImageField(upload_to='articles_preview', blank=True)
theme = models.ManyToManyField('theme.Theme') theme = models.ManyToManyField('theme.Theme')
tag = models.ManyToManyField('theme.Tag', related_name='tags',blank=True, null=True) tag = models.ManyToManyField('theme.Tag', blank=True, null=True)
author = models.ForeignKey('accounts.User', verbose_name='Автор', author = models.ForeignKey('accounts.User', verbose_name='Автор',
on_delete=models.PROTECT, related_name='articles') on_delete=models.PROTECT, related_name='articles')
exposition = models.ForeignKey('exposition.Exposition', blank=True, null=True) exposition = models.ForeignKey('exposition.Exposition', blank=True, null=True)

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

@ -6,8 +6,23 @@ http://www.simplistix.co.uk/presentations/python-excel.pdf
""" """
import xlwt import xlwt
import datetime import datetime
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist from django.core.exceptions import ObjectDoesNotExist
from django.conf import settings
from django.utils.translation import get_language
import os
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') HEADER_STYLE = xlwt.easyxf('font: bold on')
DEFAULT_STYLE = xlwt.easyxf() DEFAULT_STYLE = xlwt.easyxf()
@ -47,6 +62,12 @@ def get_column_cell(obj, name):
def queryset_to_workbook(queryset, columns, report_date = None): 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 # defining styles for different types of cells
main_style = xlwt.Style.easyxf( main_style = xlwt.Style.easyxf(
"font: name Calibri, height 600, bold False;" "font: name Calibri, height 600, bold False;"
@ -64,13 +85,13 @@ def queryset_to_workbook(queryset, columns, report_date = None):
odd_style = xlwt.Style.easyxf( odd_style = xlwt.Style.easyxf(
'font: name Calibri, height 300, bold False;' 'font: name Calibri, height 300, bold False;'
'borders: left thin, right thin, top thin, bottom thin;' '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;', 'pattern: pattern solid, fore_color white;',
) )
even_style = xlwt.Style.easyxf( even_style = xlwt.Style.easyxf(
'font: name Calibri, height 300, bold False;' 'font: name Calibri, height 300, bold False;'
'borders: left thin, right thin, top thin, bottom thin;' '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;', 'pattern: pattern solid, fore_color silver_ega;',
) )
# creating workbook and adding sheet # creating workbook and adding sheet
@ -80,13 +101,13 @@ def queryset_to_workbook(queryset, columns, report_date = None):
sheet = workbook.add_sheet(sheet_name) sheet = workbook.add_sheet(sheet_name)
# drawing head part with image # 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): for i in range(7):
sheet.row(i).set_style(xlwt.Style.easyxf('font:height 300;')) sheet.row(i).set_style(xlwt.Style.easyxf('font:height 300;'))
sheet.insert_bitmap(settings.MEDIA_ROOT + 'logo.bmp', row=0, col=5, x=0, y=0, scale_x=0.3, scale_y=2) sheet.insert_bitmap(os.path.join(settings.MEDIA_ROOT, 'logo.bmp'), row=0, col=5, x=0, y=0, scale_x=0.3, scale_y=2)
# drawing headers # drawing headers
header_list = [u'#', u'Название события',u'Даты',u'Краткое описание',u'Место проведения', u'Заметка', u'Ссылка на событие']
for i, column in enumerate(columns): for i, column in enumerate(columns):
sheet.write(8, i, header_list[i], header_style) sheet.write(8, i, header_list[i], header_style)
sheet.col(i).width = 8000 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, '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', ''))) setattr(obj, 'full_place', u'%s, %s, %s' % (obj.country, obj.city, getattr(obj.place, 'name', '')))
try: 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: 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 = ( columns = (
'number', 'number',
@ -297,7 +297,7 @@ def download_workbook(request):
workbook = queryset_to_workbook(qs, columns, earliest_event) workbook = queryset_to_workbook(qs, columns, earliest_event)
response = HttpResponse(content_type='application/vnd.ms-excel') response = HttpResponse(content_type='application/vnd.ms-excel')
response['Content-Disposition'] = 'attachment; filename="My calendar.xls"' response['Content-Disposition'] = 'attachment; filename="My calendar for %s.xls"' % earliest_event.strftime("%B %Y")
workbook.save(response) workbook.save(response)
return response return response
else: else:

@ -117,10 +117,10 @@ class BannerStat(DetailView):
date_from, date_to = self.request.GET.get('date_from'), self.request.GET.get('date_to') date_from, date_to = self.request.GET.get('date_from'), self.request.GET.get('date_to')
if date_from: if date_from:
date_from = datetime.strptime(date_from, "%d.%m.%Y") 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: if date_to:
date_to = datetime.strptime(date_to, "%d.%m.%Y") 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 context['stats'] = qs
return context 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') date_from, date_to = self.request.GET.get('date_from'), self.request.GET.get('date_to')
if date_from: if date_from:
date_from = datetime.strptime(date_from, "%d.%m.%Y") 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: if date_to:
date_to = datetime.strptime(date_to, "%d.%m.%Y") 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 context['stats'] = qs
return context 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') date_from, date_to = self.request.GET.get('date_from'), self.request.GET.get('date_to')
if date_from: if date_from:
date_from = datetime.strptime(date_from, "%d.%m.%Y") 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: if date_to:
date_to = datetime.strptime(date_to, "%d.%m.%Y") 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 context['stats'] = qs
return context return context

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from django.shortcuts import render_to_response 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.core.context_processors import csrf
from django.conf import settings from django.conf import settings
from django.contrib.auth.decorators import login_required from django.contrib.auth.decorators import login_required
@ -20,8 +20,11 @@ import random
from django.views.generic import ListView as OldListView from django.views.generic import ListView as OldListView
class ListView(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: List of modules, where overrided ListView is used:
- accounts.views - accounts.views
- article.views - article.views
@ -34,7 +37,37 @@ class ListView(OldListView):
- specialist_catalog.views - specialist_catalog.views
- translator.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 @login_required
def filtered_list(request, objects, template, item_per_page=settings.ADMIN_PAGINATION): def filtered_list(request, objects, template, item_per_page=settings.ADMIN_PAGINATION):

@ -15,12 +15,9 @@ def is_positive_integer(data,
else: else:
raise ValidationError(msg) raise ValidationError(msg)
from django.utils.encoding import smart_str, smart_unicode
from slugify import slugify import unicodedata
def translit_with_separator(string, separator='-'): def translit_with_separator(string, separator='-'):
#return slugify(string)
""" """
Trsanslit string and replace "bad" symbols for separator Trsanslit string and replace "bad" symbols for separator
@ -30,15 +27,13 @@ def translit_with_separator(string, separator='-'):
#make string unicode #make string unicode
string = string.strip() string = string.strip()
string = u'%s'%string string = smart_unicode(string)
#make string translit #make string translit
try: try:
st = pytils.translit.translify(string) st = pytils.translit.translify(string)
except ValueError: except ValueError:
# remove exception symbs(hack) string = unicodedata.normalize('NFKD', string).encode('ascii','ignore')
string = string.replace(u'\u200e', '')
string = string.replace(u'\u200b', '')
st = pytils.translit.translify(string) st = pytils.translit.translify(string)
#replace "bad" symbols for '-'symbol #replace "bad" symbols for '-'symbol
@ -54,7 +49,6 @@ def translit_with_separator(string, separator='-'):
return st.lower() return st.lower()
def is_latin_char(uchr): def is_latin_char(uchr):
latin_letters= {} latin_letters= {}
try: return latin_letters[uchr] try: return latin_letters[uchr]

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

@ -141,8 +141,10 @@ def timesince_exp(value, date=None):
""" """
delta = timedelta(days=28) delta = timedelta(days=28)
d = date -value d = date -value
if d>delta:
return True if d > delta:
if date.month== value.month:
return True
return False return False
@register.filter @register.filter

@ -88,7 +88,8 @@ function postTimetable(data, textStatus){
function postStat(data, textStatus){ function postStat(data, textStatus){
if(data.success){ if(data.success){
location.reload;
window.location.reload();
} }
else{ else{
$.each(data.errors, function(field_name, errors){ $.each(data.errors, function(field_name, errors){
@ -424,7 +425,6 @@ $(document).ready(function(){
$('#stat_form').on('submit', function(e){//submit(function(){ $('#stat_form').on('submit', function(e){//submit(function(){
e.preventDefault(); e.preventDefault();
var url = '/admin/ajax_post_stat/' + $('#obj_id').val() + '/'; var url = '/admin/ajax_post_stat/' + $('#obj_id').val() + '/';
console.log(url)
var formData = $(this).serialize(); var formData = $(this).serialize();
$.ajax({ $.ajax({

@ -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 %}

@ -69,7 +69,7 @@
window.location.href = "/profile/calendar/export/?" + query; window.location.href = "/profile/calendar/export/?" + query;
} }
else{ else{
alert('{% trans "Не выбрано ни одного события!" %}') alert('{% trans "Не выбрано ни одного события!" %}');
} }
}); });

@ -19,7 +19,7 @@
{% include 'client/includes/article/article_logo.html' with obj=object %} {% include 'client/includes/article/article_logo.html' with obj=object %}
<h1>{{ object.main_title }}</h1> <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 %} {% if request.user.is_admin %}
<a target="_blank" class="button green " href="/admin/article/blog/{{ object.slug }}/">{% trans 'изменить' %}</a> <a target="_blank" class="button green " href="/admin/article/blog/{{ object.slug }}/">{% trans 'изменить' %}</a>
{% endif %} {% endif %}
@ -30,18 +30,6 @@
</div> </div>
<div class="blog_avtor"> <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 %} {% if object.tag.all.exists %}
<div class="blog_avtor_right"> <div class="blog_avtor_right">
{% include 'includes/article_tags.html' with obj=object %} {% include 'includes/article_tags.html' with obj=object %}

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

@ -30,7 +30,15 @@
{% block page_title %} {% block page_title %}
<div class="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> </div>
{% ifequal catalog_url '/news/tag/' %} {% 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>

@ -1,7 +1,7 @@
{% load i18n %} {% load i18n %}
<div class="ied-text"> <div class="ied-text" style="text-align: justify">
{% blocktrans with name=conf.name%} {% blocktrans with name=conf.name%}
<p class="text-indent-1-5em">Конференция {{name}} проходит {% endblocktrans %}{% include 'client/includes/show_date_block.html' with obj=conf %} <p>Конференция {{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' %} {% 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}}. в городе {{city}}, {{country}}.
Посмотреть, как проехать в место проведения конференции, можно на сайте конгрессной площадки. Посмотреть, как проехать в место проведения конференции, можно на сайте конгрессной площадки.
@ -15,7 +15,7 @@
<p class="text-indent-1-5em">Если Вам требуется размещение, мы рекомендуем посмотреть отели и цены в период проведения конференции <a href="http://www.booking.com/searchresults.html?aid=333667&city={{ id }}&do_availability_check=on&label=conf_search&lang={{ code }}&checkin_monthday={{ date1 }}&checkin_year_month={{ date2 }}-{{ date3 }}&checkout_monthday={{ date4 }}&checkout_year_month={{ date5 }}-{{ date6 }}">здесь</a>. <p class="text-indent-1-5em">Если Вам требуется размещение, мы рекомендуем посмотреть отели и цены в период проведения конференции <a href="http://www.booking.com/searchresults.html?aid=333667&city={{ id }}&do_availability_check=on&label=conf_search&lang={{ code }}&checkin_monthday={{ date1 }}&checkin_year_month={{ date2 }}-{{ date3 }}&checkout_monthday={{ date4 }}&checkout_year_month={{ date5 }}-{{ date6 }}">здесь</a>.
Не забудьте проверить место и даты конференции на официальном сайте и в календаре организатора. Событие могут перенести, Не забудьте проверить место и даты конференции на официальном сайте и в календаре организатора. Событие могут перенести,
отменить, объединить с проектом схожей тематики. Expomap не несет ответственности за неточности отменить, объединить с проектом схожей тематики. Expomap не несет ответственности за неточности
предоставляемой информации. предоставляемой информации.</p>
Есть вопрос по участию в {{name}} ? Ответим по тел. <b>+7 (499) 999-12-07</b></p> Есть вопрос по участию в {{name}} ? Ответим по тел. <b>+7 (499) 999-12-07</b>
{% endblocktrans %} {% endblocktrans %}
</div> </div>

@ -1,12 +1,11 @@
{% load i18n %} {% load i18n %}
<div class="ied-text"> <div class="ied-text" style="text-align: justify">
{% blocktrans with name=expo.name %} {% blocktrans with name=expo.name %}
<p class="text-indent-1-5em">Выставка {{ name }} проводится{% endblocktrans %} <p>Выставка {{ name }} проводится{% endblocktrans %}
{% include 'client/includes/show_date_block.html' with obj=expo %} {% include 'client/includes/show_date_block.html' with obj=expo %}
{% blocktrans with city=expo.city.name country=expo.country.name %} в городе {{ city }}, {{ country }} {% blocktrans with city=expo.city.name country=expo.country.name %} в городе {{ city }}, {{ country }}.</p>{% endblocktrans %}
.{% 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' %} {% 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' %}
Экспонируемые продукты и разделы выставки Вы можете посмотреть ниже, в блоке <p>Экспонируемые продукты и разделы выставки Вы можете посмотреть ниже, в блоке
<a href="#additional">«Дополнительная информация».</a> <a href="#additional">«Дополнительная информация».</a>
Полный список участников {{ name }} размещается на официальном сайте выставки и постоянно обновляется. Полный список участников {{ name }} размещается на официальном сайте выставки и постоянно обновляется.
Там же Вы сможете найти экспонентов предыдущего года. Деловая программа {{ name }} обычно публикуется ближе к Там же Вы сможете найти экспонентов предыдущего года. Деловая программа {{ name }} обычно публикуется ближе к
@ -28,7 +27,7 @@
{% blocktrans with name=expo.name %} {% blocktrans with name=expo.name %}
Не забудьте проверить место и даты выставки на официальном сайте и в календаре выставочного комплекса. Не забудьте проверить место и даты выставки на официальном сайте и в календаре выставочного комплекса.
Событие могут перенести, отменить, объединить с проектом схожей тематики. Событие могут перенести, отменить, объединить с проектом схожей тематики.
Expomap не несет ответственности за неточности предоставляемой информации. Expomap не несет ответственности за неточности предоставляемой информации.</p>
Есть вопрос о посещении или участии в {{ name }}? Ответим по тел. <b>+7 (499) 999-12-07</b></p> Есть вопрос о посещении или участии в {{ name }}? Ответим по тел. <b>+7 (499) 999-12-07</b>
{% endblocktrans %} {% endblocktrans %}
</div> </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 %}

@ -73,7 +73,6 @@
</div> </div>
</header> </header>
</div> </div>
\1
{% endif %} {% endif %}
<hr /> <hr />
<div class="i-buttons clearfix"> <div class="i-buttons clearfix">

@ -129,7 +129,7 @@
<li> <li>
<div class="prl-value">{{ exposition.price_day_bar }} {% if exposition.price_day_bar|isdigit %}{{ exposition.get_currency_html }}{% endif %}</div> <div class="prl-value">{{ exposition.price_day_bar }} {% if exposition.price_day_bar|isdigit %}{{ exposition.get_currency_html }}{% endif %}</div>
<div class="prl-descr"><span>на 1 день</span></div> <div class="prl-descr"><span>{% trans 'на 1 день' %}</span></div>
</li> </li>
{% endif %} {% endif %}
{% if exposition.price_all_bar %} {% if exposition.price_all_bar %}
@ -177,14 +177,14 @@
<div class="epr-subtitle">{% trans 'Стоимость аренды 1м²' %}</div> <div class="epr-subtitle">{% trans 'Стоимость аренды 1м²' %}</div>
{% if exposition.max_closed_equipped_area or exposition.max_closed_area or exposition.max_open_area %} {% if exposition.max_closed_equipped_area or exposition.max_closed_area or exposition.max_open_area or exposition.min_closed_area %}
<ul class="pr-list"> <ul class="pr-list">
{% if exposition.max_closed_equipped_area %} {% if exposition.max_closed_equipped_area or exposition.min_closed_equipped_area %}
<li> <li>
<div class="prl-value"> <div class="prl-value">
{% if exposition.min_closed_equipped_area %} {% if exposition.min_closed_equipped_area %}
{{ exposition.min_closed_equipped_area }}-{{ exposition.max_closed_equipped_area }} {{ exposition.get_currency_html }} {{ exposition.min_closed_equipped_area }}{% if exposition.min_closed_equipped_area %}-{{ exposition.max_closed_equipped_area }}{% endif %} {{ exposition.get_currency_html }}
{% else %} {% else %}
{{ exposition.max_closed_equipped_area }} {{ exposition.get_currency_html }} {{ exposition.max_closed_equipped_area }} {{ exposition.get_currency_html }}
{% endif %} {% endif %}
@ -193,11 +193,11 @@
</li> </li>
{% endif %} {% endif %}
{% if exposition.max_closed_area %} {% if exposition.max_closed_area or exposition.min_closed_area %}
<li> <li>
<div class="prl-value"> <div class="prl-value">
{% if exposition.min_closed_area %} {% if exposition.min_closed_area %}
{{ exposition.min_closed_area }}-{{ exposition.max_closed_area }} {{ exposition.get_currency_html }} {{ exposition.min_closed_area }}{% if exposition.max_closed_area %}-{{ exposition.max_closed_area }}{% endif %} {{ exposition.get_currency_html }}
{% else %} {% else %}
{{ exposition.max_closed_area }} {{ exposition.get_currency_html }} {{ exposition.max_closed_area }} {{ exposition.get_currency_html }}
{% endif %} {% endif %}
@ -206,11 +206,11 @@
</li> </li>
{% endif %} {% endif %}
{% if exposition.max_open_area %} {% if exposition.max_open_area or exposition.min_open_area %}
<li> <li>
<div class="prl-value"> <div class="prl-value">
{% if exposition.min_open_area %} {% if exposition.min_open_area %}
{{ exposition.min_open_area }}-{{ exposition.max_open_area }} {{ exposition.get_currency_html }} {{ exposition.min_open_area }}{% if exposition.max_open_area %}-{{ exposition.max_open_area }}{% endif %} {{ exposition.get_currency_html }}
{% else %} {% else %}
{{ exposition.max_open_area }} {{ exposition.get_currency_html }} {{ exposition.max_open_area }} {{ exposition.get_currency_html }}
{% endif %} {% endif %}

@ -5,7 +5,7 @@
<header class="layout"> <header class="layout">
<div class="header-wrap layout-wrap"> <div class="header-wrap layout-wrap">
<div class="logo beta"> <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>
<div class="header-body mcl"> <div class="header-body mcl">

@ -36,8 +36,6 @@
<ul> <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' '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' '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' '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' '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> <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> <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' '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' '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' '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' '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> <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

@ -3,4 +3,5 @@ from django.conf.urls import patterns, url
urlpatterns = patterns('', urlpatterns = patterns('',
url(r'^get-tag/$', 'theme.views.get_tag'), url(r'^get-tag/$', 'theme.views.get_tag'),
url(r'^get-article-tags/$', 'theme.views.get_article_tags'),
) )

@ -5,15 +5,30 @@ from theme.models import Tag
def get_tag(request): def get_tag(request):
#if request.is_ajax(): #if request.is_ajax():
themes = request.GET.getlist('themes[]') themes = request.GET.getlist('themes[]')
term = request.GET['term'].capitalize() term = request.GET['term'].capitalize()
if not term: qs = Tag.objects.language().exclude(theme__article__id=None).distinct()
qs = Tag.objects.language().filter(theme__id__in=themes).order_by('translations__name').distinct() if term:
else: qs = qs.filter(translations__name__contains=term)
qs = Tag.objects.language().filter(theme__id__in=themes, translations__name__contains=term).distinct() if themes:
result = [{'id': tag.id, 'label': '%s (%s)'%(tag.name, tag.theme.name)} for tag in qs] qs = qs.filter(theme__id__in=themes).order_by('translations__name')
result = sorted(result, key=lambda x:x['label']) result = [{'id': tag.id, 'label': '%s (%s)'%(tag.name, tag.theme.name)} for tag in qs]
result = sorted(result, key=lambda x:x['label'])
return HttpResponse(json.dumps(result), content_type='application/json') return HttpResponse(json.dumps(result), content_type='application/json')
#else: #else:
# return HttpResponse('not ajax') # return HttpResponse('not ajax')
def get_article_tags(request):
themes = request.GET.getlist('themes[]')
term = request.GET['term'].capitalize()
qs = Tag.objects.language().exclude(article=None).filter(article__type=1).distinct()
if themes:
qs = qs.filter(theme__id__in=themes).order_by('translations__name')
if term:
qs = qs.filter(translations__name__contains=term)
result = [{'id': tag.id, 'label': '%s (%s)'%(tag.name, tag.theme.name)} for tag in qs]
result = sorted(result, key=lambda x:x['label'])
return HttpResponse(json.dumps(result), content_type='application/json')
Loading…
Cancel
Save