Merge pull request 'dev' (#7) from dev into main

Reviewed-on: #7
This commit is contained in:
2024-08-09 18:55:31 +03:00
22 changed files with 441 additions and 197 deletions

View File

@@ -1510,6 +1510,10 @@
width: 153px;
}
.popup_content{
width: 41%;
}
}
@media (max-width: 950px){
@@ -1554,6 +1558,9 @@
.pag_news_item_text{
width: unset;
}
.popup_content{
width: 52%;
}
}
@media (max-width: 850px){
@@ -1687,6 +1694,9 @@
.marker_messages_mobile.show{
display: block;
}
.popup_content>.confirm_profile_btn{
width: 90%;
}
}
@media (max-width: 828px){
@@ -1844,6 +1854,9 @@
.inf_carrier_icon{
/*width: 3%;*/
}
.popup_content{
width: 70%;
}
}
@media (max-width: 687px){
/*.to_address_point_txt.find_route {*/

View File

@@ -3008,6 +3008,8 @@ a.open_inf_carrier{
display: none;
}
.cookie_block.show{
display: block;
}
@@ -3034,4 +3036,64 @@ a.open_inf_carrier{
height: 25px;
width: 95px;
cursor: pointer;
}
/*popup*/
.popup_wrapper{
display: none;
position: fixed; /* Используйте fixed, чтобы попап оставался на месте при прокрутке */
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5); /* Полупрозрачный фон */
justify-content: center;
align-items: center;
z-index: 9999;
}
.popup_wrapper.show{
display: flex;
}
.popup_content{
position: relative;
width: 38%;
height: fit-content;
background: #FFFFFF;
border-radius: 15px;
text-align: center;
padding: 28px;
font-family: Inter;
}
.popup_cross{
position: absolute;
right: 5%;
cursor: pointer;
}
.popup_img>img{
background: #E1E1E1;
border-radius: 39px;
padding: 5px;
}
.popup_title{
font-weight: 700;
font-size: 34px;
margin-top: 20px;
}
.popup_text{
line-height: 30px;
font-size: 20px;
margin-top: 10px;
color: #6F6C90;
}
.popup_content>.confirm_profile_btn{
width: 62%;
}
#poup_text_bold{
font-weight: 700;
color: #1d1e20;
}
#authenticated_img{
display: none;
}

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 228 KiB

View File

@@ -0,0 +1,4 @@
<svg width="19" height="18" viewBox="0 0 19 18" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M1.29785 17L17.2979 1" stroke="#170F49" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M17.2979 17L1.29785 1" stroke="#170F49" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 333 B

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 984 KiB

View File

@@ -20,6 +20,7 @@ function SendLoginForm(el){
data: formData,
success: function(data){
location.href = data.redirect_url//`/profile/page/dashboard/`
window.sessionStorage.removeItem('mailingSubscribeRequired')
window.sessionStorage.removeItem('email')
@@ -29,6 +30,8 @@ function SendLoginForm(el){
},
error: function (data, exception){
document.querySelector(".login").innerHTML = data.responseJSON.html

View File

@@ -227,6 +227,14 @@ function checkStateCookie () {
if (!window.document.cookie.includes("allow_cookie=true")){
document.querySelector(".cookie_block").classList.add("show")
}
if (!window.document.cookie.includes("popup_show=false")){
setTimeout(() => {
document.querySelector('.popup_wrapper').classList.add('show');
}, 15000);
}
if(!window.document.cookie.includes("first_authorization=true") && window.document.getElementById('authenticated_img')){
document.querySelector(".popup_wrapper").classList.add("show")
}
if (window.document.cookie.includes("twb_new_messages=true")){
if (getInfoAboutUser('screen_width') < 800) {
let marker_new_messages = document.querySelector(".marker_messages_mobile");
@@ -258,12 +266,22 @@ function getCsrfCookie () {
return csrf
}
function setCokie (days,name,val) {
function setCokie (days,name,val, url = null) {
let date = new Date();
// let days = 182;
date.setTime(+ date + (days * 86400000));
window.document.cookie = `${name}=${val}` + "; expires=" + date.toGMTString() + "; path=/";
document.querySelector(".cookie_block").classList.remove("show")
if(name === 'allow_cookie' ){
document.querySelector(".cookie_block").classList.remove("show")
} else if(name === 'popup_show'){
document.querySelector(".popup_wrapper").classList.remove("show")
if(url){
window.location.href = url}
} else if (name === 'first_authorization'){
document.querySelector(".popup_wrapper").classList.remove("show")
}
// return value;
}

View File

@@ -143,108 +143,75 @@ function init_arrival_DT (date=null,single=true,hour=true){
}
function init_departure_DT() {
let place_1 = document.querySelector("#id_departure_DT");
if (!place_1) return;
function init_departure_DT (){
let hiddenTime = document.querySelector('.local_city_time').innerText;
let place_1 = document.querySelector("#id_departure_DT")
let onl_param = ""
if (window.location.href === "http://localhost:8016/ru/profile/page/create_route_for_mover/" || window.location.href === "http://localhost:8016/ru/profile/page/create_route_for_customer/"){
onl_param = "singleDatePicker"
}
if (place_1) {
let startDate = null;
if(hiddenTime){
if (window.location.href.includes("/ru/")) {
$(place_1).daterangepicker({
"autoapply": true,
"linkedCalendars": false,
"singleDatePicker":true,
"timePicker":true,
"timePicker24Hour":true,
"locale": changeLangForDateTimePicker(),
},
function(start, end, label) {
// $('#displayRegervation').text('Registration date is: ' + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD'));
// $('#regervation')[0].dataset['departure_DT'] = start.format('YYYY-MM-DD');
// $('#regervation')[0].dataset['arrival_DT'] = end.format('YYYY-MM-DD');
$('#id_departure_DT').val(start.format('DD.MM.YYYY HH:mm'))
startDate = moment(hiddenTime, "D MMMM YYYY г. HH:mm", 'ru');
} else {
});
$(`${place_1.id} .drp-calendar.right`).hide();
$(`${place_1.id} .drp-calendar.left`).addClass('single');
$(`${place_1.id} .calendar-table`).on('DOMSubtreeModified', function() {
var el = $(`${place_1.id} .prev.available`).parent().children().last();
if (el.hasClass('next available')) {
return;
}
el.addClass('next available');
el.append('<span></span>');
});
startDate = moment(hiddenTime, "MMMM D, YYYY, h:mm a", 'en');
}
} else {
startDate = moment()
}
$(place_1).daterangepicker({
"autoapply": true,
"linkedCalendars": false,
"singleDatePicker": true,
"timePicker": true,
"timePicker24Hour": true,
"minDate": startDate,
"locale": changeLangForDateTimePicker(),
}, function (start, end, label) {
$('#id_departure_DT').val(start.format('DD.MM.YYYY HH:mm'));
});
$(`${place_1.id} .drp-calendar.right`).hide();
$(`${place_1.id} .drp-calendar.left`).addClass('single');
$(`${place_1.id} .calendar-table`).on('DOMSubtreeModified', function () {
var el = $(`${place_1.id} .prev.available`).parent().children().last();
if (el.hasClass('next available')) {
return;
}
el.addClass('next available');
el.append('<span></span>');
});
}
$(function () {
let onl_param = ""
if (window.location.href === "http://localhost:8016/ru/profile/page/create_route_for_mover/" || window.location.href === "http://localhost:8016/ru/profile/page/create_route_for_customer/"){
onl_param = "singleDatePicker: true"
}
let place_1 = document.querySelector("#id_arrival_DT")
if (place_1) {
$(place_1).daterangepicker({
"autoapply": true,
"linkedCalendars": false,
"locale": changeLangForDateTimePicker(),
},
function (start, end, label) {
// $('#displayRegervation').text('Registration date is: ' + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD'));
$('#id_arrival_DT').val(start.format('DD.MM.YYYY') + " - " + end.format('DD.MM.YYYY'))
});
$(`${place_1.id} .drp-calendar.right`).hide();
$(`${place_1.id} .drp-calendar.left`).addClass('single');
$(`${place_1.id} .calendar-table`).on('DOMSubtreeModified', function () {
var el = $(`${place_1.id} .prev.available`).parent().children().last();
if (el.hasClass('next available')) {
return;
}
el.addClass('next available');
el.append('<span></span>');
});
}
});
$(function() {
let place_1 = document.querySelector("#id_departure_DT")
let onl_param = ""
if (window.location.href === "http://localhost:8016/ru/profile/page/create_route_for_mover/" || window.location.href === "http://localhost:8016/ru/profile/page/create_route_for_customer/"){
onl_param = "singleDatePicker: true"
let onl_param = {};
if (window.location.href.includes("/ru/profile/page/create_route_for_mover/") || window.location.href.includes("/ru/profile/page/create_route_for_customer/")) {
onl_param = { singleDatePicker: true };
}
let place_1 = document.querySelector("#id_arrival_DT");
if (place_1) {
$(place_1).daterangepicker({
"autoapply": true,
"linkedCalendars": false,
"locale": changeLangForDateTimePicker(),
onl_param
},
function(start, end, label) {
// $('#displayRegervation').text('Registration date is: ' + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD'));
// $('#regervation')[0].dataset['departure_DT'] = start.format('YYYY-MM-DD');
// $('#regervation')[0].dataset['arrival_DT'] = end.format('YYYY-MM-DD');
$('#id_departure_DT').val(start.format('DD.MM.YYYY') + " - " + end.format('DD.MM.YYYY'))
// init_arrival_DT(start.format('DD.MM.YYYY'),false,false)
$('#id_arrival_DT').val('')
init_arrival_DT(start.format('DD.MM.YYYY'),false,false)
...onl_param
}, function (start, end, label) {
$('#id_arrival_DT').val(start.format('DD.MM.YYYY') + " - " + end.format('DD.MM.YYYY'));
});
$(`${place_1.id} .drp-calendar.right`).hide();
$(`${place_1.id} .drp-calendar.left`).addClass('single');
$(`${place_1.id} .calendar-table`).on('DOMSubtreeModified', function() {
$(`${place_1.id} .calendar-table`).on('DOMSubtreeModified', function () {
var el = $(`${place_1.id} .prev.available`).parent().children().last();
if (el.hasClass('next available')) {
return;
@@ -253,4 +220,37 @@ $(function() {
el.append('<span></span>');
});
}
});
});
$(function() {
let place_1 = document.querySelector("#id_departure_DT");
let onl_param = {};
if (window.location.href.includes("/ru/profile/page/create_route_for_mover/") || window.location.href.includes("/ru/profile/page/create_route_for_customer/")) {
onl_param = { singleDatePicker: true };
}
if (place_1) {
$(place_1).daterangepicker({
"autoapply": true,
"linkedCalendars": false,
"locale": changeLangForDateTimePicker(),
...onl_param
}, function (start, end, label) {
$('#id_departure_DT').val(start.format('DD.MM.YYYY') + " - " + end.format('DD.MM.YYYY'));
$('#id_arrival_DT').val('');
init_arrival_DT(start.format('DD.MM.YYYY'), false, false);
});
$(`${place_1.id} .drp-calendar.right`).hide();
$(`${place_1.id} .drp-calendar.left`).addClass('single');
$(`${place_1.id} .calendar-table`).on('DOMSubtreeModified', function () {
var el = $(`${place_1.id} .prev.available`).parent().children().last();
if (el.hasClass('next available')) {
return;
}
el.addClass('next available');
el.append('<span></span>');
});
}
});

View File

@@ -346,13 +346,27 @@ function searchTown(el){
function selectItemAddrPoint(id, name, ctrl_name,){
function selectItemAddrPoint(id, name, ctrl_name, city_DT){
let input_list = document.getElementsByName(ctrl_name + '_list')[0];
let tap_txt_cont = document.querySelector("#id_" + ctrl_name);
let local_city_time = document.querySelector(".local_city_time");
if(ctrl_name === "from_address_point_txt" && local_city_time){
local_city_time.innerHTML = city_DT;
}
tap_txt_cont.value = name;
tap_txt_cont.setAttribute('title',name)
let tap_cont = document.querySelector("#id_" + ctrl_name.slice(0, -4));
tap_cont.value = id;
if (local_city_time){
init_departure_DT()
init_arrival_DT()
}
if (tap_txt_cont.classList.contains('red_text')){
tap_txt_cont.classList.remove('red_text')
}
@@ -541,12 +555,16 @@ function sendRoute(el, routeID = null){
// if (selected_owner_type[0].classList.contains('selected')){
//
// }else{}
let owner_type_value = document.getElementById('hide_owner_type').value
let hiddenTime = document.querySelector('.local_city_time').innerText;
let owner_type_value = document.getElementById('hide_owner_type').value
let form = el.form
let formData = new FormData(form);
let owner_type = owner_type_value
formData.set('owner_type', owner_type)
formData.set('hiddenTime', hiddenTime)
let url = '/routes/create_or_change_route/'
if (routeID !== null){
@@ -805,8 +823,8 @@ function OnSelectionChange(el) {
// }
sliderInit();
init_arrival_DT()
init_departure_DT()
// init_arrival_DT()
// init_departure_DT()