From 16e860a29f6b2b8acc0895cae9747ad483268af3 Mon Sep 17 00:00:00 2001 From: ArtemB Date: Tue, 12 Dec 2023 16:01:01 +0300 Subject: [PATCH] 0.0.322 upd lable for b_new_route.html --- static/css/styles.css | 4 ++ static/js/user_profile.js | 15 ++++- templates/blocks/profile/b_new_route.html | 75 ++++++++++++++++++----- 3 files changed, 78 insertions(+), 16 deletions(-) diff --git a/static/css/styles.css b/static/css/styles.css index 3b16274..1b3f676 100644 --- a/static/css/styles.css +++ b/static/css/styles.css @@ -1619,6 +1619,10 @@ div.departure_arrival>div>input{ } +#hide_owner_type{ + display: none; +} + /*end create new route*/ diff --git a/static/js/user_profile.js b/static/js/user_profile.js index 4e7e7a8..4d33ed2 100644 --- a/static/js/user_profile.js +++ b/static/js/user_profile.js @@ -620,9 +620,22 @@ function setIcon(el) { //cleaning route inputs after selection changes function OnSelectionChange(el) { event.preventDefault() - let form = el.form; + + // if (customer.classList.contains('selected')) { + // owner_type = form.dataset['customer'] + // } else if (mover.classList.contains('selected')) { + // owner_type = form.dataset['customer'] + // } + let owner_type_value = document.getElementById('hide_owner_type').value + + + let formData = new FormData(form); + let owner_type = owner_type_value + formData.set('owner_type', owner_type) + + // formData.set('owner_type', owner_type) // let data = {}; // data['csrfmiddlewaretoken'] = $('input[name="csrfmiddlewaretoken"]')[0].value; diff --git a/templates/blocks/profile/b_new_route.html b/templates/blocks/profile/b_new_route.html index 0ef540a..756a353 100644 --- a/templates/blocks/profile/b_new_route.html +++ b/templates/blocks/profile/b_new_route.html @@ -32,7 +32,7 @@ {# #} - +{# #} {% if form.initial and form.initial.type_transport and form.initial.type_transport != '' %}
@@ -105,7 +105,19 @@
- + {#
- +
- + #}
- +
- +