0.3.5 contacts page
This commit is contained in:
@@ -29,6 +29,14 @@ def MainPage(request):
|
||||
name_ru = _('Главная')
|
||||
)
|
||||
|
||||
try:
|
||||
page = StaticPage.objects.get(url='contacts')
|
||||
except StaticPage.DoesNotExist:
|
||||
page = StaticPage.objects.create(
|
||||
url='contacts',
|
||||
name_ru = _('Контакты')
|
||||
)
|
||||
|
||||
# from ArticlesApp.models import ArticleModel
|
||||
# arts = ArticleModel.objects.filter(enable=True).order_by('-createDT')[:4]
|
||||
|
||||
@@ -56,18 +64,7 @@ def StaticPageView(request, url):
|
||||
|
||||
if url == '':
|
||||
return MainPage(request)
|
||||
elif url == 'for_movers':
|
||||
Dict.update({
|
||||
# 'route_form': RouteForm(),
|
||||
'owner_type': 'customer',
|
||||
})
|
||||
elif url == 'for_customers':
|
||||
Dict.update({
|
||||
# 'route_form': RouteForm(),
|
||||
'owner_type': 'mover'
|
||||
})
|
||||
# elif url == 'works':
|
||||
# return WorksPage(request)
|
||||
|
||||
elif url in ['main']:
|
||||
raise Http404
|
||||
|
||||
@@ -95,8 +92,16 @@ def StaticPageView(request, url):
|
||||
def contacts_view(request):
|
||||
# from RoutesApp.forms import RouteForm
|
||||
# from SubscribesApp.funcs import get_subsribes_w_options
|
||||
try:
|
||||
page = StaticPage.objects.get(url='contacts')
|
||||
except Exception as e:
|
||||
page = StaticPage.objects.create(
|
||||
url='contacts',
|
||||
name_ru=_('Контакты')
|
||||
)
|
||||
|
||||
Dict = {
|
||||
'page': page,
|
||||
'offices': Office.objects.filter(enable=True)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user