From c2b68903117c7719e8ec7c12330d37d5dca7896c Mon Sep 17 00:00:00 2001 From: ArtemB Date: Tue, 2 Jul 2024 15:30:34 +0300 Subject: [PATCH] 1.1.24 upd msg counter --- .../chat_socket_functions/etc_operations_for_chat_socket.js | 4 +++- templates/blocks/b_header.html | 4 ++-- templates/widgets/profile/w_button_for_profile_menu.html | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/static/js/chat_socket_functions/etc_operations_for_chat_socket.js b/static/js/chat_socket_functions/etc_operations_for_chat_socket.js index 9f6bab0..bdd9fd6 100644 --- a/static/js/chat_socket_functions/etc_operations_for_chat_socket.js +++ b/static/js/chat_socket_functions/etc_operations_for_chat_socket.js @@ -8,8 +8,10 @@ function update_count_unread_messages (data) { for (i;i < list_unrd.length;i++){ if (!list_unrd_parent[i].classList.contains("showed")){ - list_unrd_parent[i].classList.toggle("showed") + // list_unrd_parent[i].classList.toggle("showed") + list_unrd[i].innerHTML = data.unread_msgs_count.toString() + } else { list_unrd[i].innerHTML = data.unread_msgs_count.toString() } } diff --git a/templates/blocks/b_header.html b/templates/blocks/b_header.html index df67331..3db15ac 100644 --- a/templates/blocks/b_header.html +++ b/templates/blocks/b_header.html @@ -74,9 +74,9 @@ {{ user.first_name|truncatechars:6}} {{ user.last_name|truncatechars:5 }} -
+
- + {{ unanswered_msgs_count }}
diff --git a/templates/widgets/profile/w_button_for_profile_menu.html b/templates/widgets/profile/w_button_for_profile_menu.html index a656f19..24dbab4 100644 --- a/templates/widgets/profile/w_button_for_profile_menu.html +++ b/templates/widgets/profile/w_button_for_profile_menu.html @@ -24,9 +24,9 @@ {% endif %} {{ title }} {% if sel_page_name == 'chat' %} -
+
- + {{ unanswered_msgs_count }}
{% endif %}