diff --git a/accounts/user_catalog_urls.py b/accounts/user_catalog_urls.py index 6ebf7656..60fdaf9d 100644 --- a/accounts/user_catalog_urls.py +++ b/accounts/user_catalog_urls.py @@ -3,14 +3,14 @@ from django.contrib.auth.decorators import login_required from views import SettingsView, ProfileView, CalendarView, UserView, UserExpositionsView, UserConferenceView, UserSeminarView urlpatterns = patterns('', - url(r'^(?P.*)/expositions/(?P\d+)/$', UserExpositionsView.as_view()), - url(r'^(?P.*)/expositions/$', UserExpositionsView.as_view()), + url(r'^(?P.*)/expositions/(?P\d+)/$', UserExpositionsView.as_view(), {'meta_id': 72}), + url(r'^(?P.*)/expositions/$', UserExpositionsView.as_view(), {'meta_id': 72}), url(r'^(?P.*)/seminars/(?P\d+)/$', UserSeminarView.as_view()), url(r'^(?P.*)/seminars/$', UserSeminarView.as_view()), - url(r'^(?P.*)/conferences/(?P\d+)/$', UserConferenceView.as_view()), - url(r'^(?P.*)/conferences/$', UserConferenceView.as_view()), + url(r'^(?P.*)/conferences/(?P\d+)/$', UserConferenceView.as_view(), {'meta_id': 73}), + url(r'^(?P.*)/conferences/$', UserConferenceView.as_view(), {'meta_id': 73}), url(r'^(?P.*)/events/(?P\d+)/$', UserView.as_view()), url(r'^(?P.*)/events/$', UserView.as_view()), - url(r'^(?P.*)/$', UserView.as_view()), + url(r'^(?P.*)/$', UserView.as_view(), {'meta_id': 71}), ) diff --git a/accounts/views.py b/accounts/views.py index ba8d445c..e4eb1243 100644 --- a/accounts/views.py +++ b/accounts/views.py @@ -207,21 +207,27 @@ class ProfileCompanyView(TemplateView): - -class UserView(TemplateView): +from meta.views import MetadataMixin +class UserView(MetadataMixin, TemplateView): """ display user information for another users """ - template_name = 'accounts/user.html' + template_name = 'client/accounts/user.html' - def get_context_data(self, **kwargs): - context = super(UserView, self).get_context_data(**kwargs) + def get_user(self): url = self.kwargs.get('url') + try: url = int(url) user = get_object_or_404(User, id=url) except ValueError: user = get_object_or_404(User, url=url) + self.kwargs['user_full_name'] = user.get_full_name() + return user + + def get_context_data(self, **kwargs): + user = self.get_user() + context = super(UserView, self).get_context_data(**kwargs) if user == self.request.user: profile = user.profile @@ -388,7 +394,7 @@ class UserEventView(ListView): context['event_type'] = self.event_type return context -class UserExpositionsView(UserEventView): +class UserExpositionsView(MetadataMixin, UserEventView): """ return template with list of expos that user joined """ @@ -398,10 +404,11 @@ class UserExpositionsView(UserEventView): url = self.kwargs.get('url') user = get_user(url) self.obj = user + self.kwargs['user_full_name'] = user.get_full_name() return user.get_expos() -class UserConferenceView(UserEventView): +class UserConferenceView(MetadataMixin, UserEventView): """ return template with list of confs that user joined """ @@ -411,6 +418,7 @@ class UserConferenceView(UserEventView): url = self.kwargs.get('url') user = get_user(url) self.obj = user + self.kwargs['user_full_name'] = user.get_full_name() return user.get_confs() class UserSeminarView(UserEventView): diff --git a/company/urls.py b/company/urls.py index 8c42af1c..fefa6e3c 100644 --- a/company/urls.py +++ b/company/urls.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- from django.conf.urls import patterns, url -from views import CompanyView, CompanySearchView, MemberDetail, MemberList, MemberTagList, MemberThemeList +from views import CompanySearchView, MemberDetail, MemberList, MemberTagList, MemberThemeList from django.contrib.auth.decorators import login_required from edit_views import * @@ -14,13 +14,13 @@ urlpatterns = patterns('', #url(r'members/(?P\d+)/$', CompanyView.as_view()), #url(r'members/(?P.*)/$', CompanyView.as_view()), #url(r'members/$', CompanyView.as_view()), - url(r'members/theme/(?P.*)/page/(?P\d+)/$', MemberThemeList.as_view()), - url(r'members/theme/(?P.*)/$', MemberThemeList.as_view()), - url(r'members/tag/(?P.*)/page/(?P\d+)/$', MemberTagList.as_view()), - url(r'members/tag/(?P.*)/$', MemberTagList.as_view()), - url(r'members/page/(?P\d+)/$', MemberList.as_view()), - url(r'members/(?P.*)/$', MemberDetail.as_view()), - url(r'members/$', MemberList.as_view()), + url(r'members/theme/(?P.*)/page/(?P\d+)/$', MemberThemeList.as_view(), {'meta_id':69}), + url(r'members/theme/(?P.*)/$', MemberThemeList.as_view(), {'meta_id':69}), + url(r'members/tag/(?P.*)/page/(?P\d+)/$', MemberTagList.as_view(), {'meta_id':70}), + url(r'members/tag/(?P.*)/$', MemberTagList.as_view(), {'meta_id':70}), + url(r'members/page/(?P\d+)/$', MemberList.as_view(), {'meta_id':67}), + url(r'members/(?P.*)/$', MemberDetail.as_view(), {'meta_id':68}), + url(r'members/$', MemberList.as_view(), {'meta_id':67}), # url(r'company/update/name/(?P.*)/$', login_required(NameView.as_view())), diff --git a/company/views.py b/company/views.py index 3b419b84..80a04032 100644 --- a/company/views.py +++ b/company/views.py @@ -16,6 +16,7 @@ from .edit_forms import NameForm as CompNameForm, HomeForm as CompHomeForm, Phon TagForm as CompTagForm, DescriptionForm as CompDescr, StaffForm as CompStaff, \ FoundationForm as CompFound, SpecializationForm as CompSpec, AddressForm as CompAddress,\ LogoForm as CompLogo, ThemeForm as CompThemeForm +from meta.views import MetadataMixin class CompanySearchView(ListView): @@ -51,7 +52,7 @@ class CompanySearchView(ListView): -class MemberList(ListView): +class MemberList(MetadataMixin, ListView): model = Company paginate_by = settings.CLIENT_PAGINATION template_name = 'client/company/companies_list.html' @@ -61,7 +62,7 @@ class MemberList(ListView): def get_queryset(self): return self.model.objects.order_by('-rating') -class MemberThemeList(ListView): +class MemberThemeList(MetadataMixin, ListView): model = Company paginate_by = settings.CLIENT_PAGINATION template_name = 'client/company/companies_list.html' @@ -72,11 +73,12 @@ class MemberThemeList(ListView): qs = super(MemberThemeList, self).get_queryset() slug = self.kwargs.get('slug') theme = get_object_or_404(Theme, url=slug) + self.kwargs['theme'] = theme qs = qs.filter(theme=theme) return qs -class MemberTagList(ListView): +class MemberTagList(MetadataMixin, ListView): model = Company paginate_by = settings.CLIENT_PAGINATION template_name = 'client/company/companies_list.html' @@ -87,13 +89,15 @@ class MemberTagList(ListView): qs = super(MemberTagList, self).get_queryset() slug = self.kwargs.get('slug') tag = get_object_or_404(Tag, url=slug) + self.kwargs['tag'] = tag qs = qs.filter(tag=tag) + return qs -class MemberDetail(DetailView): +class MemberDetail(MetadataMixin, DetailView): model = Company slug_field = 'url' template_name = 'client/company/company_detail.html' @@ -136,30 +140,6 @@ class MemberDetail(DetailView): return context -class CompanyView(ExpoListView): - paginate_by = 10 - 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['type'] = 'members search' - return context - -class CompanyExposition(CompanyView): - template_name = 'test_list.html' - - def get_queryset(self): - - params = self.get_params() - for param in params: - if param.get('type') == 'event': - company = Company.objects.safe_get(url=param.get('url')) - #query = exp.users - self.params = params - return company.exposition_companies.all() - def create_company(request): response = {'success': False} diff --git a/conference/urls.py b/conference/urls.py index b48894fd..29f29e3b 100644 --- a/conference/urls.py +++ b/conference/urls.py @@ -14,7 +14,7 @@ urlpatterns = patterns('', # search url(r'conference/search/', ExpositionSearchView.as_view()), # country catalog - url(r'conference/country/$', ConferenceByCountry.as_view()), + url(r'conference/country/$', ConferenceByCountry.as_view(), {'meta_id':51}), url(r'conference/country/(?P.*)/(?P\d+)/(?P.*)/page/(?P\d+)/$', ConferenceCountryCatalog.as_view(), {'meta_id':25}), url(r'conference/country/(?P.*)/(?P\d+)/page/(?P\d+)/$', ConferenceCountryCatalog.as_view(), {'meta_id':24}), url(r'conference/country/(?P.*)/page/(?P\d+)/$', ConferenceCountryCatalog.as_view(), {'meta_id':23}), @@ -22,7 +22,7 @@ urlpatterns = patterns('', url(r'conference/country/(?P.*)/(?P\d+)/$', ConferenceCountryCatalog.as_view(), {'meta_id':24}), url(r'conference/country/(?P.*)/$', ConferenceCountryCatalog.as_view(), {'meta_id':23}), # city catalog - url(r'conference/city/$', ConferenceByCity.as_view()), + url(r'conference/city/$', ConferenceByCity.as_view(), {'meta_id':52}), url(r'conference/city/(?P.*)/(?P\d+)/(?P.*)/page/(?P\d+)/$', ConferenceCityCatalog.as_view(), {'meta_id':28}), url(r'conference/city/(?P.*)/(?P\d+)/page/(?P\d+)/$', ConferenceCityCatalog.as_view(), {'meta_id':27}), url(r'conference/city/(?P.*)/page/(?P\d+)/$', ConferenceCityCatalog.as_view(), {'meta_id':26}), @@ -30,7 +30,7 @@ urlpatterns = patterns('', url(r'conference/city/(?P.*)/(?P\d+)/$', ConferenceCityCatalog.as_view(), {'meta_id':27}), url(r'conference/city/(?P.*)/$', ConferenceCityCatalog.as_view(), {'meta_id':26}), # theme catalog - url(r'conference/theme/$', ConferenceByTheme.as_view()), + url(r'conference/theme/$', ConferenceByTheme.as_view(), {'meta_id':50}), url(r'conference/theme/(?P.*)/country/(?P.*)/page/(?P\d+)/$', ConferenceThemeCatalog.as_view()), url(r'conference/theme/(?P.*)/country/(?P.*)/$', ConferenceThemeCatalog.as_view()), url(r'conference/theme/(?P.*)/city/(?P.*)/page/(?P\d+)/$', ConferenceThemeCatalog.as_view()), diff --git a/conference/views.py b/conference/views.py index 9bb44516..4546e609 100644 --- a/conference/views.py +++ b/conference/views.py @@ -24,7 +24,7 @@ from functions.cache_mixin import JitterCacheMixin, CacheMixin MONTHES = settings.MONTHES -class ConferenceBy(ListView): +class ConferenceBy(MetadataMixin, ListView): template_name = 'conference/conference_by.html' title1 = '' title2 = '' diff --git a/core/simple_index_view.py b/core/simple_index_view.py index 182bb9a8..bb0cab57 100644 --- a/core/simple_index_view.py +++ b/core/simple_index_view.py @@ -3,13 +3,14 @@ from django.views.generic import TemplateView from django.shortcuts import HttpResponse #from forms import CallbackForm from service.order_forms import CallBackForm +from meta.views import MetadataMixin -class AdvertisingView(TemplateView): +class AdvertisingView(MetadataMixin, TemplateView): template_name = 'simple_pages/advertising.html' -class AboutView(TemplateView): +class AboutView(MetadataMixin, TemplateView): template_name = 'simple_pages/about.html' diff --git a/exposition/urls.py b/exposition/urls.py index b747313b..71816f65 100644 --- a/exposition/urls.py +++ b/exposition/urls.py @@ -18,7 +18,7 @@ urlpatterns = patterns('', url(r'^expo/search/', ExpositionSearchView.as_view()), # country catalog - url(r'^expo/country/$', ExpositionByCountry.as_view()), + url(r'^expo/country/$', ExpositionByCountry.as_view(), {'meta_id':54}), url(r'^expo/country/(?P.*)/(?P\d+)/(?P.*)/page/(?P\d+)/$', ExpoCountryCatalog.as_view(), {'meta_id':7}), url(r'^expo/country/(?P.*)/(?P\d+)/page/(?P\d+)/$', ExpoCountryCatalog.as_view(), {'meta_id':6}), url(r'^expo/country/(?P.*)/page/(?P\d+)/$', ExpoCountryCatalog.as_view(), {'meta_id':5}), @@ -26,7 +26,7 @@ urlpatterns = patterns('', url(r'^expo/country/(?P.*)/(?P\d+)/$', ExpoCountryCatalog.as_view(), {'meta_id':6}), url(r'^expo/country/(?P.*)/$', ExpoCountryCatalog.as_view(), {'meta_id':5}), # city catalog - url(r'^expo/city/$', ExpositionByCity.as_view()), + url(r'^expo/city/$', ExpositionByCity.as_view(), {'meta_id':53}), url(r'^expo/city/(?P.*)/(?P\d+)/(?P.*)/page/(?P\d+)/$', ExpoCityCatalog.as_view(), {'meta_id':10}), url(r'^expo/city/(?P.*)/(?P\d+)/page/(?P\d+)/$', ExpoCityCatalog.as_view(), {'meta_id':9}), url(r'^expo/city/(?P.*)/page/(?P\d+)/$', ExpoCityCatalog.as_view(), {'meta_id':8}), @@ -34,7 +34,7 @@ urlpatterns = patterns('', url(r'^expo/city/(?P.*)/(?P\d+)/$', ExpoCityCatalog.as_view(), {'meta_id':9}), url(r'^expo/city/(?P.*)/$', ExpoCityCatalog.as_view(), {'meta_id':8}), # theme catalog - url(r'^expo/theme/$', ExpositionByTheme.as_view()), + url(r'^expo/theme/$', ExpositionByTheme.as_view(), {'meta_id':55}), url(r'^expo/theme/(?P.*)/country/(?P.*)/(?P\d+)/(?P.*)/page/(?P\d+)/$', ExpoThemeCatalog.as_view(), {'meta_id':44}), url(r'^expo/theme/(?P.*)/country/(?P.*)/(?P\d+)/(?P.*)/$', ExpoThemeCatalog.as_view(), {'meta_id':44}), url(r'^expo/theme/(?P.*)/country/(?P.*)/(?P\d+)/page/(?P\d+)/$', ExpoThemeCatalog.as_view(), {'meta_id':44}), @@ -63,13 +63,13 @@ urlpatterns = patterns('', url(r'^expo/tag/(?P.*)/(?P\d+)/$', ExpoTagCatalog.as_view(), {'meta_id':15}), url(r'^expo/tag/(?P.*)/$', ExpoTagCatalog.as_view(), {'meta_id':14}), # expo additional pages - url(r'^expo/(?P.*)/statistic/$', ExpositionStatistic.as_view()), - url(r'^expo/(?P.*)/price/$', ExpositionPrice.as_view()), - url(r'^expo/(?P.*)/program/$', ExpositionProgramme.as_view()), - url(r'^expo/(?P.*)/visitors/page/(?P\d+)/$', ExpoVisitors.as_view()), - url(r'^expo/(?P.*)/visitors/$', ExpoVisitors.as_view()), - url(r'^expo/(?P.*)/members/page/(?P\d+)/$', ExpoMembers.as_view()), - url(r'^expo/(?P.*)/members/$', ExpoMembers.as_view()), + url(r'^expo/(?P.*)/statistic/$', ExpositionStatistic.as_view(), {'meta_id':60}), + url(r'^expo/(?P.*)/price/$', ExpositionPrice.as_view(), {'meta_id':61}), + url(r'^expo/(?P.*)/program/$', ExpositionProgramme.as_view(), {'meta_id':62}), + url(r'^expo/(?P.*)/visitors/page/(?P\d+)/$', ExpoVisitors.as_view(), {'meta_id':64}), + url(r'^expo/(?P.*)/visitors/$', ExpoVisitors.as_view(), {'meta_id':64}), + url(r'^expo/(?P.*)/members/page/(?P\d+)/$', ExpoMembers.as_view(), {'meta_id':63}), + url(r'^expo/(?P.*)/members/$', ExpoMembers.as_view(), {'meta_id':63}), url(r'^expo/(?P.*)/service/(?P.*)/', ExpositionServiceView.as_view()), # expo list url(r'^expo/(?P\d+)/(?P.*)/page/(?P\d+)/$', ExpoList.as_view(), {'meta_id':4}), diff --git a/exposition/views.py b/exposition/views.py index 91cbc899..92756eb0 100644 --- a/exposition/views.py +++ b/exposition/views.py @@ -28,7 +28,7 @@ from functions.cache_mixin import JitterCacheMixin, CacheMixin -class ExpositionBy(ListView): +class ExpositionBy(MetadataMixin, ListView): template_name = 'exposition/exposition_by.html' title1 = '' title2 = '' @@ -145,20 +145,20 @@ class ExpoDetail(MetadataMixin, DetailView): context['advertising_form'] = AdvertiseForm() return context -class ExpositionProgramme(DetailView): +class ExpositionProgramme(MetadataMixin, DetailView): model = Exposition slug_field = 'url' template_name = 'client/exposition/programm.html' -class ExpositionPrice(DetailView): +class ExpositionPrice(MetadataMixin, DetailView): model = Exposition slug_field = 'url' template_name = 'client/exposition/price.html' -class ExpositionStatistic(DetailView): +class ExpositionStatistic(MetadataMixin, DetailView): model = Exposition slug_field = 'url' template_name = 'client/exposition/statistic.html' @@ -411,7 +411,7 @@ class ExpoTagCatalog(ExpoCatalog): return qs -class ExpoVisitors(ListView): +class ExpoVisitors(MetadataMixin, ListView): paginate_by = settings.CLIENT_PAGINATION model = Exposition #template_name = 'event_visitors.html' @@ -425,6 +425,7 @@ class ExpoVisitors(ListView): slug = self.kwargs.get('slug') exposition = get_object_or_404(self.model, url=slug) self.obj = exposition + self.object = self.obj return exposition.users.all() def get_context_data(self, **kwargs): @@ -434,7 +435,7 @@ class ExpoVisitors(ListView): return context -class ExpoMembers(ListView): +class ExpoMembers(MetadataMixin, ListView): paginate_by = settings.CLIENT_PAGINATION model = Exposition #template_name = 'event_visitors.html' @@ -448,6 +449,7 @@ class ExpoMembers(ListView): slug = self.kwargs.get('slug') exposition = get_object_or_404(self.model, url=slug) self.obj = exposition + self.object = self.obj return exposition.company.all() def get_context_data(self, **kwargs): diff --git a/meta/models.py b/meta/models.py index e93a489f..ede47701 100644 --- a/meta/models.py +++ b/meta/models.py @@ -49,7 +49,7 @@ class MetaSetting(TranslatableModel): h1 = models.CharField(max_length=255, blank=True), ) - object_params = {'object_name': 'name', 'object_title': 'main_title', 'city': 'city'} + object_params = {'object_name': 'name', 'object_title': 'main_title', 'city': 'city', 'country': 'country'} params = {'month': get_month_inflect, 'country': get_obj_inflect, 'city': get_obj_inflect, 'theme': get_theme_inflect, 'tag': get_tag_inflect} diff --git a/place_exposition/urls.py b/place_exposition/urls.py index 2fe9014b..10f7b2f0 100644 --- a/place_exposition/urls.py +++ b/place_exposition/urls.py @@ -9,19 +9,19 @@ urlpatterns = patterns('', url(r'search/', PlaceSearchView.as_view()), # correct #url(r'country/$', PlaceCountryCatalog.as_view()), - url(r'country/(?P.*)/page/(?P\d+)/$', PlaceCountryCatalog.as_view()), - url(r'country/(?P.*)/$', PlaceCountryCatalog.as_view()), + url(r'country/(?P.*)/page/(?P\d+)/$', PlaceCountryCatalog.as_view(), {'meta_id':49}), + url(r'country/(?P.*)/$', PlaceCountryCatalog.as_view(), {'meta_id':49}), # correct #url(r'expo/city/$', ExpositionByCity.as_view()), - url(r'city/(?P.*)/page/(?P\d+)/$', PlaceCityCatalog.as_view()), - url(r'city/(?P.*)/$', PlaceCityCatalog.as_view()), + url(r'city/(?P.*)/page/(?P\d+)/$', PlaceCityCatalog.as_view(), {'meta_id':48}), + url(r'city/(?P.*)/$', PlaceCityCatalog.as_view(), {'meta_id':48}), #!!! url(r'(?P.*)/photo/page/(?P\d+)/$', PlacePhoto.as_view()), url(r'(?P.*)/photo/$', PlacePhoto.as_view()), #url(r'expo/(?P.*)/service/(?P.*)/$', ExpositionServiceView.as_view()), - url(r'page/(?P\d+)/$', PlaceList.as_view()), - url(r'(?P.*)/$', PlaceDetail.as_view()), + url(r'page/(?P\d+)/$', PlaceList.as_view(), {'meta_id':46}), + url(r'(?P.*)/$', PlaceDetail.as_view(), {'meta_id':47}), - url(r'$', PlaceList.as_view()), + url(r'$', PlaceList.as_view(), {'meta_id':46}), ) diff --git a/place_exposition/views.py b/place_exposition/views.py index fe45ca2d..1b2c33be 100644 --- a/place_exposition/views.py +++ b/place_exposition/views.py @@ -13,6 +13,8 @@ from place_conference.models import PlaceConference from country.models import Country from city.models import City from models import PlaceExposition +from meta.views import MetadataMixin + def catalog(request): expo = list(PlaceExposition.objects.all()) @@ -47,7 +49,7 @@ class PlaceSearchView(ExpoSearchView): search_form = PlaceSearchForm model = PlaceExposition -class PlaceDetail(DetailView): +class PlaceDetail(MetadataMixin, DetailView): model = PlaceExposition search_form = PlaceSearchForm slug_field = 'url' @@ -119,7 +121,7 @@ class PlacePhoto(ListView): return context -class PlaceList(ListView): +class PlaceList(MetadataMixin, ListView): model = PlaceExposition paginate_by = 10 template_name = 'client/place/place_list.html' @@ -137,7 +139,7 @@ class PlaceList(ListView): return context -class PlaceCatalog(ListView): +class PlaceCatalog(MetadataMixin, ListView): model = PlaceExposition paginate_by = 10 template_name = 'place/catalog.html' @@ -160,6 +162,7 @@ class PlaceCountryCatalog(PlaceCatalog): def get_queryset(self): slug = self.kwargs.get('slug') country = get_object_or_404(Country, url=slug) + self.kwargs['country'] = country self.filter_object = country qs = self.model.objects.language().filter(country=country).order_by('-rating') conf_qs = PlaceConference.objects.language().filter(country=country) @@ -173,6 +176,7 @@ class PlaceCityCatalog(PlaceCatalog): def get_queryset(self): slug = self.kwargs.get('slug') city = get_object_or_404(City, url=slug) + self.kwargs['city'] = city self.filter_object = city qs = self.model.objects.language().filter(city=city).order_by('-rating') conf_qs = PlaceConference.objects.language().filter(city=city) diff --git a/proj/urls.py b/proj/urls.py index d9bb0ab7..862d4cd5 100644 --- a/proj/urls.py +++ b/proj/urls.py @@ -2,19 +2,21 @@ from django.conf import settings from django.conf.urls import patterns, include, url from core.simple_index_view import AdvertisingView, AboutView -from views import MainPageView, MainPageViewTest +from views import MainPageView import debug_toolbar from django.views.generic.base import TemplateView +class Robot(TemplateView): + template_name = 'robot.txt' + content_type = 'text/plain' + urlpatterns = patterns('', #url(r'^__debug__/', include(debug_toolbar.urls)), url(r'^admin/', include('proj.admin_urls')), - url(r'^robot\.txt$', TemplateView.as_view(template_name='robots.txt', content_type='text/plain')), + url(r'^robot\.txt$', Robot.as_view()), url(r'^$', MainPageView.as_view()), - url(r'^main_page/$', MainPageViewTest.as_view()), url(r'^theme/', include('theme.urls')), url(r'^places/', include('place_exposition.urls')), - url(r'^', include('accounts.urls')), url(r'^', include('exposition.urls')), url(r'^', include('settings.conference_old_urls')), # conference redirects from old version @@ -31,10 +33,10 @@ urlpatterns = patterns('', url(r'^', include('file.urls')), url(r'^', include('django_messages.expomap_urls')), url(r'^messages/', include('django_messages.urls')), - url(r'^advertising/$', AdvertisingView.as_view()), - url(r'^about/$', AboutView.as_view()), - url(r'^partners/$', AboutView.as_view()), - url(r'^contacts/$', AboutView.as_view()), + url(r'^advertising/$', AdvertisingView.as_view(), {'meta_id':58}), + url(r'^about/$', AboutView.as_view(), {'meta_id':56}), + url(r'^partners/$', AboutView.as_view(), {'meta_id':57}), + url(r'^contacts/$', AboutView.as_view(), {'meta_id':59}), url(r'^social/', include('social.apps.django_app.urls', namespace='social')), url(r'^login/', 'registration.backends.default.views.LoginView'), url(r'^logout/', 'registration.backends.default.views.LogoutView'), diff --git a/proj/views.py b/proj/views.py index 4879ea3a..0e73f49d 100644 --- a/proj/views.py +++ b/proj/views.py @@ -46,29 +46,6 @@ class MainPageView(TemplateView): return context -class MainPageViewTest(TemplateView): - template_name = 'client/main_page.html' - - def get_context_data(self, **kwargs): - context = super(MainPageViewTest, self).get_context_data(**kwargs) - events = Exposition.objects.all().order_by('-main_page')[:5] - exposition_themes = Theme.objects.order_by('-main_page').filter(types=Theme.types.exposition)[:6] - conference_themes = Theme.objects.order_by('-main_page').filter(types=Theme.types.conference)[:6] - seminar_themes = Theme.objects.order_by('-main_page').filter(types=Theme.types.seminar)[:6] - news_list = News.objects.order_by('-main_page').all()[:3] - articles = Article.objects.order_by('-main_page').all()[:2] - - args = {'events': events, 'exposition_themes': exposition_themes, - 'conference_themes': conference_themes, 'seminar_themes': seminar_themes, - 'news_list': news_list, 'articles': articles} - - - context.update(args) - - return context - - - class AdvertisingView(TemplateView): template_name = 'simple_pages/advertising.html' diff --git a/templates/client/company/companies_list.html b/templates/client/company/companies_list.html index 4a2eebbe..944db5fc 100644 --- a/templates/client/company/companies_list.html +++ b/templates/client/company/companies_list.html @@ -17,7 +17,7 @@ {% endblock %} {% block content_list %} - {% include 'includes/company/company_list.html' with object_list=object_list %} + {% include 'client/includes/company/company_list.html' with object_list=object_list %} {% endblock %} {% block paginator %} diff --git a/templates/client/exposition/visitors.html b/templates/client/exposition/visitors.html index 84cfe71b..6762df72 100644 --- a/templates/client/exposition/visitors.html +++ b/templates/client/exposition/visitors.html @@ -17,7 +17,7 @@ {% endblock %} {% block content_list %} - {% include 'includes/exposition/visitors.html' with object_list=object_list %} + {% include 'client/includes/exposition/visitors.html' with object_list=object_list %} {% endblock %} {% block paginator %} diff --git a/templates/client/includes/accounts/simple_user.html b/templates/client/includes/accounts/simple_user.html index 24a897d8..7c28a2f8 100644 --- a/templates/client/includes/accounts/simple_user.html +++ b/templates/client/includes/accounts/simple_user.html @@ -105,13 +105,10 @@ diff --git a/templates/client/includes/company/company_list.html b/templates/client/includes/company/company_list.html index 97b4ae5d..9147a93a 100644 --- a/templates/client/includes/company/company_list.html +++ b/templates/client/includes/company/company_list.html @@ -20,7 +20,7 @@
{% if company.country %}
diff --git a/templates/client/includes/exposition/visitors.html b/templates/client/includes/exposition/visitors.html index a242f08f..ecf0a7d2 100644 --- a/templates/client/includes/exposition/visitors.html +++ b/templates/client/includes/exposition/visitors.html @@ -23,16 +23,17 @@
{{ member.position }}
+ {% comment %} {% if member.country %} {% endif %} + {% endcomment %}