From 8f3773cda445f6c2597bb6ab71823c4dc329cdf7 Mon Sep 17 00:00:00 2001 From: borissedw Date: Tue, 8 Aug 2023 16:26:18 +0300 Subject: [PATCH] 0.0.75 --- static/js/check_new_messages.js | 2 +- static/js/user_profile(boris).js | 19 +++++++++++++++---- templates/blocks/profile/b_chats.html | 2 +- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/static/js/check_new_messages.js b/static/js/check_new_messages.js index 7380d9c..1d364dd 100644 --- a/static/js/check_new_messages.js +++ b/static/js/check_new_messages.js @@ -29,7 +29,7 @@ function check_new_messages_timeout(){ check_new_messages(window,it) } }, - 10000) + 60000) } var data = null diff --git a/static/js/user_profile(boris).js b/static/js/user_profile(boris).js index c0f8706..3ba761c 100644 --- a/static/js/user_profile(boris).js +++ b/static/js/user_profile(boris).js @@ -143,13 +143,24 @@ function createTicket (el) { } -function selectedUserMessenger (el,ticket_id){ - let data = { - 'ticket_id': ticket_id +function selectedUserMessenger (ticket_id=null,user_id=null){ + let data = null + let url = null + if (ticket_id !== null){ + data = { + 'ticket_id': ticket_id + } + url = 'support_show_chat_by_ticket/' + } else if (user_id !== null){ + data = { + 'user_id': user_id + } + url = 'show_chat_w_user/' } + $.ajax({ headers: { "X-CSRFToken": $('input[name=csrfmiddlewaretoken]').val() }, - url: '/ru/messages/support_show_chat_by_ticket/', + url: '/ru/messages/' + url, type: "POST", // async: true, cache: false, diff --git a/templates/blocks/profile/b_chats.html b/templates/blocks/profile/b_chats.html index c6f5b37..220acc3 100644 --- a/templates/blocks/profile/b_chats.html +++ b/templates/blocks/profile/b_chats.html @@ -69,7 +69,7 @@
Чаты:
- {% for receiver in receivers %} + {% for item in receivers %} {% include "widgets/w_chat_right_panel_tickets.html" %} {% endfor %}