diff --git a/static/js/user_profile(boris).js b/static/js/user_profile(boris).js index 076f10e..f76c13c 100644 --- a/static/js/user_profile(boris).js +++ b/static/js/user_profile(boris).js @@ -168,6 +168,34 @@ function sendMessage(id_ticket,sender,reciever,text){ document.querySelector(".insert-tech-place").innerHTML = data.responseJSON.html; + } + }); +} + +function openTicket (ticket_id){ + let data = { + 'ticket_id': ticket_id + } + + $.ajax({ + headers: { "X-CSRFToken": $('input[name=csrfmiddlewaretoken]').val() }, + url: '/ru/messages/support_show_chat_by_ticket/', + type: "POST", + // async: true, + cache: false, + processData: false, + contentType: false, + // enctype: 'json', + data: JSON.stringify(data), + success: function(data){ + + document.querySelector(".insert-tech-place").innerHTML = data.html; + + }, + error: function (data){ + + document.querySelector(".insert-tech-place").innerHTML = data.responseJSON.html; + } }); } \ No newline at end of file diff --git a/templates/widgets/w_request_tech_support.html b/templates/widgets/w_request_tech_support.html index 828693e..5a816f4 100644 --- a/templates/widgets/w_request_tech_support.html +++ b/templates/widgets/w_request_tech_support.html @@ -1,5 +1,5 @@ {% load static %} -
+
{# Текст последнего сообщени в чате (с размытием)#}