diff --git a/ArticlesApp/views.py b/ArticlesApp/views.py index dc7891f..783a5c3 100644 --- a/ArticlesApp/views.py +++ b/ArticlesApp/views.py @@ -126,8 +126,8 @@ def ArticlesOnePageView(request, art_url): } try: - art = UserPageModel.objects.get(**kwargs) - except UserPageModel.DoesNotExist: + art = ArticleModel.objects.get(**kwargs) + except ArticleModel.DoesNotExist: raise Http404 diff --git a/RoutesApp/js_views.py b/RoutesApp/js_views.py index b53d3c3..c6cd87e 100644 --- a/RoutesApp/js_views.py +++ b/RoutesApp/js_views.py @@ -154,8 +154,8 @@ def find_routes_ajax(request): try: - data = request.POST - + data = request.POST.dict() + data['owner_type'] = 'mover' routes_Dict = get_routes_Dict(data=data) if 'errors' in routes_Dict: return JsonResponse(routes_Dict, status=400) @@ -242,6 +242,8 @@ def create_or_change_route_ajax(request, route_id=None): return JsonResponse({'html': html}, status=400) obj = form.save(commit=False) + if 'owner_type' in data: + obj.owner_type = data['owner_type'] obj.owner = request.user obj.save() diff --git a/static/css/styles(boris).css b/static/css/styles(boris).css index 684624b..9e553ca 100644 --- a/static/css/styles(boris).css +++ b/static/css/styles(boris).css @@ -999,12 +999,12 @@ .carrier_inf_moving.left{ - width: 41%; + width: 40%; float: left; text-align: left; } .carrier_inf_moving.right{ - width: 41%; + width: 40%; float: right; text-align: right; } diff --git a/static/js/user_profile.js b/static/js/user_profile.js index 0b8453a..70869e4 100644 --- a/static/js/user_profile.js +++ b/static/js/user_profile.js @@ -350,6 +350,10 @@ function sendRoute(el, routeID = null){ let list_of_elements_form = document.querySelectorAll(".el_form_b_new_route"); let obj_w_el_form = {} for (let i = 0;i < list_of_elements_form.length;i++) { + // let id_el = list_of_elements_form[i].id + // if (id_el){ + // if (id_el === "") + // } let name_attr = list_of_elements_form[i].attributes["name"] if (name_attr) { let name_el = name_attr.value diff --git a/templates/blocks/profile/b_new_route.html b/templates/blocks/profile/b_new_route.html index 152ae1c..b244e21 100644 --- a/templates/blocks/profile/b_new_route.html +++ b/templates/blocks/profile/b_new_route.html @@ -222,10 +222,9 @@ {% for item in form.fields.cargo_type.choices %}
+ + + + \ No newline at end of file diff --git a/templates/pages/p_results_find_route.html b/templates/pages/p_results_find_route.html index 052ca2c..f6afc44 100644 --- a/templates/pages/p_results_find_route.html +++ b/templates/pages/p_results_find_route.html @@ -9,7 +9,8 @@ {# #} - + + {% include "connect_ws_js.html" %} {% endblock %} diff --git a/templates/pages/profile/p_user_profile.html b/templates/pages/profile/p_user_profile.html index e09e66b..8c2f164 100644 --- a/templates/pages/profile/p_user_profile.html +++ b/templates/pages/profile/p_user_profile.html @@ -11,13 +11,11 @@ {# #} - - - - + - + {% include "connect_ws_js.html" %} + diff --git a/templates/small_INCLUDES/carrier_card/inf_about_moving.html b/templates/small_INCLUDES/carrier_card/inf_about_moving.html index 7765f34..822a330 100644 --- a/templates/small_INCLUDES/carrier_card/inf_about_moving.html +++ b/templates/small_INCLUDES/carrier_card/inf_about_moving.html @@ -3,13 +3,13 @@
Отправка:
-
{% if route.arrival_DT %}{{ route.arrival_DT }}{% else %}Неизвестно{% endif %}
+
{% if route.arrival_DT %}{{ route.arrival_DT|date:"l: d.m.Y." }}{% else %}Неизвестно{% endif %}
Прибытие:
-
{% if route.departure_DT %}{{ route.departure_DT }}{% else %}Неизвестно{% endif %}
+
{% if route.departure_DT %}{{ route.departure_DT|date:"l: d.m.Y." }}{% else %}Неизвестно{% endif %}