This commit is contained in:
SBD
2023-12-03 13:52:49 +03:00
parent 1be50b1277
commit c74aff7b91
3 changed files with 12 additions and 5 deletions

View File

@@ -9,7 +9,6 @@ profile_tabs_f_static_map = new Map([
['dashboard','dashboard'] ['dashboard','dashboard']
]) ])
function select_tab_profile (el,url,owner_type=null) { function select_tab_profile (el,url,owner_type=null) {
let data = {} let data = {}
let confirm_url = `/user_account/${url}/` let confirm_url = `/user_account/${url}/`
@@ -80,6 +79,9 @@ function select_tab_profile (el,url,owner_type=null) {
setStandartSettingsToBlockOverlay() setStandartSettingsToBlockOverlay()
} }
if (window.location.href.includes("profile")){
selectTabProfileIfHisNotSelected(url)
}
}, },
error: function (data){ error: function (data){
console.log(data) console.log(data)
@@ -87,6 +89,13 @@ function select_tab_profile (el,url,owner_type=null) {
} }
}); });
} }
function selectTabProfileIfHisNotSelected (url) {
let el_f_select = document.querySelector(`[data-ajax-url=${url}]`)
el_f_select.classList.add('selected')
}
function clickONTHEAPROfileBTN (el) { function clickONTHEAPROfileBTN (el) {
let el_f_click = el.querySelector(".text_btn_profile") let el_f_click = el.querySelector(".text_btn_profile")
el_f_click.click() el_f_click.click()

View File

@@ -23,8 +23,6 @@
<div class="prof_first_line">{% translate "Если у Вас возникнут вопросы Вы можете связаться с нами:" %} <a href="mailto:support@twb.com">support@twb.com</a></div> <div class="prof_first_line">{% translate "Если у Вас возникнут вопросы Вы можете связаться с нами:" %} <a href="mailto:support@twb.com">support@twb.com</a></div>
<div class="prof_second_line"> <div class="prof_second_line">
{% blocktrans %}У Вас {{ unanswered_msgs_count }} новых сообщений{% endblocktrans %} {% blocktrans %}У Вас {{ unanswered_msgs_count }} новых сообщений{% endblocktrans %}
<a href="#"></a> <a onclick="select_tab_profile(this,'chats'{% if owner_type %},'{{ owner_type }}'{% endif %})"onclick="clickONTHEAPROfileBTN(this)">{% translate "Посмотреть" %}</a>
<a href="#">{% translate "Посмотреть" %}</a>
</div> </div>
{# <div class="prof_third_line">{% translate "Хотите получать уведомление о появлении посылок?" %} <a href="#">{% translate "Заполните форму" %}</a></div>#} {# <div class="prof_third_line">{% translate "Хотите получать уведомление о появлении посылок?" %} <a href="#">{% translate "Заполните форму" %}</a></div>#}

View File

@@ -1,6 +1,6 @@
<div <div
{% if dom_id %}id="{{ dom_id }}"{% endif %} {% if dom_id %}id="{{ dom_id }}"{% endif %}
{% if ajax_url and page_type == 'profile' %}onclick="select_tab_profile(this,'{{ ajax_url }}'{% if owner_type %},'{{ owner_type }}'{% endif %})"{% else %}onclick="clickONTHEAPROfileBTN(this)"{% endif %} {% if ajax_url and page_type == 'profile' %}data-ajax-url="{{ ajax_url }}" onclick="select_tab_profile(this,'{{ ajax_url }}'{% if owner_type %},'{{ owner_type }}'{% endif %})"{% else %}onclick="clickONTHEAPROfileBTN(this)"{% endif %}
{% if page_name == sel_page_name %} {% if page_name == sel_page_name %}
class="selected" class="selected"
{% endif %} > {% endif %} >