remotes/origin/1203
Назар Котюк 11 years ago
parent 86c9b1a2a9
commit 4f7dbc8be1
  1. 3
      conference/urls.py
  2. 8
      conference/views.py
  3. 3
      exposition/urls.py
  4. 9
      exposition/views.py
  5. 9
      service/admin_urls.py
  6. 7
      service/urls.py
  7. 31
      service/views.py
  8. 4
      settings/old_urls.py
  9. 12
      settings/redirect_views.py
  10. 6
      templates/client/service/remotely.html
  11. 26
      templates/client/service/thank_u_page.html

@ -2,7 +2,7 @@
from django.conf.urls import patterns, include, url from django.conf.urls import patterns, include, url
from views import ConferenceDetail, ConferenceList, ConferenceByCity, ConferenceByCountry, ConferenceByTheme,\ from views import ConferenceDetail, ConferenceList, ConferenceByCity, ConferenceByCountry, ConferenceByTheme,\
ConferenceCountryCatalog, ConferenceCityCatalog, ConferenceTagCatalog, ConferenceThemeCatalog, ConferenceMembers,\ ConferenceCountryCatalog, ConferenceCityCatalog, ConferenceTagCatalog, ConferenceThemeCatalog, ConferenceMembers,\
ConferenceVisitors, ConferenceServiceView ConferenceVisitors, ConferenceServiceView, ConferenceThankView
from exposition.views import ExpositionSearchView from exposition.views import ExpositionSearchView
urlpatterns = patterns('', urlpatterns = patterns('',
@ -53,6 +53,7 @@ urlpatterns = patterns('',
url(r'conference/(?P<slug>.*)/visitors/$', ConferenceVisitors.as_view()), url(r'conference/(?P<slug>.*)/visitors/$', ConferenceVisitors.as_view()),
url(r'conference/(?P<slug>.*)/members/page/(?P<page>\d+)/$', ConferenceMembers.as_view()), url(r'conference/(?P<slug>.*)/members/page/(?P<page>\d+)/$', ConferenceMembers.as_view()),
url(r'conference/(?P<slug>.*)/members/$', ConferenceMembers.as_view()), url(r'conference/(?P<slug>.*)/members/$', ConferenceMembers.as_view()),
url(r'^conference/(?P<slug>.*)/service/thanks/', ConferenceThankView.as_view()),
url(r'conference/(?P<slug>.*)/service/(?P<service_url>.*)/', ConferenceServiceView.as_view()), url(r'conference/(?P<slug>.*)/service/(?P<service_url>.*)/', ConferenceServiceView.as_view()),
# conf list # conf list

@ -271,6 +271,12 @@ class ConferenceMembers(MetadataMixin, ListView):
from service.models import Service from service.models import Service
from service.views import order_forms from service.views import order_forms
class ConferenceThankView(MetadataMixin, DetailView):
model = Conference
slug_field = 'url'
template_name = 'client/service/thank_u_page.html'
class ConferenceServiceView(FormMixin, DetailView): class ConferenceServiceView(FormMixin, DetailView):
model = Conference model = Conference
slug_field = 'url' slug_field = 'url'
@ -310,7 +316,7 @@ class ConferenceServiceView(FormMixin, DetailView):
order.conference = self.object order.conference = self.object
order.save() order.save()
messages.success(self.request, _(u'Ваш запрос был успешно отправлен')) messages.success(self.request, _(u'Ваш запрос был успешно отправлен'))
return HttpResponseRedirect(self.success_url) return HttpResponseRedirect(self.object.get_permanent_url()+'service/thanks/')
def get_initial(self): def get_initial(self):
""" """

@ -7,7 +7,7 @@ from views import ExpositionStatistic, ExpositionPrice,\
from django.views.decorators.cache import cache_page from django.views.decorators.cache import cache_page
from views import ExpositionServiceView from views import ExpositionServiceView
from views import ExpoCountryCatalog, ExpoCityCatalog, ExpoThemeCatalog, ExpoTagCatalog, ExpoList, ExpoDetail,\ from views import ExpoCountryCatalog, ExpoCityCatalog, ExpoThemeCatalog, ExpoTagCatalog, ExpoList, ExpoDetail,\
ExpoVisitors, ExpoMembers ExpoVisitors, ExpoMembers, ExpositionThankView
urlpatterns = patterns('', urlpatterns = patterns('',
@ -70,6 +70,7 @@ urlpatterns = patterns('',
url(r'^expo/(?P<slug>.*)/visitors/$', ExpoVisitors.as_view(), {'meta_id':64}), url(r'^expo/(?P<slug>.*)/visitors/$', ExpoVisitors.as_view(), {'meta_id':64}),
url(r'^expo/(?P<slug>.*)/members/page/(?P<page>\d+)/$', ExpoMembers.as_view(), {'meta_id':63}), url(r'^expo/(?P<slug>.*)/members/page/(?P<page>\d+)/$', ExpoMembers.as_view(), {'meta_id':63}),
url(r'^expo/(?P<slug>.*)/members/$', ExpoMembers.as_view(), {'meta_id':63}), url(r'^expo/(?P<slug>.*)/members/$', ExpoMembers.as_view(), {'meta_id':63}),
url(r'^expo/(?P<slug>.*)/service/thanks/', ExpositionThankView.as_view()),
url(r'^expo/(?P<slug>.*)/service/(?P<service_url>.*)/', ExpositionServiceView.as_view()), url(r'^expo/(?P<slug>.*)/service/(?P<service_url>.*)/', ExpositionServiceView.as_view()),
# expo list # expo list
url(r'^expo/(?P<year>\d+)/(?P<month>.*)/page/(?P<page>\d+)/$', ExpoList.as_view(), {'meta_id':4}), url(r'^expo/(?P<year>\d+)/(?P<month>.*)/page/(?P<page>\d+)/$', ExpoList.as_view(), {'meta_id':4}),

@ -165,6 +165,12 @@ class ExpositionStatistic(MetadataMixin, DetailView):
template_name = 'client/exposition/statistic.html' template_name = 'client/exposition/statistic.html'
from django.views.generic.edit import FormMixin, ModelFormMixin from django.views.generic.edit import FormMixin, ModelFormMixin
class ExpositionThankView(MetadataMixin, DetailView):
model = Exposition
slug_field = 'url'
template_name = 'client/service/thank_u_page.html'
class ExpositionServiceView(MetadataMixin, FormMixin, DetailView): class ExpositionServiceView(MetadataMixin, FormMixin, DetailView):
model = Exposition model = Exposition
slug_field = 'url' slug_field = 'url'
@ -209,8 +215,7 @@ class ExpositionServiceView(MetadataMixin, FormMixin, DetailView):
order = form.save(commit=False) order = form.save(commit=False)
order.exposition = self.object order.exposition = self.object
order.save() order.save()
messages.success(self.request, _(u'Ваш запрос был успешно отправлен')) return HttpResponseRedirect(self.object.get_permanent_url()+'service/thanks/')
return HttpResponseRedirect(self.success_url)
def get_initial(self): def get_initial(self):
""" """

@ -1,11 +1,20 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from django.conf.urls import patterns, include, url from django.conf.urls import patterns, include, url
from views import CallBackListView, VisitListView, TranslationListView, AdvertisingListView, \
ParticipationListView, RemoteListView,TicketsListView
urlpatterns = patterns('service.admin', urlpatterns = patterns('service.admin',
url(r'^add.*/$', 'service_add'), url(r'^add.*/$', 'service_add'),
url(r'^delete/(?P<url>.*)/$', 'service_delete'), url(r'^delete/(?P<url>.*)/$', 'service_delete'),
url(r'^change/(?P<url>.*)/$', 'service_change'), url(r'^change/(?P<url>.*)/$', 'service_change'),
url(r'^all/$', 'service_all'), url(r'^all/$', 'service_all'),
url(r'order/callback/$', CallBackListView.as_view()),
url(r'order/visit/$', VisitListView.as_view()),
url(r'order/translation/$', TranslationListView.as_view()),
url(r'order/advertising/$', AdvertisingListView.as_view()),
url(r'order/participation/$', ParticipationListView.as_view()),
url(r'order/remote/$', RemoteListView.as_view()),
url(r'order/tickets/$', TicketsListView.as_view()),
#ajax #ajax
url(r'^get_city/$', 'get_city'), url(r'^get_city/$', 'get_city'),
#url(r'^get_country/$', 'get_country'), #url(r'^get_country/$', 'get_country'),

@ -5,13 +5,6 @@ from views import ServiceView, CallBackListView, VisitListView, TranslationListV
urlpatterns = patterns('', urlpatterns = patterns('',
url(r'service/thanks/$', Thanks.as_view()), url(r'service/thanks/$', Thanks.as_view()),
url(r'service/order/callback/$', CallBackListView.as_view()),
url(r'service/order/visit/$', VisitListView.as_view()),
url(r'service/order/translation/$', TranslationListView.as_view()),
url(r'service/order/advertising/$', AdvertisingListView.as_view()),
url(r'service/order/participation/$', ParticipationListView.as_view()),
url(r'service/order/remote/$', RemoteListView.as_view()),
url(r'service/order/tickets/$', TicketsListView.as_view()),
url(r'service/com_rek/$', 'service.views.advertise'), url(r'service/com_rek/$', 'service.views.advertise'),
url(r'service/(?P<url>.*)/$', ServiceView.as_view()), url(r'service/(?P<url>.*)/$', ServiceView.as_view()),

@ -7,6 +7,7 @@ from haystack.query import EmptySearchQuerySet
from django.shortcuts import get_object_or_404 from django.shortcuts import get_object_or_404
from django.http import Http404 from django.http import Http404
import json import json
from django.http import HttpResponseRedirect, HttpResponse
#from functions.search_forms import CompanySearchForm #from functions.search_forms import CompanySearchForm
from order_forms import TranslationForm, CatalogForm, VisitForm, RemoteForm, ParticipationForm, TicketsForm,\ from order_forms import TranslationForm, CatalogForm, VisitForm, RemoteForm, ParticipationForm, TicketsForm,\
@ -19,19 +20,31 @@ order_forms = {'translator': TranslationForm, 'catalog': CatalogForm, 'participa
class ServiceView(FormView): class ServiceView(FormView):
success_url = '/service/thanks/' success_url = '/service/thanks/'
def dispatch(self, request, *args, **kwargs):
service_url = self.kwargs.get('url')
service = get_object_or_404(Service, url=service_url)
self.service = service
self.template_name = service.template
service_form = order_forms.get(service_url)
self.form_class = service_form
return super(ServiceView, self).dispatch(request, *args, **kwargs)
def get_form_class(self): def post(self, request, *args, **kwargs):
url = self.kwargs.get('url') url = self.kwargs.get('url')
form = order_forms.get(url) #service_form = order_forms.get(url)
if form: #self.form_class = service_form
return form form = self.form_class(request.POST)
if form.is_valid():
return self.form_valid(form)
else: else:
raise Http404 return self.form_invalid(form)
def form_valid(self, form):
order = form.save(commit=False)
order.save()
#messages.success(self.request, _(u'Ваш запрос был успешно отправлен'))
return HttpResponseRedirect(self.success_url)
def get_template_names(self):
url = self.kwargs.get('url')
service = get_object_or_404(Service, url=url)
return service.template
def advertise(request): def advertise(request):

@ -52,6 +52,7 @@ urlpatterns = patterns('',
url(r'^catalog/city/(?P<city>.*)/year-(?P<year>\d+)/month-(?P<month>.*)/$', old_redirect, {'redirect_url': '/expo/city/{city}/{year}/{month}'}), url(r'^catalog/city/(?P<city>.*)/year-(?P<year>\d+)/month-(?P<month>.*)/$', old_redirect, {'redirect_url': '/expo/city/{city}/{year}/{month}'}),
url(r'^catalog/city-(?P<city>.*)/year-(?P<year>\d+)/$', old_redirect, {'redirect_url': '/expo/city/{city}/{year}'}), url(r'^catalog/city-(?P<city>.*)/year-(?P<year>\d+)/$', old_redirect, {'redirect_url': '/expo/city/{city}/{year}'}),
url(r'^catalog/city/(?P<city>.*)/year-(?P<year>\d+)/$', old_redirect, {'redirect_url': '/expo/city/{city}/{year}'}), url(r'^catalog/city/(?P<city>.*)/year-(?P<year>\d+)/$', old_redirect, {'redirect_url': '/expo/city/{city}/{year}'}),
url(r'^catalog/city-(?P<city>.*)/page/(?P<page>\d+)/$', old_redirect, {'redirect_url': '/expo/city/{city}/page/{page}/'}),
url(r'^catalog/city-(?P<city>.*)/$', old_redirect, {'redirect_url': '/expo/city/{city}/'}), url(r'^catalog/city-(?P<city>.*)/$', old_redirect, {'redirect_url': '/expo/city/{city}/'}),
# country # country
url(r'^catalog/country-(?P<country>)/theme-(?P<theme>.*)/year-(?P<year>\d+)/month-(?P<month>.*)/$', old_redirect, {'redirect_url': '/expo/theme/{theme}/country/{country}/{year}/'}), url(r'^catalog/country-(?P<country>)/theme-(?P<theme>.*)/year-(?P<year>\d+)/month-(?P<month>.*)/$', old_redirect, {'redirect_url': '/expo/theme/{theme}/country/{country}/{year}/'}),
@ -61,8 +62,9 @@ urlpatterns = patterns('',
url(r'^catalog/country/(?P<country>.*)/year-(?P<year>\d+)/month-(?P<month>.*)/$', old_redirect, {'redirect_url': '/expo/country/{country}/{year}/{month}/'}), url(r'^catalog/country/(?P<country>.*)/year-(?P<year>\d+)/month-(?P<month>.*)/$', old_redirect, {'redirect_url': '/expo/country/{country}/{year}/{month}/'}),
url(r'^catalog/country-(?P<country>.*)/year-(?P<year>\d+)/$', old_redirect, {'redirect_url': '/expo/country/{country}/{year}/'}), url(r'^catalog/country-(?P<country>.*)/year-(?P<year>\d+)/$', old_redirect, {'redirect_url': '/expo/country/{country}/{year}/'}),
url(r'^catalog/country/(?P<country>.*)/year-(?P<year>\d+)/$', old_redirect, {'redirect_url': '/expo/country/{country}/{year}/'}), url(r'^catalog/country/(?P<country>.*)/year-(?P<year>\d+)/$', old_redirect, {'redirect_url': '/expo/country/{country}/{year}/'}),
url(r'^catalog/country/(?P<country>.*)/$', old_redirect, {'redirect_url': '/expo/country/{country}/'}), url(r'^catalog/country/(?P<country>.*)/page/(?P<page>\d+)/$', old_redirect, {'redirect_url': '/expo/country/{country}/page/{page}/'}),
url(r'^catalog/country-(?P<country>.*)/$', old_redirect, {'redirect_url': '/expo/country/{country}/'}), url(r'^catalog/country-(?P<country>.*)/$', old_redirect, {'redirect_url': '/expo/country/{country}/'}),
url(r'^catalog/country/page/(?P<page>\d+)/$', old_redirect, {'redirect_url': '/expo/country/page/{page}/'}),
url(r'^catalog/country/$', old_redirect, {'redirect_url': '/expo/country/'}), url(r'^catalog/country/$', old_redirect, {'redirect_url': '/expo/country/'}),
# theme # theme
url(r'^catalog/theme-(?P<theme>.*)/year-(?P<year>\d+)/month-(?P<month>.*)/$', old_redirect, {'redirect_url': '/expo/theme/{theme}/{year}/{month}/'}), url(r'^catalog/theme-(?P<theme>.*)/year-(?P<year>\d+)/month-(?P<month>.*)/$', old_redirect, {'redirect_url': '/expo/theme/{theme}/{year}/{month}/'}),

@ -50,12 +50,16 @@ class EventRedirect(object):
obj = Exposition.objects.get(old_url=value) obj = Exposition.objects.get(old_url=value)
except Exposition.DoesNotExist: except Exposition.DoesNotExist:
obj = Exposition.objects.safe_get(url=value) obj = Exposition.objects.safe_get(url=value)
except Exposition.MultipleObjectsReturned:
obj = Exposition.objects.filter(old_url=value)[0]
if not obj: if not obj:
try: try:
obj = Conference.objects.get(old_url=value) obj = Conference.objects.get(old_url=value)
except Conference.DoesNotExist: except Conference.DoesNotExist:
obj = Conference.objects.safe_get(url=value) obj = Conference.objects.safe_get(url=value)
except Conference.MultipleObjectsReturned:
obj = Conference.objects.filter(old=value)[0]
if obj: if obj:
return {'event_url': obj.url, 'event_catalog': obj.catalog} return {'event_url': obj.url, 'event_catalog': obj.catalog}
else: else:
@ -71,9 +75,15 @@ class UserRedirect(object):
obj = get_object_or_404(User, url=value) obj = get_object_or_404(User, url=value)
return {key: obj.url} return {key: obj.url}
class PageRedirect(object):
def get_object_url(self,key, value):
return {key: value}
old_params = {'city': CityRedirect, 'country': CountryRedirect, 'theme': ThemeRedirect, 'tag': TagRedirect, old_params = {'city': CityRedirect, 'country': CountryRedirect, 'theme': ThemeRedirect, 'tag': TagRedirect,
'event': EventRedirect, 'company': Company, 'article': ArticleRedirect, 'user': UserRedirect} 'event': EventRedirect, 'company': Company, 'article': ArticleRedirect, 'user': UserRedirect,
'page': PageRedirect}
def old_redirect(request, *args, **kwargs): def old_redirect(request, *args, **kwargs):
redirect = kwargs.get('redirect_url') redirect = kwargs.get('redirect_url')

@ -167,7 +167,11 @@
<div class="rq-order-button"> <div class="rq-order-button">
<div class="rqob-wrap"> <div class="rqob-wrap">
<div class="rqob-price">{% trans 'Стоимость базового пакета услуги 400 €' %}</div> {% if object and object.country_id in sng_countries %}
<div class="rqob-price">{% trans 'Стоимость базового пакета услуги 10 000 р.' %}</div>
{% else %}
<div class="rqob-price">{% trans 'Стоимость базового пакета услуги 400 €' %}</div>
{% endif %}
<div class="rqob-button"> <div class="rqob-button">
<a class="ob-text" href="#">{% trans 'отправить запрос' %}</a> <a class="ob-text" href="#">{% trans 'отправить запрос' %}</a>
</div> </div>

@ -20,7 +20,8 @@
<p>Также Вы можете позвонить нам для ускорения процесса, если Ваш запрос является срочным.</p> <p>Также Вы можете позвонить нам для ускорения процесса, если Ваш запрос является срочным.</p>
</article> </article>
<div class="clearfix"></div> <div class="clearfix"></div>
{% comment %} {% if object %}
<h3>Что дальше Вы хотите делать?</h3> <h3>Что дальше Вы хотите делать?</h3>
<div class="help-block"> <div class="help-block">
<div class="item"> <div class="item">
@ -28,11 +29,14 @@
<div class="icon list">&nbsp;</div> <div class="icon list">&nbsp;</div>
</div> </div>
<div class="desc"> <div class="desc">
{% with theme=object.theme.all.0 %}
<p> <p>
Перейти к списку выставок по тематике <a href="#">«Ювелирное дело, антиквариат»</a> Перейти к списку выставок по тематике <a href="{{ object.catalog }}theme/{{ theme.url }}/">«{{ theme.name }}»</a>
</p> </p>
{% endwith %}
</div> </div>
</div> </div>
{% comment %}
<div class="item"> <div class="item">
<div class="figure"> <div class="figure">
<div class="icon mail">&nbsp;</div> <div class="icon mail">&nbsp;</div>
@ -43,17 +47,31 @@
</p> </p>
</div> </div>
</div> </div>
{% endcomment %}
<div class="item"> <div class="item">
<div class="figure"> <div class="figure">
<div class="icon zoom">&nbsp;</div> <div class="icon zoom">&nbsp;</div>
</div> </div>
<div class="desc"> <div class="desc">
Вернуться к просмотру выставки <a href="#">«Сувенирная ярмарка 2013/2014»</a> Вернуться к просмотру выставки <a href="{{ object.get_permanent_url }}">«{{ object.name }}»</a>
</div>
</div>
<div class="item">
<div class="figure">
<div class="icon list">&nbsp;</div>
</div>
<div class="desc">
{% with city=object.city %}
<p>
Перейти к списку ближайших выставок в городе <a href="{{ object.catalog }}city/{{ city.url }}/">«{{ city.name }}»</a>
</p>
{% endwith %}
</div> </div>
</div> </div>
<div class="clearfix"></div> <div class="clearfix"></div>
{% endcomment %}
</div> </div>
{% endif %}
</div> </div>
</div> </div>

Loading…
Cancel
Save