Merge remote-tracking branch 'origin/main'

This commit is contained in:
2024-01-12 17:42:00 +03:00
20 changed files with 352 additions and 27 deletions

View File

@@ -1443,7 +1443,9 @@
.header_logo, .header_btn_mover{
margin-right: 26px;
}
.cookie_block{
width: 100%;
}
.menu_buttons.curtain.left.close.chat{
width: 265px;
}

View File

@@ -2910,4 +2910,44 @@
.handler_curtain_left{
display: none;
}
/*cookie*/
.cookie_block{
background: #000000;
width: 951px;
position: fixed;
bottom: 5px;
z-index: 100000000000000;
box-sizing: border-box;
display: none;
}
.cookie_block.show{
display: block;
}
.txt_cookie{
color: #FFFFFF;
font-size: 14px;
}
.a_cookie{
color: #FFFFFF;
font-size: 14px;
}
.container_content_cookie_block{
display: flex;
justify-content: space-between;
padding: 15px;
}
.cookie_btn{
background: none;
border: 2px solid white;
color: #FFFFFF;
height: 25px;
width: 95px;
cursor: pointer;
}

View File

@@ -58,6 +58,7 @@ function ajax_for_filter (data_d,get_url){
document.querySelector(".container_loader_filters_routes").classList.toggle("show")
}
$.ajax({
// headers: { "X-CSRFToken": $('input[name=csrfmiddlewaretoken]').val() },
headers: { "X-CSRFToken": $('input[name=csrfmiddlewaretoken]').val() },
url: '/routes/find_routes/',
type: "POST",

View File

@@ -1,6 +1,6 @@
// $(document).ready(function (){
// middleWareJS()
// })
$(document).ready(function (){
checkStateCookie()
})
// window.onfocus = function () {
// getSocketState()
@@ -151,3 +151,29 @@ function scroll_ev (event,el){
}
}
function checkStateCookie () {
if (!window.document.cookie.includes("allow_cookie=true")){
document.querySelector(".cookie_block").classList.add("show")
}
}
function getCsrfCookie () {
let str = window.document.cookie
str = str.split('; ');
let obj_cookie = {}
for (let i = 0;i < str.length;i++){
let cur = str[i].split('=');
obj_cookie[cur[0]] = cur[1]
}
let csrf = obj_cookie['csrftoken']
return csrf
}
function setCokie () {
let date = new Date();
let days = 182;
date.setTime(+ date + (days * 86400000));
window.document.cookie = "allow_cookie=true" + "; expires=" + date.toGMTString() + "; path=/";
document.querySelector(".cookie_block").classList.remove("show")
return value;
}

View File

@@ -25,6 +25,7 @@ function select_tab_profile (el,url,owner_type=null) {
document.querySelector(".info_profile").innerHTML = '<img src="/static/img/svg/loader.svg" style="height: 30px;position: absolute;top: 47%;left: 45%;"/>'
}
$.ajax({
// headers: { "X-CSRFToken": $('input[name=csrfmiddlewaretoken]').val() },
headers: { "X-CSRFToken": $('input[name=csrfmiddlewaretoken]').val() },
url: confirm_url,
type: "POST",