From d3fd7b7428ac2b8e7a8017c12b6ed85cc4943a8d Mon Sep 17 00:00:00 2001 From: ArtemB Date: Thu, 26 Oct 2023 16:26:29 +0300 Subject: [PATCH] 0.0.183 media 360px v.3.1 --- static/css/mobile_styles.css | 26 +++++-- static/css/styles.css | 11 +-- static/js/global_js.js | 16 +--- static/js/user_profile.js | 75 ++++++++++++++++--- templates/blocks/b_footer.html | 14 ++-- templates/blocks/b_header.html | 6 +- .../f_find_route_form_main_find_routes.html | 2 +- 7 files changed, 104 insertions(+), 46 deletions(-) diff --git a/static/css/mobile_styles.css b/static/css/mobile_styles.css index 77cec30..347fe2c 100644 --- a/static/css/mobile_styles.css +++ b/static/css/mobile_styles.css @@ -20,10 +20,26 @@ display: none; } - .container_form_search_carrier{ - margin: 10px; + .container_form_search_carrier{ + flex-direction: column; + width: unset; + margin: 170px 10px 10px 10px; } + #abbreviation_airport_in_search{ + float: left; + height: 95%; + border-radius: 0 10px 0 0; + border-top: 2px solid #E6E6E6; + border-right: 2px solid #E6E6E6; + border-bottom: 2px solid #E6E6E6; + } + .from_address_point_txt.find_route.first{ + border-radius: 10px 0 0 0; + border-top: 2px solid #E6E6E6; + border-bottom: 2px solid #E6E6E6; + border-left: 2px solid #E6E6E6; + } .button_profile_header{ display: none; @@ -128,11 +144,7 @@ .news_item { margin-bottom: 20px; } - .container_form_search_carrier{ - flex-direction: column; - margin-top: 170px; - width: unset; - } + .header-second-item, .header_btn_sender, diff --git a/static/css/styles.css b/static/css/styles.css index 0ec8876..9ea149d 100644 --- a/static/css/styles.css +++ b/static/css/styles.css @@ -361,16 +361,16 @@ footer>div { color: #272424; } -.sf_1-column{ +.sf_1_column{ padding-left: 80px; padding-right: 230px; } -.sf_2-column, -.sf_3-column +.sf_2_column, +.sf_3_column { padding-right: 40px; } -.sf_4-column{ +.sf_4_column{ display: inline-block; } @@ -604,7 +604,8 @@ header .header-second { .header-second-item, -.cont_header_btn_profile{ +.cont_header_btn_profile, +.header-second-item-lang{ display: inline-block; vertical-align: middle; } diff --git a/static/js/global_js.js b/static/js/global_js.js index 0d169aa..4fe044d 100644 --- a/static/js/global_js.js +++ b/static/js/global_js.js @@ -51,21 +51,7 @@ window.addEventListener('scroll', () => { // Действия при изменении URL -// function changeImgLang(el) { -// -// let img = document.getElementById('dropbtn_lang') -// -// if (el.innerText === 'RU'){ -// img.style.background = "url('/static/img/png/ru.png') no-repeat left center;" -// } -// else if(el.innerText === 'EN'){ -// img.style.background = "url('/static/img/png/en.png')" -// img.style.backgroundRepeat = "no-repeat" -// img.style.backgroundPosition = "left center" -// -// } -// -// } + diff --git a/static/js/user_profile.js b/static/js/user_profile.js index a9e4172..26b8651 100644 --- a/static/js/user_profile.js +++ b/static/js/user_profile.js @@ -15,12 +15,22 @@ function writeMessage(el){ document.querySelector(".info_profile").innerHTML = data.html; let list_div = document.querySelectorAll('.menu_profile div'); + let ru_lang = document.getElementById('ru_lang'); + let en_lang = document.getElementById('en_lang'); + ru_lang.pathname = "/ru/profile/page/chat/"; + en_lang.pathname = "/en/profile/page/chat/"; list_div.forEach(el=>{ el.classList.remove('selected'); }); el.classList.add('selected') let body = document.querySelector("body") body.style.overflow = "hidden" //updating the url without reloading - window.history.pushState(null, null, '/ru/profile/page/chat/') + if (window.location.href.indexOf("/ru/") > -1) { + window.history.pushState(null, null, '/ru/profile/page/chat/') + + } else if(window.location.href.indexOf("/en/") > -1){ + window.history.pushState(null, null, '/en/profile/page/chat/') + } + middleWareJS() }, @@ -33,6 +43,7 @@ function writeMessage(el){ function technicalSupport(el){ + console.log(el) $.ajax({ headers: { "X-CSRFToken": $('input[name=csrfmiddlewaretoken]').val() }, url: '/user_account/support_tickets/', @@ -50,11 +61,20 @@ function technicalSupport(el){ document.querySelector(".info_profile").innerHTML = data.html; let list_div = document.querySelectorAll('.menu_profile div'); + let ru_lang = document.getElementById('ru_lang'); + let en_lang = document.getElementById('en_lang'); + ru_lang.pathname = "/ru/profile/page/support/"; + en_lang.pathname = "/en/profile/page/support/"; 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/') + if (window.location.href.indexOf("/ru/") > -1) { + window.history.pushState(null, null, '/ru/profile/page/support/') + + } else if(window.location.href.indexOf("/en/") > -1){ + window.history.pushState(null, null, '/en/profile/page/support/') + } middleWareJS() }, @@ -82,13 +102,21 @@ function mySubscription(el){ // location.href = '/profile' // document.querySelector(".info_profile").innerHTML = data.html; - + let ru_lang = document.getElementById('ru_lang'); + let en_lang = document.getElementById('en_lang'); + ru_lang.pathname = "/ru/profile/page/my_subscribe/"; + en_lang.pathname = "/en/profile/page/my_subscribe/"; let list_div = document.querySelectorAll('.menu_profile div'); 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/') + if (window.location.href.indexOf("/ru/") > -1) { + window.history.pushState(null, null, '/ru/profile/page/my_subscribe/') + + } else if(window.location.href.indexOf("/en/") > -1){ + window.history.pushState(null, null, '/en/profile/page/my_subscribe/') + } middleWareJS() }, @@ -114,13 +142,21 @@ function myProfile(el){ // location.href = '/profile' document.querySelector(".info_profile").innerHTML = data.html; - + let ru_lang = document.getElementById('ru_lang'); + let en_lang = document.getElementById('en_lang'); + ru_lang.pathname = "/ru/profile/page/change_profile/"; + en_lang.pathname = "/en/profile/page/change_profile/"; let list_div = document.querySelectorAll('.menu_profile div'); 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/') + if (window.location.href.indexOf("/ru/") > -1) { + window.history.pushState(null, null, '/ru/profile/page/change_profile/') + + } else if(window.location.href.indexOf("/en/") > -1){ + window.history.pushState(null, null, '/en/profile/page/change_profile/') + } middleWareJS() }, @@ -608,14 +644,22 @@ function createRoute(el, owner_type){ document.querySelector(".info_profile").innerHTML = data.html let list_div = document.querySelectorAll('.menu_profile div'); + let ru_lang = document.getElementById('ru_lang'); + let en_lang = document.getElementById('en_lang'); + list_div.forEach(el=>{ el.classList.remove('selected'); }); el.classList.add('selected') - //updating the url without reloading - if(el.id == 'customer'){ + // updating the url without reload + + if(el.id === 'customer'){ window.history.pushState(null, null, '/ru/profile/page/create_route_for_customer/') + ru_lang.pathname = "/ru/profile/page/create_route_for_customer/"; + en_lang.pathname = "/en/profile/page/create_route_for_customer/"; } else { window.history.pushState(null, null, '/ru/profile/page/create_route_for_mover/') + ru_lang.pathname = "/ru/profile/page/create_route_for_mover/"; + en_lang.pathname = "/en/profile/page/create_route_for_mover/"; } middleWareJS() @@ -657,13 +701,26 @@ function getRoute(el){ // location.href = '/profile' + document.querySelector(".info_profile").innerHTML = data.html; + let ru_lang = document.getElementById('ru_lang'); + let en_lang = document.getElementById('en_lang'); + ru_lang.pathname = "/ru/profile/page/my_routes/"; + en_lang.pathname = "/en/profile/page/my_routes/"; + let list_div = document.querySelectorAll('.menu_profile div'); list_div.forEach(el=>{ el.classList.remove('selected'); }); el.classList.add('selected') - window.history.pushState(null, null, '/ru/profile/page/my_routes/') + if (window.location.href.indexOf("/ru/") > -1) { + window.history.pushState(null, null, '/ru/profile/page/my_routes/') + + } else if(window.location.href.indexOf("/en/") > -1){ + window.history.pushState(null, null, '/en/profile/page/my_routes/') + } + + middleWareJS() diff --git a/templates/blocks/b_footer.html b/templates/blocks/b_footer.html index 49aecae..86a6c1c 100644 --- a/templates/blocks/b_footer.html +++ b/templates/blocks/b_footer.html @@ -68,14 +68,16 @@