diff --git a/static/v2/css/widgets/w_route_card.css b/static/v2/css/widgets/w_route_card.css index 9a2da5a..e314f60 100644 --- a/static/v2/css/widgets/w_route_card.css +++ b/static/v2/css/widgets/w_route_card.css @@ -1,6 +1,7 @@ .w_route_card { padding: 20px; --route-card-bg: #FFFFFF; + --route-card-margin: 20px 0; --route-card-box_shadow: 0 -1px 10px rgba(198, 199, 203, 0.2), -1px 4px 10px rgba(198, 199, 203, 0.2); --route-text-color: #272424; @@ -34,6 +35,7 @@ --route-btn-text-data-color: #27242499; background: var(--route-card-bg); + margin: var(--route-card-margin); box-shadow: var(--route-card-box_shadow); border-radius: 10px; color: var(--route-text-color); @@ -84,6 +86,9 @@ background: #E6E6E6; } .card_owner_type{ + &.mover{ + --route-owner-type-color: #45C226; + } font-size: var(--medium-font-size); color: var(--route-owner-type-color); font-weight: 600; @@ -174,7 +179,7 @@ border-radius: 100%; position: absolute; top: -10px; - z-index: 2; + z-index: 11; &:first-of-type{ border: 3px solid #065BFF; left: 0; @@ -202,6 +207,7 @@ z-index: 10; background-image: url("/static/v2/icons/widgets/w_route_card/route_arrow.svg"); background-repeat: repeat-x; + background-size: 10px; } } } diff --git a/static/v2/icons/widgets/w_route_card/phone_half_opacity.svg b/static/v2/icons/widgets/w_route_card/phone_half_opacity.svg new file mode 100644 index 0000000..5054883 --- /dev/null +++ b/static/v2/icons/widgets/w_route_card/phone_half_opacity.svg @@ -0,0 +1,3 @@ + diff --git a/static/v2/js/forms/f_make_mover_order.js b/static/v2/js/forms/f_make_mover_order.js index e23ec69..2c6245e 100644 --- a/static/v2/js/forms/f_make_mover_order.js +++ b/static/v2/js/forms/f_make_mover_order.js @@ -17,11 +17,11 @@ function makeMoverOrder(form) { if (!profile_root) return; profile_root.innerHTML = res.html - let created_route = document.querySelector(`[data-number-of-route="${created_route_id}"]`); + let created_route = document.querySelector(`.w_route_card[data-route_id="${created_route_id}"]`); created_route.scrollIntoView({ behavior:"smooth", - block:'start', - inline:'start' + block:'center', + inline:'center' }); let new_url = window.location.pathname diff --git a/static/v2/js/forms/f_make_poster_order.js b/static/v2/js/forms/f_make_poster_order.js index f0f2622..faa60ee 100644 --- a/static/v2/js/forms/f_make_poster_order.js +++ b/static/v2/js/forms/f_make_poster_order.js @@ -17,7 +17,7 @@ function makePosterOrder(form) { if (!profile_root) return; profile_root.innerHTML = res.html - let created_route = document.querySelector(`[data-number-of-route="${created_route_id}"]`); + let created_route = document.querySelector(`.w_route_card[data-route_id="${created_route_id}"]`); created_route.scrollIntoView({ behavior:"smooth", block:'start', diff --git a/static/v2/js/widgets/w_route_card.js b/static/v2/js/widgets/w_route_card.js new file mode 100644 index 0000000..97a4f72 --- /dev/null +++ b/static/v2/js/widgets/w_route_card.js @@ -0,0 +1,22 @@ +function changeRoute(el) { + if (!el) return; + let $parent = el.closest(".w_route_card") + if (!$parent) return; + + let data = { + 'route_id': $parent.dataset.route_id, + 'owner_type': $parent.dataset.owner_type, + } + let request = new api({ + url: '/routes/create_or_change_route/', + data: data, + data_type: 'json', + success: (res) => { + + }, error: (res) => { + + } + }); + + request.ajaxRequest() +} \ No newline at end of file diff --git a/templates/pages/profile/p_user_profile.html b/templates/pages/profile/p_user_profile.html index eaa5701..e1c65ff 100644 --- a/templates/pages/profile/p_user_profile.html +++ b/templates/pages/profile/p_user_profile.html @@ -32,11 +32,13 @@ + {% include "connect_ws_js.html" %} + diff --git a/templates/v2/blocks/b_my_routes.html b/templates/v2/blocks/b_my_routes.html index e601524..eb2fedd 100644 --- a/templates/v2/blocks/b_my_routes.html +++ b/templates/v2/blocks/b_my_routes.html @@ -1,7 +1,8 @@ {% load static %} {% load i18n %} -