From 4354d1369dc34510abeebe55825803f8a03c791d Mon Sep 17 00:00:00 2001 From: ArtemB Date: Mon, 28 Aug 2023 17:21:03 +0300 Subject: [PATCH] 0.0.112 --- static/css/styles.css | 1 + static/js/user_profile.js | 21 ++++++++++++++++++++- templates/blocks/b_user_profile.html | 6 ++++-- 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/static/css/styles.css b/static/css/styles.css index eb303c3..382a717 100644 --- a/static/css/styles.css +++ b/static/css/styles.css @@ -1224,6 +1224,7 @@ form.new_route{ line-height: 22px; appearance: none; height: 60px; + padding-left: 10px; } diff --git a/static/js/user_profile.js b/static/js/user_profile.js index eaf104f..8c50b12 100644 --- a/static/js/user_profile.js +++ b/static/js/user_profile.js @@ -345,9 +345,28 @@ function sliderInit() { } function sendRoute(el, routeID = null){ + let obj ={} + let selected_owner_type = document.querySelectorAll("#customer, #mover") + + selected_owner_type.forEach(function(item) { + if (item.classList.contains('selected')) { + let { id, innerText } = item + obj['owner_type'] = id + } +}); + + if (selected_owner_type[0].classList.contains('selected')){ + + }else + + event.preventDefault() let form = el.form; let formData = new FormData(form); + let data = { + formData, + obj + } let url = '/ru/routes/create_or_change_route/' if (routeID !== null){ url = '/ru/routes/change_route/' + routeID + '/' @@ -362,7 +381,7 @@ function sendRoute(el, routeID = null){ processData: false, contentType: false, // enctype: 'json', - data: formData, + data: JSON.stringify(data), success: function(data){ if (data.user_alerts) { getNewMessageSession() diff --git a/templates/blocks/b_user_profile.html b/templates/blocks/b_user_profile.html index d9b7554..9752695 100644 --- a/templates/blocks/b_user_profile.html +++ b/templates/blocks/b_user_profile.html @@ -1,3 +1,5 @@ +{% load i18n %} +
{% csrf_token %} -
+ -
+