diff --git a/static/js/user_profile_2.js b/static/js/user_profile_2.js index 8fc48ea..c26abbd 100644 --- a/static/js/user_profile_2.js +++ b/static/js/user_profile_2.js @@ -60,6 +60,8 @@ function select_tab_profile (el,url,owner_type=null, check_orders_required) { } document.querySelector("#ru_lang").href = confirm_url_f_lang_ru document.querySelector("#en_lang").href = confirm_url_f_lang_en + + daterangepickerInit($('.w_daterangepicker'), daterangepickerInit) // let header = document.querySelector("header") // header.scrollIntoView({ // behavior: "smooth", diff --git a/static/v2/js/forms/f_make_poster_order.js b/static/v2/js/forms/f_make_poster_order.js index fed8d28..af84c08 100644 --- a/static/v2/js/forms/f_make_poster_order.js +++ b/static/v2/js/forms/f_make_poster_order.js @@ -9,7 +9,26 @@ function makePosterOrder(form) { data: formData, data_type: 'formData', success: function (res) { + if (!res) return; + let created_route_id = res.route_id; + if (!created_route_id) return; + let profile_root = document.querySelector(".info_profile") + if (!profile_root) return; + profile_root.innerHTML = res.html + + let created_route = document.querySelector(`[data-number-of-route="${created_route_id}"]`); + created_route.scrollIntoView({ + behavior:"smooth", + block:'start', + inline:'start' + }); + + let new_url = window.location.pathname + new_url.replace('/create_route_for_customer', '/my_routes'); + new_url.replace('/create_route_for_mover', '/my_routes'); + + window.location.pathname.replace(new_url, '') }, error: function (res) { if (!res.responseJSON) return; diff --git a/templates/blocks/routes/b_my_routes_list.html b/templates/blocks/routes/b_my_routes_list.html index 31d869d..38d7d61 100644 --- a/templates/blocks/routes/b_my_routes_list.html +++ b/templates/blocks/routes/b_my_routes_list.html @@ -3,100 +3,3 @@ {% include "widgets/routes/w_my_route.html" %} {% endfor %} - - -{#
#} -{#
#} -{#
#} -{# #} -{# Тип:{{ route.get_cargo_type_display }}#} -{# #} -{##} -{# #} -{# Вес:{{ route.weight }} кг#} -{# #} -{##} -{# #} -{##} -{# {{ route.get_type_transport_display }}#} -{# #} -{##} -{#
#} -{##} -{#
#} -{##} -{#
#} -{#
#} -{# #} -{# {{ route.from_country.name }}/{{ route.from_city.name }}#} -{# #} -{##} -{#
#} -{#
#} -{##} -{##} -{# #} -{# {{ route.to_country.name }}/{{ route.to_city.name }}#} -{# #} -{#
#} -{#
#} -{##} -{#
#} -{# Отправка: {{route.departure_DT }}#} -{# Прибытие: {{route.arrival_DT }}#} -{#
#} -{##} -{#
#} -{# Откуда заберёт:{{ route.from_place }}#} -{# Куда доставит:{{ route.to_place }}#} -{#
#} -{##} -{#
#} -{##} -{# #} -{#
#} -{##} -{#

Контакты перевозчика:

#} -{##} -{#
#} -{# {{ route.owner.last_name }} {{ route.owner.first_name }}#} -{#
#} -{##} -{#
#} -{# {{ route.phone }}#} -{#
#} -{# {{ route.extra_phone }}#} -{#
#} -{# {{ route.owner.email }}#} -{#
#} -{#
#} -{# #} -{#
#} -{#
#} -{# #} -{# Удалить#} -{# #} -{#
#} -{##} -{#
#} -{#
#} - - - - - - - - - - - - - - - diff --git a/templates/widgets/routes/w_my_route.html b/templates/widgets/routes/w_my_route.html index 113d282..af9873a 100644 --- a/templates/widgets/routes/w_my_route.html +++ b/templates/widgets/routes/w_my_route.html @@ -1,11 +1,12 @@ {% load static %} {% load i18n %} -{% if route.departure_DT %} +{% if route.arrival_DT %} {% with current_datetime=route.from_city.get_current_datetime %} - {% with departure_datetime=route.departure_DT %} +{# time to time solve#} + {% with arrival_DT=route.arrival_DT %} {% with highlight_end_DT=route.highlight_end_DT %} - {% if current_datetime|date:"Y-m-d H:i:s" > departure_datetime|date:"Y-m-d H:i:s" %} + {% if current_datetime|date:"Y-m-d H:i:s" > arrival_DT|date:"Y-m-d H:i:s" %}
{% else %}
current_datetime|date:"Y-m-d H:i:s" %} highlight-color {% endif %}" data-number-of-route="{{ route.id }}">