From 09cd04078cfd93d9fc294192920e02cf0ca4fe05 Mon Sep 17 00:00:00 2001 From: ArtemB Date: Mon, 7 Aug 2023 15:09:14 +0300 Subject: [PATCH] 0.0.75 --- static/css/styles.css | 17 +++---- static/js/user_profile.js | 54 ++++++++++------------- templates/blocks/profile/b_new_route.html | 31 ++++--------- 3 files changed, 38 insertions(+), 64 deletions(-) diff --git a/static/css/styles.css b/static/css/styles.css index df7d364..bdb5779 100644 --- a/static/css/styles.css +++ b/static/css/styles.css @@ -1090,12 +1090,7 @@ div.departure_arrival>div>input{ display: none; } -select#id_cargo_type{ - height: 120px; - background: none; - overflow: auto; - width: 193px; -} + div.from_to_place>div>select{ width: 392px; @@ -1127,12 +1122,12 @@ input#id_extra_phone /* line-height: 22px;*/ /*}*/ .checkbox_cargo_type{ - display: flex; + display: block; flex-wrap: wrap; } -input#id_cargo_type{ - width: 50%; -} +/*input#id_cargo_type{*/ +/* width: 50%;*/ +/*}*/ .errorlist.hide { display: none; @@ -1233,7 +1228,7 @@ input#id_cargo_type{ button#edit_route { display: block; height: 44px; - width: 86%; + width: 76%; background: #FF613A; color: #FFF; font-family: Inter; diff --git a/static/js/user_profile.js b/static/js/user_profile.js index 4fdf066..59f496a 100644 --- a/static/js/user_profile.js +++ b/static/js/user_profile.js @@ -228,6 +228,19 @@ function onblurInputField(event,el){ // // } +function sliderInit() { + $('#id_weight').ionRangeSlider({ + skin: "round", + type: "single", + min: 0, + max: 1000, + from: 0, + step: 1, + grid: true, + grid_num: 5, + }); + +} function sendRoute(el, routeID = null){ event.preventDefault() @@ -258,17 +271,10 @@ function sendRoute(el, routeID = null){ error: function (data, exception){ document.querySelector(".info_profile").innerHTML = data.responseJSON.html; + sliderInit(); + - $('#id_weight').ionRangeSlider({ - skin: "round", - type: "single", - min: 0, - max: 1000, - step: 1, - grid: true, - grid_num: 5, - }); } }); } @@ -304,16 +310,7 @@ function OnSelectionChange(el) { document.querySelector(".info_profile").innerHTML = data.html // - $('#id_weight').ionRangeSlider({ - skin: "round", - type: "single", - min: 0, - max: 1000, - from: 0, - step: 1, - grid: true, - grid_num: 5, - }); + sliderInit(); } }); @@ -339,19 +336,7 @@ function createRoute(){ // location.href = '/profile' document.querySelector(".info_profile").innerHTML = data.html - $(document).ready(function (e){ - $('#id_weight').ionRangeSlider({ - skin: "round", - type: "single", - min: 0, - max: 1000, - from: 100, - step: 1, - grid: true, - grid_num: 5, - }); -}); //get dynamic value // let fromCountry = document.getElementById('id_from_country'); @@ -413,6 +398,9 @@ function getRoute(){ // location.href = '/profile' document.querySelector(".info_profile").innerHTML = data.html; + sliderInit(); + + }, error: function (data, exception) { @@ -428,3 +416,7 @@ function getRoute(){ + + + + diff --git a/templates/blocks/profile/b_new_route.html b/templates/blocks/profile/b_new_route.html index 721a073..56c5931 100644 --- a/templates/blocks/profile/b_new_route.html +++ b/templates/blocks/profile/b_new_route.html @@ -178,36 +178,23 @@
- +
-{#
#} -{# #} -{# {% for item in form.fields.cargo_type.choices %}#} -{# {{ item.1 }}#} -{# #} -{# {% endfor %}#} -{##} -{# #} - -{#
#}
{% for item in form.fields.cargo_type.choices %} {{ item.1 }} + {% if form.initial.cargo_type == item.0 %} + checked="checked" + {% endif %}/> + + {{ item.1 }} + {% endfor %} {# #}