0.3.4 contacts page
This commit is contained in:
@@ -249,9 +249,10 @@ class Admin_Office(Admin_Trans_BaseModelViewPage):
|
|||||||
# 'main_office',
|
# 'main_office',
|
||||||
'city',
|
'city',
|
||||||
'address',
|
'address',
|
||||||
|
'picture',
|
||||||
(
|
(
|
||||||
'work_time_from', 'work_time_to',
|
'work_time_from', 'work_time_to',
|
||||||
# 'workTime',
|
'workTime',
|
||||||
),
|
),
|
||||||
# ('legal_name', 'unp', 'legal_address', 'urInfo'),
|
# ('legal_name', 'unp', 'legal_address', 'urInfo'),
|
||||||
# 'fullContactInfo',
|
# 'fullContactInfo',
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ from .views import *
|
|||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
path('', MainPage, name='main'),
|
path('', MainPage, name='main'),
|
||||||
|
path('contacts/', contacts_view, name='contacts'),
|
||||||
path('page/<str:url>/', StaticPageView, name='static_page'),
|
path('page/<str:url>/', StaticPageView, name='static_page'),
|
||||||
path('test_code', test_code, name='test_code'),
|
path('test_code', test_code, name='test_code'),
|
||||||
]
|
]
|
||||||
@@ -92,3 +92,14 @@ def StaticPageView(request, url):
|
|||||||
# return HttpResponse(t.render(Dict, request))
|
# return HttpResponse(t.render(Dict, request))
|
||||||
|
|
||||||
|
|
||||||
|
def contacts_view(request):
|
||||||
|
# from RoutesApp.forms import RouteForm
|
||||||
|
# from SubscribesApp.funcs import get_subsribes_w_options
|
||||||
|
|
||||||
|
Dict = {
|
||||||
|
'offices': Office.objects.filter(enable=True)
|
||||||
|
}
|
||||||
|
|
||||||
|
t = loader.get_template('pages/p_contacts.html')
|
||||||
|
return get_inter_http_respose(t, Dict, request)
|
||||||
|
# return HttpResponse(t.render(Dict, request))
|
||||||
|
|||||||
29
templates/pages/p_contacts.html
Normal file
29
templates/pages/p_contacts.html
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
{% extends 'tb_base.html' %}
|
||||||
|
{% block CONTENT %}
|
||||||
|
|
||||||
|
<div>
|
||||||
|
Контакты
|
||||||
|
<div>
|
||||||
|
{% for office in offices %}
|
||||||
|
<div>
|
||||||
|
{% if office.picture %}
|
||||||
|
<img src="{{ MEDIA_URL }}{{ office.picture }}" alt="{{ office.city }}" />
|
||||||
|
{% endif %}
|
||||||
|
<div>{{ office.city }}</div>
|
||||||
|
<div>{{ office.address }}</div>
|
||||||
|
Часы работы:
|
||||||
|
<div>{{ office.work_time_from }} - {{ office.work_time_to }}</div>
|
||||||
|
<div>{{ office.work_time }}</div>
|
||||||
|
<div>
|
||||||
|
{% for contact in office.contacts %}
|
||||||
|
<div>
|
||||||
|
{% if contact.contact_label %}{{ contact.contact_label }}: {% endif %}{{ contact.get_prefix_w_data }}
|
||||||
|
</div>
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{% endblock %}
|
||||||
Reference in New Issue
Block a user