1.0.1 upd select_tab_profile

This commit is contained in:
2024-05-07 17:40:07 +03:00
parent 9eb5936690
commit a0eeb7b642
4 changed files with 13 additions and 7 deletions

View File

@@ -9,7 +9,7 @@ profile_tabs_f_static_map = new Map([
['dashboard','dashboard']
])
function select_tab_profile (el,url,owner_type=null) {
function select_tab_profile (el,url,owner_type=null, check_orders_required) {
let data = {}
let confirm_url = `/user_account/${url}/`
if (url.includes('subscribe')){
@@ -20,7 +20,12 @@ function select_tab_profile (el,url,owner_type=null) {
}
} else if (url.includes('get_routes')){
confirm_url = `/routes/${url}/`
} else if(url.includes('my_subscribe')){
data = {
'check_orders_required': check_orders_required
}
}
if (window.location.href.includes("profile")){
document.querySelector(".info_profile").innerHTML = '<img src="/static/img/svg/loader.svg" style="height: 30px;position: absolute;top: 47%;left: 45%;"/>'
}
@@ -95,8 +100,9 @@ function select_tab_profile (el,url,owner_type=null) {
}
}
}
if(window.location.href.includes("my_subscribe") && data.check_orders_required === true) {
select_tab_profile()
if(window.location.href.includes("my_subscribe") ) {
select_tab_profile(el,url,owner_type=null, data.check_orders_required )
return
}
setCokie(365,'twb_new_messages','false')
@@ -754,7 +760,7 @@ function sendMessageEnter (e,id_ticket,sender,receiver){
}
}
function send_subscribe (id,for_movers,subscribe){
function send_subscribe (id, for_movers, subscribe){
if (!for_movers) {
let data = {
'subscribe_id': id

View File

@@ -16,7 +16,7 @@
<div class="f-r">
<div class="cur_subscribe_label">{% translate "Текущая подписка:" %}</div>
<div class="cur_subscribe_f_profile">{% if user_subscribe.subscribe.name %}{{ user_subscribe.subscribe.name }}{% else %}{% translate "Нет активных подписок" %}{% endif %}</div>
<div class="btn_go_to_subscribes pointer" onclick="select_tab_profile(this,'show_cur_subscribe')">{% translate "Перейти к подпискам" %}</div>
<div class="btn_go_to_subscribes pointer" onclick="select_tab_profile(this,'show_cur_subscribe', {% if owner_type %},'{{ owner_type }}' {% else %}, null {% endif %}, false)">{% translate "Перейти к подпискам" %}</div>
</div>
<div class="clear_both"></div>
</div>

View File

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

View File

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