2.1.17 route form

This commit is contained in:
SDE
2025-01-14 19:56:36 +03:00
parent a0b08a9a94
commit 8ac11d6234
9 changed files with 58 additions and 38 deletions

View File

@@ -247,10 +247,12 @@ def MainPage(request):
from ArticlesApp.models import ArticleModel
arts = ArticleModel.objects.filter(enable=True).order_by('-createDT')[:3]
owner_type = 'mover'
Dict = {
'page': page,
'FAQ': page.FAQ_items.filter(enable=True),
'route_form': RouteForm(),
'route_form': RouteForm(owner_type=owner_type),
'articles': arts,
'owner_type': 'mover'
}
@@ -273,18 +275,19 @@ def StaticPageView(request, url):
Dict = {}
owner_type = None
if url == '':
return MainPage(request)
elif url == 'for_movers':
Dict.update({
'route_form': RouteForm(),
'owner_type': 'customer',
})
owner_type = 'customer'
elif url == 'for_customers':
owner_type = 'mover'
if owner_type:
Dict.update({
'route_form': RouteForm(),
'owner_type': 'mover'
'route_form': RouteForm(owner_type=owner_type),
'owner_type': owner_type,
})
# elif url == 'works':
# return WorksPage(request)
elif url in ['main']: