0.0.125 add url replace menu_profile

This commit is contained in:
2023-09-04 14:46:20 +03:00
parent 528ab0a8e2
commit 60a21740db
2 changed files with 61 additions and 9 deletions

View File

@@ -20,6 +20,9 @@ function writeMessage(el){
list_div.forEach(el=>{ el.classList.remove('selected'); });
el.classList.add('selected')
//updating the url without reloading
window.history.pushState(null, null, '/ru/profile/page/chat/')
},
error: function (data, exception){
console.log(400)
@@ -53,6 +56,9 @@ function technicalSupport(el){
list_div.forEach(el=>{ el.classList.remove('selected'); });
el.classList.add('selected')
//updating the url without reloading
window.history.pushState(null, null, '/ru/profile/page/support/')
},
error: function (data, exception){
@@ -86,6 +92,9 @@ function mySubscription(el){
list_div.forEach(el=>{ el.classList.remove('selected'); });
el.classList.add('selected')
//updating the url without reloading
window.history.pushState(null, null, '/ru/profile/page/my_subscribe/')
},
error: function (data, exception){
@@ -117,6 +126,9 @@ function myProfile(el){
list_div.forEach(el=>{ el.classList.remove('selected'); });
el.classList.add('selected')
//updating the url without reloading
window.history.pushState(null, null, '/ru/profile/page/change_profile/')
},
error: function (data, exception){
@@ -492,6 +504,14 @@ function createRoute(el, owner_type){
list_div.forEach(el=>{ el.classList.remove('selected'); });
el.classList.add('selected')
//updating the url without reloading
if(el.id == 'customer'){
window.history.pushState(null, null, '/ru/profile/page/create_route_for_customer/')
} else {
window.history.pushState(null, null, '/ru/profile/page/create_route_for_mover/')
}
//get dynamic value
@@ -538,6 +558,9 @@ function getRoute(el){
list_div.forEach(el=>{ el.classList.remove('selected'); });
el.classList.add('selected')
window.history.pushState(null, null, '/ru/profile/page/my_routes/')
},
error: function (data, exception){
@@ -659,5 +682,3 @@ function RequestCommercialOffer (el){

View File

@@ -9,19 +9,38 @@
<img class="svg" src="/static/img/svg/MagnifyingGlass.svg">
<a href="#">Поиск посылки</a>
</div>
<div id="customer" onclick="createRoute(this)">
<div
id="customer"
onclick="createRoute(this)"
{% if page_name == 'create_route_for_customer' %}
class="selected"
{% endif %} >
<img class="svg" src="/static/img/svg/PushPin.svg">
<a href="#">Разместить объявление как отправитель</a>
</div>
<div id="mover" onclick="createRoute(this)">
<div
id="mover"
onclick="createRoute(this)"
{% if page_name == 'create_route_for_mover' %}
class="selected"
{% endif %}>
<img class="svg" src="/static/img/svg/PushPin.svg">
<a href="#">Разместить объявление как перевозчик</a>
</div>
<div id="my_routes_id" onclick="getRoute(this)">
<div
id="my_routes_id"
onclick="getRoute(this)"
{% if page_name == 'my_routes' %}
class="selected"
{% endif %}>
<img class="svg" src="/static/img/svg/Cards.svg">
<a href="#">Мои объявления</a>
</div>
<div onclick="writeMessage(this)">
<div
onclick="writeMessage(this)"
{% if page_name == 'chat' %}
class="selected"
{% endif %}>
<img class="svg" src="/static/img/svg/ChatCircleDots.svg">
<a href="#">Написать сообщение
<div class="icon_unread_messages" style="padding-top: 0;">
@@ -31,15 +50,27 @@
</div>
</a>
</div>
<div onclick="technicalSupport(this)">
<div
onclick="technicalSupport(this)"
{% if page_name == 'support' %}
class="selected"
{% endif %}>
<img class="svg" src="/static/img/svg/Headset.svg">
<a href="#">Тех. поддержка</a>
</div>
<div onclick="mySubscription(this)">
<div
onclick="mySubscription(this)"
{% if page_name == 'my_subscribe' %}
class="selected"
{% endif %}>
<img class="svg" src="/static/img/svg/CurrencyDollar.svg">
<a href="#">Моя подписка</a>
</div>
<div onclick="myProfile(this)">
<div
onclick="myProfile(this)"
{% if page_name == 'change_profile' %}
class="selected"
{% endif %}>
<img class="svg" src="/static/img/svg/User.svg">
<a href="#">Мой профиль</a>
</div>