From 09f277a03314e0dd8c4b3a1776d3072238b0ab8a Mon Sep 17 00:00:00 2001 From: borissedw Date: Wed, 2 Aug 2023 16:00:31 +0300 Subject: [PATCH] 0.0.25 --- static/js/user_profile(boris).js | 15 +++++++++++---- templates/blocks/profile/b_create_ticket.html | 2 +- templates/blocks/profile/b_support_chat.html | 2 +- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/static/js/user_profile(boris).js b/static/js/user_profile(boris).js index 8e7388f..f275944 100644 --- a/static/js/user_profile(boris).js +++ b/static/js/user_profile(boris).js @@ -184,9 +184,16 @@ function selectedUserMessenger (el,ticket_id){ }); } -function sendMessage(id_ticket,sender,reciever,text){ +function sendMessage(id_ticket,sender,receiver,text){ event.preventDefault() + let data = { + 'id_ticket': id_ticket, + 'sender': sender, + 'receiver': receiver, + 'text': text + } + $.ajax({ headers: { "X-CSRFToken": $('input[name=csrfmiddlewaretoken]').val() }, url: '/ru/messages/create_ticket/', @@ -196,15 +203,15 @@ function sendMessage(id_ticket,sender,reciever,text){ processData: false, contentType: false, // enctype: 'json', - data: formData, + data: JSON.stringify(data), success: function(data){ - document.querySelector(".insert-tech-place").innerHTML = data.html; + document.querySelector(".info_profile").innerHTML = data.html; }, error: function (data){ - document.querySelector(".insert-tech-place").innerHTML = data.responseJSON.html; + document.querySelector(".info_profile").innerHTML = data.responseJSON.html; } }); diff --git a/templates/blocks/profile/b_create_ticket.html b/templates/blocks/profile/b_create_ticket.html index 083828d..e040693 100644 --- a/templates/blocks/profile/b_create_ticket.html +++ b/templates/blocks/profile/b_create_ticket.html @@ -35,8 +35,8 @@ onclick="countLetters()" oninput="countLetters()" maxlength="500"> - {% if form.errors.text %}
{{ form.errors.text }}
{% endif %}
0/500
+ {% if form.errors.text %}
{{ form.errors.text }}
{% endif %} diff --git a/templates/blocks/profile/b_support_chat.html b/templates/blocks/profile/b_support_chat.html index ea20bec..a14ddb4 100644 --- a/templates/blocks/profile/b_support_chat.html +++ b/templates/blocks/profile/b_support_chat.html @@ -47,7 +47,7 @@
- +
{% endif %}