From 335c10a3041d96760f944773d49d6bff3de16af8 Mon Sep 17 00:00:00 2001 From: borissedw Date: Wed, 2 Aug 2023 17:18:54 +0300 Subject: [PATCH] 0.0.26 --- static/css/styles(boris).css | 16 ++++++++++++++-- static/js/user_profile(boris).js | 8 ++++++-- templates/blocks/profile/b_support_chat.html | 2 +- templates/widgets/w_message.html | 8 ++++---- 4 files changed, 25 insertions(+), 9 deletions(-) diff --git a/static/css/styles(boris).css b/static/css/styles(boris).css index 222464f..e11913b 100644 --- a/static/css/styles(boris).css +++ b/static/css/styles(boris).css @@ -324,8 +324,9 @@ .container-messages{ height: 74%; width: 100%; - /*min-height: 376px;*/ + /*transform: rotate(180deg);*/ overflow-y: auto; + -webkit-transform: scaleY(-1); } .footer-chat{ @@ -481,14 +482,23 @@ height: 90px; margin-bottom: 70px; margin-left: 20px; + margin-right: 20px; } .container-message_support_chat.left{ float: left; + display: block; + /* transform: rotate(180deg); */ + /* transform: scaleY(-1); */ + -webkit-transform: scaleY(-1); } .container-message_support_chat.right{ float: right; + display: block; + /* transform: rotate(180deg); */ + /* transform: scaleY(-1); */ + -webkit-transform: scaleY(-1); } .block_avatar_message{ @@ -499,11 +509,13 @@ .block_avatar_message.left{ float: left; + text-align: left; } .block_avatar_message.right{ float: right; - margin-left: 20px; + /*margin-left: 20px;*/ + text-align: right; } .block_avatar_message > img{ diff --git a/static/js/user_profile(boris).js b/static/js/user_profile(boris).js index f275944..0d0f614 100644 --- a/static/js/user_profile(boris).js +++ b/static/js/user_profile(boris).js @@ -184,9 +184,12 @@ function selectedUserMessenger (el,ticket_id){ }); } -function sendMessage(id_ticket,sender,receiver,text){ +function sendMessage(id_ticket,sender,receiver){ event.preventDefault() + let text = document.querySelector(".enter-message-inp").value + + let data = { 'id_ticket': id_ticket, 'sender': sender, @@ -194,9 +197,10 @@ function sendMessage(id_ticket,sender,receiver,text){ 'text': text } + $.ajax({ headers: { "X-CSRFToken": $('input[name=csrfmiddlewaretoken]').val() }, - url: '/ru/messages/create_ticket/', + url: '/ru/messages/send_msg/', type: "POST", // async: true, cache: false, diff --git a/templates/blocks/profile/b_support_chat.html b/templates/blocks/profile/b_support_chat.html index c21af92..e9bfb71 100644 --- a/templates/blocks/profile/b_support_chat.html +++ b/templates/blocks/profile/b_support_chat.html @@ -49,7 +49,7 @@
- +
{% endif %} diff --git a/templates/widgets/w_message.html b/templates/widgets/w_message.html index 70c22b7..2267ac7 100644 --- a/templates/widgets/w_message.html +++ b/templates/widgets/w_message.html @@ -1,16 +1,16 @@ {% load static %}
-
+
-
-
+
+
{{ text }}
-
+
{{ modifiedDT }}