diff --git a/static/js/user_profile_2.js b/static/js/user_profile_2.js index a04102d..69ff70c 100644 --- a/static/js/user_profile_2.js +++ b/static/js/user_profile_2.js @@ -367,25 +367,26 @@ async function attachFilemeassge (el,id_ticket=null,sender=null,receiver=null,ch function change_profile_confirm (el){ event.preventDefault() let form = el.form - let changed_elements = {} - for (let i = 0;i < form.length;i++){ - let cur_el = form[i] - if (cur_el.localName !== 'button'){ - let new_val = cur_el.value - let dataset = cur_el.dataset - let old_val = '' - if (dataset){ - old_val = dataset['initialValue'] - } - // if (old_val){ - if (old_val === new_val){ - // - } else { - changed_elements[cur_el.name] = cur_el.value - } - } - // } - } + let formData = new FormData(form); + // let changed_elements = {} + // for (let i = 0;i < form.length;i++){ + // let cur_el = form[i] + // if (cur_el.localName !== 'button'){ + // let new_val = cur_el.value + // let dataset = cur_el.dataset + // let old_val = '' + // if (dataset){ + // old_val = dataset['initialValue'] + // } + // // if (old_val){ + // if (old_val === new_val){ + // // + // } else { + // changed_elements[cur_el.name] = cur_el.value + // } + // } + // // } + // } $.ajax({ @@ -397,7 +398,8 @@ function change_profile_confirm (el){ processData: false, contentType: false, // enctype: 'json', - data: JSON.stringify(changed_elements), + // data: JSON.stringify(changed_elements), + data: formData, success: function(data){ middleWareJS() @@ -406,7 +408,8 @@ function change_profile_confirm (el){ }, error: function (data){ - document.querySelector(".avatar_user_profile").innerHTML = data.responseJSON.html; + // document.querySelector(".avatar_user_profile").innerHTML = data.responseJSON.html; + document.querySelector(".info_profile").innerHTML = data.responseJSON.html; } }); diff --git a/templates/blocks/profile/b_chats.html b/templates/blocks/profile/b_chats.html index 155ef38..54fbdfe 100644 --- a/templates/blocks/profile/b_chats.html +++ b/templates/blocks/profile/b_chats.html @@ -65,7 +65,9 @@ {{ cur_receiver.last_name }} {{ cur_receiver.first_name }}
diff --git a/templates/blocks/profile/b_new_route.html b/templates/blocks/profile/b_new_route.html index de74afc..83850dc 100644 --- a/templates/blocks/profile/b_new_route.html +++ b/templates/blocks/profile/b_new_route.html @@ -404,7 +404,7 @@ /> {% if not errors_off and form.errors and form.errors.phone %} - {{ form.errors.phone }} + {{ form.errors.phone|safe }} {% endif %} diff --git a/templates/blocks/profile/b_profile.html b/templates/blocks/profile/b_profile.html index 9e068f1..9ae5e68 100644 --- a/templates/blocks/profile/b_profile.html +++ b/templates/blocks/profile/b_profile.html @@ -37,10 +37,10 @@