diff --git a/static/css/styles(boris).css b/static/css/styles(boris).css index 4355542..ee1ba62 100644 --- a/static/css/styles(boris).css +++ b/static/css/styles(boris).css @@ -708,6 +708,13 @@ display: block; } +.unredmessages_value_text{ + padding-top: 8px; + padding-left: 0; + position:relative; + top: -6px; +} + .cost-messages-in-user-tab-messenger{ width: 15px; @@ -719,8 +726,8 @@ } .cost-messages-in-user-tab-messenger > span{ - padding-top: 1px; - display: block; + padding-top: 7px; + /*display: block;*/ font-size: 10px; } @@ -2791,7 +2798,7 @@ a.open_inf_carrier{ /*}*/ .menu_profile>div>a{ /*font-size: 12px;*/ - line-height: 13px; + /*line-height: 13px;*/ } .menu_profile>div>.logout{ height: 100%; diff --git a/static/css/styles.css b/static/css/styles.css index a44e2b6..e5b7d71 100644 --- a/static/css/styles.css +++ b/static/css/styles.css @@ -3304,6 +3304,31 @@ details[open] summary ~ *{ text-decoration: underline; } +.self_news_text>ul>li{ + list-style: disc; + +} +.self_news_text>ul{ + margin-left: 20px; +} +.self_news_text>ol{ + padding-left: 20px; +} +.self_news_text>ol>li{ + margin: 10px 0; +} +.self_news_text>ol>li>ul{ + list-style: disc; + margin-left: 20px; +} +.advertisement_block_news { + display: none; +} + +.self_news_text>img{ + margin: 15px 0; +} + .self_news_img{ float: right; width: 40%; 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 bdd9fd6..c45dd9e 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 @@ -1,21 +1,28 @@ function update_count_unread_messages (data) { let selected_btn = document.querySelector(".selected") + let list_unrd = document.querySelectorAll(".unredmessages_value_text") + let current_count = parseInt(list_unrd[i].innerHTML); if (selected_btn.dataset['ajaxUrl'] !== 'chats'){ - let list_unrd = document.querySelectorAll(".unredmessages_value_text") let list_unrd_parent = document.querySelectorAll(".icon_unread_messages") let i = 0 + for (i;i < list_unrd.length;i++){ - if (!list_unrd_parent[i].classList.contains("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() - } + + if(data.unread_msgs_count){ + list_unrd[i].innerHTML = (current_count + 1).toString(); + } + + if(current_count === 0){ + list_unrd_parent[i].classList.toggle("showed") + } + } - } + } else if (current_count === 0){ + list_unrd_parent[i].classList.toggle("showed") + } } function play_required_beep (data,beep) { diff --git a/static/js/global_js.js b/static/js/global_js.js index 511719a..c0f251e 100644 --- a/static/js/global_js.js +++ b/static/js/global_js.js @@ -41,7 +41,7 @@ window.onload = function (){ // } let chats = document.querySelector(`[data-ajax-url='chats']`) if (chats){ - deleteMarkerMessages() + // deleteMarkerMessages() } } } diff --git a/static/js/user_profile_2.js b/static/js/user_profile_2.js index 1d88edd..b340bda 100644 --- a/static/js/user_profile_2.js +++ b/static/js/user_profile_2.js @@ -93,7 +93,7 @@ function select_tab_profile (el,url,owner_type=null, check_orders_required) { if (window.location.href.includes("profile")){ selectTabProfileIfHisNotSelected(url) } - deleteMarkerMessages(el) + // deleteMarkerMessages(el) checkStatesAfterTransitionToAnotherTabProfile() goToChatIfChat() if (window.location.href.includes("chat") || window.location.href.includes("support")) { @@ -560,6 +560,8 @@ function selectedUserMessenger (ticket_id=null,user_id=null,el){ url = 'show_chat_w_user/' } let user_type = getInfoAboutUser() + + update_count_unread_messages() // if (user_type === 'mobile' || user_type === 'laptop') { // open_curtain_w_contacts() // } @@ -579,6 +581,7 @@ function selectedUserMessenger (ticket_id=null,user_id=null,el){ if (loader){ loader.classList.toggle("show") } + update_count_unread_messages() // let left_curtain = document.querySelector('.curtain.left') document.querySelector(".info_profile").innerHTML = data.html; document.querySelector(".enter-message-inp").focus() diff --git a/templates/blocks/b_footer.html b/templates/blocks/b_footer.html index a40ad90..a291686 100644 --- a/templates/blocks/b_footer.html +++ b/templates/blocks/b_footer.html @@ -20,7 +20,7 @@ - + diff --git a/templates/blocks/b_header.html b/templates/blocks/b_header.html index 3db15ac..40effdc 100644 --- a/templates/blocks/b_header.html +++ b/templates/blocks/b_header.html @@ -74,7 +74,7 @@ {{ 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 24dbab4..9a54a65 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 }} + {{ unanswered_msgs_count }}
{% endif %}