diff --git a/accounts/search_indexes.py b/accounts/search_indexes.py index 898a3ac5..394b9993 100644 --- a/accounts/search_indexes.py +++ b/accounts/search_indexes.py @@ -1,6 +1,6 @@ from haystack import indexes from models import User - +""" class UserIndex(indexes.SearchIndex, indexes.Indexable): text = indexes.CharField(document=True, use_template=True) @@ -18,3 +18,4 @@ class UserIndex(indexes.SearchIndex, indexes.Indexable): def index_queryset(self, using=None): return self.get_model().objects.filter(is_active=True) +""" \ No newline at end of file diff --git a/accounts/views.py b/accounts/views.py index 75271d40..49a33656 100644 --- a/accounts/views.py +++ b/accounts/views.py @@ -30,15 +30,34 @@ class CalendarView(TemplateView): def get_context_data(self, **kwargs): context = super(CalendarView, self).get_context_data(**kwargs) now = timezone.now().replace(microsecond=0, second=0, minute=0, hour=0) + context['current_day'] = now - number_of_days = python_calendar.monthrange(now.year, now.month)[1] - days = [timezone.make_aware(datetime.datetime(now.year, now.month, i+1), timezone.get_default_timezone()) for i in range(number_of_days)] + year = self.request.GET.get('year') + month = self.request.GET.get('month') + # cheack if its int + if year: + year = int(year) + if month: + month = int(month) + + if not year or not month: + number_of_days = python_calendar.monthrange(now.year, now.month)[1] + days = [timezone.make_aware(datetime.datetime(now.year, now.month, i+1), timezone.get_default_timezone()) for i in range(number_of_days)] + + context['days'] = days + + # -------------------- + calendar = self.request.user.calendar + context['events'] = calendar.events_by_month(now) + else: + + number_of_days = python_calendar.monthrange(year, month)[1] + days = [timezone.make_aware(datetime.datetime(year, month, i+1), timezone.get_default_timezone()) for i in range(number_of_days)] + context['days'] = days + calendar = self.request.user.calendar + now = now.replace(year=year, month=month, day=1) + context['events'] = calendar.events_by_month(now) - context['days'] = days - context['current_day'] = now - # -------------------- - calendar = self.request.user.calendar - context['events'] = calendar.events_by_month(now) return context diff --git a/company/management/commands/company_from_old_db.py b/company/management/commands/company_from_old_db.py index 44976daa..15d6e68a 100644 --- a/company/management/commands/company_from_old_db.py +++ b/company/management/commands/company_from_old_db.py @@ -52,11 +52,13 @@ class Command(BaseCommand): company.specialization = c.get('specialize') company.description = c.get('about') company.address_inf = c.get('adress') + user = User.objects.safe_get(id=user_id) + company.creator = user print('not_saved: %s'%c['title']) company.save() user_id = c['customers_id'] print('saved: %s'%str(company)) - user = User.objects.safe_get(id=user_id) + if user: user.company = company if not user.last_login: @@ -66,7 +68,7 @@ class Command(BaseCommand): user.save() theme = None - theme_id = c.get('theme') + theme_id = c.get('otrasly') if theme_id: try: theme = Theme.objects.get(id=theme_id) diff --git a/company/management/commands/company_test.py b/company/management/commands/company_test.py new file mode 100644 index 00000000..a8060e93 --- /dev/null +++ b/company/management/commands/company_test.py @@ -0,0 +1,77 @@ +from django.core.management.base import BaseCommand, CommandError +from company.models import Company +from theme.models import Theme, Tag +from accounts.models import User +from functions.form_check import translit_with_separator +import datetime + +import MySQLdb +from MySQLdb.cursors import DictCursor + +def convert_to_int(st): + if not st: + return None + deduct = ('-','(',')','.',' ') + for elem in deduct: + st = st.replace(elem, '') + if st.isdigit(): + return int(st) + else: + return None + +class Command(BaseCommand): + def handle(self, *args, **options): + db = MySQLdb.connect(host="localhost", + user="root", + passwd="qazedc", + db="expomap_ru", + charset='utf8', + cursorclass=DictCursor) + + cursor = db.cursor() + sql = "select * from customers_company WHere otrasly>0" + cursor.execute(sql) + + res = cursor.fetchall() + print(len(res)) + + for c in res: + id = c['company_id'] + company = Company.objects.safe_get(id=id) + if not company: + continue + + theme_id = c.get('otrasly') + tags = c.get('tags') + + + if theme_id: + try: + theme = Theme.objects.get(id=theme_id) + except Theme.DoesNotExist: + continue + print(theme) + print(company) + company.theme.add(theme) + print('add %s theme to %s company'%(str(theme), str(company))) + print('123') + if not theme: + continue + + + tags = c.get('tags') + if tags: + tags = tags.split(',') + if tags: + for tag_id in tags: + try: + tag = Tag.objects.get(id=tag_id) + except Tag.DoesNotExist: + continue + if tag.theme == theme: + company.tag.add(tag) + print('add %s tag to %s company'%(str(tag), str(company))) + else: + continue + + diff --git a/company/search_indexes.py b/company/search_indexes.py index 6bfe6f7c..2d5cfc4c 100644 --- a/company/search_indexes.py +++ b/company/search_indexes.py @@ -1,12 +1,38 @@ from haystack import indexes from models import Company -class PlaceExpositionIndex(indexes.SearchIndex, indexes.Indexable): +class CompanyIndex(indexes.SearchIndex, indexes.Indexable): text = indexes.CharField(document=True, use_template=True) where = indexes.MultiValueField() + theme = indexes.MultiValueField() + tag = indexes.MultiValueField() + country = indexes.CharField(model_attr='country', null=True) + city = indexes.CharField(model_attr='city', null=True) + + def prepare_country(self, obj): + if obj.country: + return '%s'%obj.country.id + return '' + + def prepare_city(self, obj): + if obj.country: + return '%s'%obj.country.city + return '' + + def prepare_theme(self, obj): + + return [str(th.id) for th in obj.theme.filter()] + + def prepare_tag(self, obj): + return [str(tag.id) for tag in obj.tag.filter()] + def prepare_where(self, obj): - country = [tr.name for tr in obj.country.translations.all()] - city = [tr.name for tr in obj.city.translations.all()] + country = [] + city = [] + if obj.country: + country = [tr.name for tr in obj.country.translations.all()] + if obj.city: + city = [tr.name for tr in obj.city.translations.all()] return country + city diff --git a/company/urls.py b/company/urls.py index 7776b41f..ec022121 100644 --- a/company/urls.py +++ b/company/urls.py @@ -1,8 +1,9 @@ # -*- coding: utf-8 -*- from django.conf.urls import patterns, url -from views import CompanyView +from views import CompanyView, CompanySearchView urlpatterns = patterns('', + url(r'members/search/$', CompanySearchView.as_view()), url(r'members/(?P.*)/(?P\d+)/$', CompanyView.as_view()), url(r'members/(?P\d+)/$', CompanyView.as_view()), url(r'members/(?P.*)/$', CompanyView.as_view()), diff --git a/company/views.py b/company/views.py index a3c0c1a7..1d4a029a 100644 --- a/company/views.py +++ b/company/views.py @@ -2,11 +2,53 @@ from django.http import HttpResponse from models import Company from functions.custom_views import ExpoListView +from django.views.generic import ListView, FormView +from haystack.query import EmptySearchQuerySet import json +from functions.search_forms import CompanySearchForm + + +class CompanySearchView(ListView): + paginate_by = 2 + template_name = 'company/search.html' + search_form = CompanySearchForm + model = Company + + def get_queryset(self): + + if self.request.GET: + form = self.search_form(self.request.GET) + if form.is_valid(): + return form.search() + else: + asdsa + return EmptySearchQuerySet() + else: + return EmptySearchQuerySet() + + + def get_context_data(self, **kwargs): + context = super(CompanySearchView, self).get_context_data(**kwargs) + + context['search_form'] = CompanySearchForm(self.request.GET) + queries = self.request.GET.copy() + if queries.has_key('page'): + del queries['page'] + context['queries'] = queries + context['search_action'] = '/members/search/' + + return context + class CompanyView(ExpoListView): model = Company template_name = 'company_catalog.html' + search_form = CompanySearchForm + + def get_context_data(self, **kwargs): + context = super(CompanyView, self).get_context_data(**kwargs) + context['search_action'] = '/members/search/' + return context class CompanyExposition(CompanyView): template_name = 'test_list.html' diff --git a/exposition/models.py b/exposition/models.py index e71678a7..c02d3c34 100644 --- a/exposition/models.py +++ b/exposition/models.py @@ -158,12 +158,14 @@ class Exposition(TranslatableModel, EventMixin, ExpoMixin): return periodic.get(self.periodic) def get_nearest_events(self): - - theme = self.theme.all()[0] - now = datetime.datetime.now() - now = now.replace(day=now.day-1) - expositions = Exposition.objects.filter(theme__in=[theme], data_begin__gt=now).exclude(id=self.id) - return expositions[3:] + if self.theme.all(): + theme = self.theme.all()[0] + now = datetime.datetime.now() + now = now.replace(day=now.day-1) + expositions = Exposition.objects.filter(theme__in=[theme], data_begin__gt=now).exclude(id=self.id) + return expositions[3:] + else: + return [] def get_catalog_url(self): return '/expositions/' diff --git a/functions/custom_views.py b/functions/custom_views.py index 155fc414..2d1570ea 100644 --- a/functions/custom_views.py +++ b/functions/custom_views.py @@ -215,7 +215,6 @@ class ExpoMixin(object): return params - single_page_filter = {Exposition:'event', Conference:'event', Seminar:'event', Webinar:'event', Company:'member', User:'visitor', Photoreport: 'photoreport'} @@ -226,6 +225,7 @@ class ExpoListView(ExpoMixin, ListView): paginate_by = 2 params = None single_page = False + search_form = None def get_queryset(self): query = self.model.objects.all() @@ -290,6 +290,7 @@ class ExpoListView(ExpoMixin, ListView): context = super(ExpoListView, self).get_context_data(**kwargs) context['filter'] = self.params context['single_page'] = self.single_page + context['search_form'] = self.search_form return context from country.models import Country diff --git a/functions/search_forms.py b/functions/search_forms.py index e1ffc89a..15730b42 100644 --- a/functions/search_forms.py +++ b/functions/search_forms.py @@ -7,10 +7,79 @@ from exposition.models import Exposition from conference.models import Conference from seminar.models import Seminar from webinar.models import Webinar +from company.models import Company +from theme.models import Theme, Tag +from country.models import Country +from city.models import City +import ast + +class AbstactSearchForm(forms.Form): + q = forms.CharField(label=_(u'Поиск'), required=False) + w = forms.CharField(label=_(u'Где'), required=False) + +class CompanySearchForm(AbstactSearchForm): + th = forms.MultipleChoiceField(label=_(u'Тематика'), required=False, + choices=[(theme.id, theme.name) for theme in Theme.objects.filter()]) + tg = forms.MultipleChoiceField(label=_(u'Теги'), required=False, + choices=[(tag.id, tag.name) for tag in Tag.objects.filter()]) + + + c = forms.CharField(label=_(u'Страна'), required=False, widget=forms.SelectMultiple()) + city = forms.CharField(label=_(u'город'), required=False, widget=forms.SelectMultiple()) + + def clean_city(self): + + city = self.cleaned_data.get('city') + if city: + res = ast.literal_eval(city) + return res + return city + + def clean_c(self): + country = self.cleaned_data.get('c') + if country: + res = ast.literal_eval(country) + return res + return country + + + + def search(self): + q = self.cleaned_data.get('q') + w = self.cleaned_data.get('w') + th = self.cleaned_data.get('th') + tg = self.cleaned_data.get('tg') + c = self.cleaned_data.get('c') + city = self.cleaned_data.get('city') + + sqs = SearchQuerySet().models(Company) + + if q: + + sqs = sqs.auto_query(q) + + if w: + sqs = sqs.filter(where__contains=w) + if th: + + sqs = sqs.filter(theme__in=th) + if tg: + sqs = sqs.filter(tag__in=tg) + if c: + sqs = sqs.filter(country__in=c) + if city: + sqs = sqs.filter(country__in=c) + + + + return sqs + class EventSearchForm(forms.Form): q = forms.CharField(label=_(u'Поиск'), required=False) w = forms.CharField(label=_(u'Где'), required=False) + fr = forms.DateField(required=False) + to = forms.DateField(required=False) def search(self): diff --git a/import_xls/excel_settings.py b/import_xls/excel_settings.py index 8dd2c359..cbfd77f3 100644 --- a/import_xls/excel_settings.py +++ b/import_xls/excel_settings.py @@ -195,7 +195,7 @@ def to_audience(value, model=Exposition): def to_theme(value): - if isinstance(value, float): + if isinstance(value, float) or isinstance(value, int): if (value - int(value) > 0): value = str(value) else: @@ -206,7 +206,7 @@ def to_theme(value): theme_objects = [] for id in theme_ids: try: - theme = Theme.objects.language().get(id=int(id)) + theme = Theme.objects.language('ru').get(id=int(id)) theme_objects.append(theme) except Theme.DoesNotExist, ValueError: pass diff --git a/media/imgs/.6 b/media/imgs/.6 new file mode 100644 index 00000000..98d26f44 --- /dev/null +++ b/media/imgs/.6 @@ -0,0 +1,334 @@ + + + + + + - - + + + + + + + + + + + + + + + +  + + + + + + + + + +
 English Francaise Deutsch  + + + + + + + + +
   
+ + + +
+ + + + + + + + +
+ + + + + + + + + + + + + +
  : ,
. , 52 , "-" +
   +: (8552) 470-102
+E-mail: chelnyexpo@gmail.com, expokama1@bk.ru
+ +
+
+ + + + + + + + + + + +
+ +
+
+ + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +



+ +
     
+
+ + + + + +
+ + + + + +
+

+

  • + +
  • +1- +

    +
  • +
    +
    + + + + + + + + + +
    + + + + +

    - - .
    +
    +
    + + + +


    + + +
    + + +
    + + + + + + + + + +
    +
    +
    +
    +
    +
    +
    +
    + + + + +

    + + + + + +
    + + +
    + + + + + + +
    + + +
    + + +
    + + +

    +
    +
    +
    + + + + + + + +
    + + +

    + + +
    +
    + + + + + + + + +
    +
    +
    +
    +TopList  + + + + + +Mail.Ru +   Design by Hotkey +

    +
    + diff --git a/media/imgs/.7 b/media/imgs/.7 new file mode 100644 index 00000000..d266840b --- /dev/null +++ b/media/imgs/.7 @@ -0,0 +1,251 @@ + + + + "" - + + + + + + + + + + + + +
    + + + + + +
    + + + + + + + + + + + + + +
    +
    + + + + + +
      ''
    +
    +
    + + + + + + + + + + + + + +
    + + + + + + + +
    +
    2013 - 2014 +
    +
    +
    >
    + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + +
    + +
    + +
    + +
    + +
    + + -
    + +
    + + + + + + + + + + + + + + + + +
    + 13:49 (GMT +5)

    + :   . +
    + + +
    + +. + + + +
    + + + + +
    +
    + +

    + + + + + + +

    + + + + + + + +
    + + + + + + + +
    + + +
    +
    + + + diff --git a/media/imgs/.8 b/media/imgs/.8 new file mode 100644 index 00000000..93c637c0 --- /dev/null +++ b/media/imgs/.8 @@ -0,0 +1,807 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + +
    + +
    + + + +
    + +
    +
    +
    + + + + + + + +
    + +
    +
    + +
    +
    +
    +
      +
    +
    +
    + +

    +
    +
    + + +
    +
    +
    +    +
    +

    +
    + + / + +
    +
    + + + + + + + + + + +
    + + + + + +
    «» , .
    + +
    , , .
    + +
    , ,
    + +
    +
    +
    + +
    (495) 786 33 33
    + +
    +
    +
    + +
    :
    + +
    , , 16, 1 2.
    + +
    +
    +
    + +

    . ()

    + +
    , . ( , ) . .
    + +

    . ()

    + +
    , ( , ) . .
    + +
    +

    ( )

    + +
    +

    . ()

    + +

    , . ( , ) . . , . .

    + +
    + +

    . ()

    + +

    , ( , ) . .

    + +

    , . .

    +
    + +

    + +
    +

    . ()

    + +

    , . ( , ) . .

    + +

    , (-7). , ( : л)

    + +
    + +

    . ()

    + +

    , ( , ) . .

    + +

    , (-7). , ( : л)

    + +

    olimpiysky_visitor_map.jpg

    +
    + +

    + +
    +

    . ()

    + +

    , . ( , ) . . , (-7). , , л.

    + +
    + +

    . ()

    + +

    , ( , ) . .

    + +

    , (-7). , , л

    +
    + +

    + +
    +

    . ()

    + +

    , . ( , ) .

    + +

    ( ) ( ). , ( ) - . .

    + +
    + +

    . ()

    + +

    , ( , ) .

    + +

    ( ) ( ). , ( ) - . .

    +
    + +

    + +
    +

    . ()

    + +

    , . ( , ) . .

    + +

    , ( , ).

    + +
    + +

    . ()

    + +

    , ( , ) . .

    + +

    , ( , ).

    +
    + +

    1-5 ( )

    + +
    +

    . ()

    + +

    , . ( , ) .

    + +

    , . - .

    + +
    + +

    . ()

    + +

    , ( , ) .

    + +

    , . - .

    +
    + +

    5 8 ( )

    + +
    +

    . ()

    + +

    , . ( , ) . .

    + +

    , ( ). - .

    + +
    + +

    . ()

    + +

    , ( , ) . .

    + +

    , ( ). - .

    +
    +
    + +
    +
    +
    + +
    ...
    +
    +
    + +
    + + +
    + +
    + +
    + + +
    +
      +
    • +
    • +
    • +
    +
    +
    +
    +
    + +
    + + + + + +
    + +
    +
    +
    +
    (495) 786 33 33
    +
    +

    + + + +
    +
    + + . + + + + + +
    +
    +
    + + + +
    +
    +

    + ©
    , 2014
    + +

    + +
    +
    +
    + UnrealArt +
    +
    + ith +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/media/imgs/.9 b/media/imgs/.9 new file mode 100644 index 00000000..cc46b9c0 --- /dev/null +++ b/media/imgs/.9 @@ -0,0 +1,317 @@ + + + + "" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + +
    + + + +
    + RU + EN + 中文 + +
    + + + + + +
    + +
    +
    + +   +
    +
    + +
    + +
    +
    +

    +
    +

    EF_map_plan_all_04.png

    +
    + +
    +
    +
    + +
    +
    + + + +
    + + + + + + + + + + + +. + + + + + + + + + diff --git a/media/imgs/59.1 b/media/imgs/59.1 new file mode 100644 index 00000000..f5cdd408 --- /dev/null +++ b/media/imgs/59.1 @@ -0,0 +1,50 @@ + +План комплекса "Ленэкспо" - Выставочный комплекс «Ленэкспо» +Яндекс.Метрика + + + + + + + diff --git a/media/imgs/expo-volga.1.png b/media/imgs/expo-volga.1.png new file mode 100644 index 00000000..bf9e7765 Binary files /dev/null and b/media/imgs/expo-volga.1.png differ diff --git a/media/imgs/get-file.2.aspx?id=111&DBCode=UploadedFile b/media/imgs/get-file.2.aspx?id=111&DBCode=UploadedFile new file mode 100644 index 00000000..d29ae745 Binary files /dev/null and b/media/imgs/get-file.2.aspx?id=111&DBCode=UploadedFile differ diff --git a/media/imgs/icenew.png b/media/imgs/icenew.png new file mode 100644 index 00000000..d8066e6a Binary files /dev/null and b/media/imgs/icenew.png differ diff --git a/media/imgs/index.1.php b/media/imgs/index.1.php new file mode 100644 index 00000000..38516b96 --- /dev/null +++ b/media/imgs/index.1.php @@ -0,0 +1,471 @@ + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + + + + + +
    + + + +
    + + + + + + +
    + +
    + + +
    + +
    +
    +
    + + +
    +
    +
    + + + + + + +
    + + + +
    +
      + +
    • +
    • + + +
    • +
    • + + +
    • +
    • + + +
    • +
    • + + +
    • +
    • + + +
    • +
    • + + +
    +
    + + +
    + +
    +
    + +
    I- .
    + +
    .
    + +
    , , .
    + +
    .
    + +
    +
    +
    + +
    +
    + +
    ...
    +
    + +
    + +
    +
    +
    + + + + + + + + + + \ No newline at end of file diff --git a/media/imgs/logo.3.png b/media/imgs/logo.3.png new file mode 100644 index 00000000..2fb5872b Binary files /dev/null and b/media/imgs/logo.3.png differ diff --git a/media/imgs/logo.4.png b/media/imgs/logo.4.png new file mode 100644 index 00000000..8f4e23f1 Binary files /dev/null and b/media/imgs/logo.4.png differ diff --git a/media/imgs/logo.5.png b/media/imgs/logo.5.png new file mode 100644 index 00000000..195e96a5 Binary files /dev/null and b/media/imgs/logo.5.png differ diff --git a/media/imgs/logo_scc.1.eps b/media/imgs/logo_scc.1.eps new file mode 100644 index 00000000..3ad566f1 Binary files /dev/null and b/media/imgs/logo_scc.1.eps differ diff --git a/media/imgs/pa-skhema2013.1.pdf b/media/imgs/pa-skhema2013.1.pdf new file mode 100644 index 00000000..f963ef7c Binary files /dev/null and b/media/imgs/pa-skhema2013.1.pdf differ diff --git a/media/photos/57_full.jpeg b/media/photos/57_full.jpeg index e69de29b..12d11b07 100644 Binary files a/media/photos/57_full.jpeg and b/media/photos/57_full.jpeg differ diff --git a/place_conference/search_indexes.py b/place_conference/search_indexes.py index 461f46c8..40363cf0 100644 --- a/place_conference/search_indexes.py +++ b/place_conference/search_indexes.py @@ -5,6 +5,20 @@ from models import PlaceConference class PlaceExpositionIndex(indexes.SearchIndex, indexes.Indexable): text = indexes.CharField(document=True, use_template=True) where = indexes.MultiValueField() + + country = indexes.CharField(model_attr='country', null=True) + city = indexes.CharField(model_attr='city', null=True) + + def prepare_country(self, obj): + if obj.country: + return '%s'%obj.country.id + return '' + + def prepare_city(self, obj): + if obj.city: + return '%s'%obj.country.city + return '' + def prepare_where(self, obj): country = [tr.name for tr in obj.country.translations.all()] city = [tr.name for tr in obj.city.translations.all()] diff --git a/place_exposition/search_indexes.py b/place_exposition/search_indexes.py index 26708af0..b64e19ad 100644 --- a/place_exposition/search_indexes.py +++ b/place_exposition/search_indexes.py @@ -5,6 +5,19 @@ from models import PlaceExposition class PlaceExpositionIndex(indexes.SearchIndex, indexes.Indexable): text = indexes.CharField(document=True, use_template=True) where = indexes.MultiValueField() + country = indexes.CharField(model_attr='country', null=True) + city = indexes.CharField(model_attr='city', null=True) + + def prepare_country(self, obj): + if obj.country: + return '%s'%obj.country.id + return '' + + def prepare_city(self, obj): + if obj.city: + return '%s'%obj.country.city + return '' + def prepare_where(self, obj): country = [tr.name for tr in obj.country.translations.all()] city = [tr.name for tr in obj.city.translations.all()] diff --git a/settings/templatetags/template_filters.py b/settings/templatetags/template_filters.py index b2b104ed..814bb67b 100644 --- a/settings/templatetags/template_filters.py +++ b/settings/templatetags/template_filters.py @@ -7,9 +7,16 @@ register = template.Library() @register.filter def phone(value): # Only one argument. """Converts a string into all lowercase""" - phone = phonenumbers.parse('+'+str(value)) + if value is None: + return '' + try: + phone = phonenumbers.parse('+'+str(value)) + except phonenumbers.NumberParseException: + return '' + return phonenumbers.format_number(phone, phonenumbers.PhoneNumberFormat.INTERNATIONAL) + @register.filter def int_format(value, decimal_points=3, seperator=u' '): value = str(value) diff --git a/static/client/js/profile.js b/static/client/js/profile.js index 16e3566e..e90905b4 100644 --- a/static/client/js/profile.js +++ b/static/client/js/profile.js @@ -125,13 +125,6 @@ $(document).ready(function(){ //$('#id_country').onchange = function(){alert('111');} $('#id_country').on('change', function(){alert('111');}) - - $('.pcm-next, .pcm-prev').on('click', function(e){ - e.preventDefault(); - var url = $(this).attr('href'); - $.get(url, handleCalendar); - - }); }) diff --git a/templates/client/company/search.html b/templates/client/company/search.html new file mode 100644 index 00000000..3e1d5771 --- /dev/null +++ b/templates/client/company/search.html @@ -0,0 +1,31 @@ +{% extends 'base_catalog.html' %} +{% load i18n %} +{% load template_filters %} + +{% block bread_scrumbs %} + +{% endblock %} + +{% block page_title %} +
    +

    {% trans 'Поиск' %}:

    +
    +{% endblock %} + +{% block content_list %} + {% with query=object_list %} + {% include 'includes/company/search_result.html' %} + {% endwith %} +{% endblock %} + +{% block paginator %} + + {% with page_obj=page_obj queries=queries %} + {% include 'includes/search_paginator.html' %} + {% endwith %} + +{% endblock %} \ No newline at end of file diff --git a/templates/client/company_catalog.html b/templates/client/company_catalog.html index fb943baf..90467b7f 100644 --- a/templates/client/company_catalog.html +++ b/templates/client/company_catalog.html @@ -4,7 +4,7 @@ {% load template_filters %} {% if single_page %} - {% block title %} {{ object_list.0.title }} {% endblock %} + {% block title %} {{ object_list.0.name|safe }} {% endblock %} {% block keywords %} {{ object_list.0.keywords }} {% endblock %} {% block descriptions %} {{ object_list.0.descriptions }} {% endblock %} {% endif %} diff --git a/templates/client/event_catalog.html b/templates/client/event_catalog.html index 831c9e72..b7da14f6 100644 --- a/templates/client/event_catalog.html +++ b/templates/client/event_catalog.html @@ -4,7 +4,7 @@ {% load template_filters %} {% if single_page %} - {% block title %} {{ object_list.0.title }} {% endblock %} + {% block title %} {{ object_list.0.name|safe }} {% endblock %} {% block keywords %} {{ object_list.0.keywords }} {% endblock %} {% block descriptions %} {{ object_list.0.descriptions }} {% endblock %} {% endif %} diff --git a/templates/client/includes/accounts/calendar_table.html b/templates/client/includes/accounts/calendar_table.html index 62f21ff9..70ea3a06 100644 --- a/templates/client/includes/accounts/calendar_table.html +++ b/templates/client/includes/accounts/calendar_table.html @@ -9,9 +9,9 @@
    - < + <
    {{ days.0|date:"F"}}’{{ days.0|date:"y"}}
    - > + >
    diff --git a/templates/client/includes/company/company_list.html b/templates/client/includes/company/company_list.html index 38927d6c..845e3d6b 100644 --- a/templates/client/includes/company/company_list.html +++ b/templates/client/includes/company/company_list.html @@ -8,7 +8,7 @@
    diff --git a/templates/client/includes/company/company_object.html b/templates/client/includes/company/company_object.html index 0feac255..76f9d4ae 100644 --- a/templates/client/includes/company/company_object.html +++ b/templates/client/includes/company/company_object.html @@ -2,6 +2,8 @@ {% load i18n %} {% load template_filters %} + + {% block page_body %}
    @@ -24,11 +26,13 @@
    + {% if company.address %} + {% with address=company.address %} + {% include 'includes/address_block.html' %} + {% endwith %} - {% with address=company.address %} - {% include 'includes/address_block.html' %} - {% endwith %} -
    +
    + {% endif %}
    {% with obj=company filter=filter %} @@ -39,15 +43,23 @@
    +
      -
    • Facebook
    • -
    • LinkedIn
    • -
    • В контакте
    • -
    • Twitter
    • + {% if company.facebook %} +
    • Facebook
    • + {% endif %} + {% if company.linkedin %} +
    • LinkedIn
    • + {% endif %} + {% if company.vk %} +
    • В контакте
    • + {% endif %} + {% if company.twitter %} +
    • Twitter
    • + {% endif %}
    - -->

    @@ -157,7 +171,7 @@
    + + {% if company.users.all|length > 5 %} {% trans 'Все сотрудники' %} + {% endif %}
    {% endblock %} \ No newline at end of file diff --git a/templates/client/includes/company/search_result.html b/templates/client/includes/company/search_result.html new file mode 100644 index 00000000..3791a5f2 --- /dev/null +++ b/templates/client/includes/company/search_result.html @@ -0,0 +1,64 @@ +{% load static %} +{% load i18n %} +{% load template_filters %} + + \ No newline at end of file diff --git a/templates/client/includes/event_object.html b/templates/client/includes/event_object.html index 3851b3e9..480aaaa7 100644 --- a/templates/client/includes/event_object.html +++ b/templates/client/includes/event_object.html @@ -29,7 +29,7 @@
    {% if exposition.discount %} Скидка -{{ exposition.discount }}% -
    {{ exposition.discount_description|safe }}
    +
    {{ exposition.discount_description|safe|linebreaks }}
    {% endif %}
    @@ -38,9 +38,9 @@
    {% if exposition.main_title %} - {{ exposition.main_title|safe }} + {{ exposition.main_title|safe|linebreaks }} {% else %} - {{ exposition.name|safe }} + {{ exposition.name|safe|linebreaks }} {% endif %}
    @@ -127,8 +127,8 @@ {% endif %}
    -
    {{ exposition.main_title|safe }}
    -
    {{ exposition.description|safe }}
    +
    {{ exposition.main_title|safe|linebreaks }}
    +
    {{ exposition.description|safe|linebreaks }}

    @@ -169,7 +169,7 @@ {% if exposition.products %}
    {% trans 'Экспонируемые продукты' %}:
    -
    {{ exposition.products|safe }}
    +
    {{ exposition.products|safe|linebreaks }}
    {% endif %} @@ -278,7 +278,7 @@
    - {{ exp.main_title|safe }} + {{ exp.main_title|safe|linebreaks }}
    diff --git a/templates/client/includes/place_object.html b/templates/client/includes/place_object.html index e535a3da..37c24670 100644 --- a/templates/client/includes/place_object.html +++ b/templates/client/includes/place_object.html @@ -18,7 +18,7 @@ {{ place.name|safe }}
    - {{ place.description|safe }} + {{ place.description|safe|linebreaks }}
    @@ -128,7 +128,7 @@
      {% for hall in place.halls.all %} -
    • {{ hall.name }} №{{ hall.number }} — {{ hall.capacity }}
    • +
    • {{ hall.name }} {% if hall.number %} №{{ hall.number }} {% endif %} — {{ hall.capacity }} м2
    • {% endfor %}
    @@ -200,10 +200,10 @@
    - +
    -
    {{ event.main_title|safe }}
    +
    {{ event.main_title|safe|linebreaks }}
    @@ -282,7 +282,7 @@
    {{ pl.get_type }}
    diff --git a/templates/client/place_catalog_test.html b/templates/client/place_catalog_test.html index 597cc402..de70bed1 100644 --- a/templates/client/place_catalog_test.html +++ b/templates/client/place_catalog_test.html @@ -4,7 +4,7 @@ {% load template_filters %} {% if single_page %} - {% block title %} {{ object_list.0.title }} {% endblock %} + {% block title %} {{ object_list.0.name|safe }} {% endblock %} {% block keywords %} {{ object_list.0.keywords }} {% endblock %} {% block descriptions %} {{ object_list.0.descriptions }} {% endblock %} {% endif %}