fix admin base models
This commit is contained in:
SDE
2023-09-26 11:26:10 +03:00
parent dd7795d845
commit 7a8f3bdbb5
7 changed files with 174 additions and 65 deletions

View File

@@ -1837,4 +1837,76 @@
margin-bottom: 30px;
}
.cont_header_btn_profile{
position: relative;
}
.menu_profile_btn{
display: none;
position: absolute;
right: 100px;
z-index: 220;
}
.menu_profile_btn.show{
display: block;
background: #FFF;
padding: 10px;
width: 230px;
position: absolute;
right: 0;
top: 60px;
border-radius: 10px;
font-size: 14px;
font-weight: 600;
text-align: center;
}
.button_profile_header{
height: 50px;
width: 150px;
background: #FF613A;
color: #FFF;
/* Heading 5 */
font-size: 18px;
font-style: normal;
font-weight: 600;
text-decoration: none;
line-height: 26px;
border-radius: 10px;
text-align: center;
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.12);
}
.btn_menu_profile:first-of-type{
margin-top: 20px;
}
.btn_menu_profile:last-child{
width: 100%;
}
.btn_menu_profile{
border-radius: 10px;
background: #FFF;
box-shadow: -1px 4px 10px 0 rgba(198, 199, 203, 0.20), 0 -1px 10px 0 rgba(198, 199, 203, 0.20);
width: 93%;
padding: 4%;
margin-bottom: 20px;
display: block;
color: #27242499;
font-weight: 600;
cursor: pointer;
}
.separator_menu_profile{
margin: 10px 0 10px 0;
border:1px solid #E6E6E6;
width: 98%;
}
.subscribe_type_txt{
color: #000;
font-size: 14px;
}

View File

@@ -26,7 +26,7 @@
this.maxSpan = !1,
this.autoApply = 1,
this.singleDatePicker = !1,
this.showDropdowns = !1,
this.showDropdowns = 1,
this.minYear = t().subtract(100, "year").format("YYYY"),
this.maxYear = t().add(100, "year").format("YYYY"),
this.showWeekNumbers = !1,

View File

@@ -1,5 +1,9 @@
function filters_func_find_route_main (el,owner_type=null,win_loc_replace=null){
let timeout_range_slider = null
function filters_func_find_route_main (el,owner_type=null,win_loc_replace=null,weight=null){
document.querySelector(".loader_filters_routes").classList.toggle("show")
console.log("asd")
if (win_loc_replace){
event.preventDefault()
let data_d = {}
@@ -33,56 +37,72 @@ function filters_func_find_route_main (el,owner_type=null,win_loc_replace=null){
get_url = get_url + `owner_type=${owner_type}`
}
if (weight){
$.ajax({
headers: { "X-CSRFToken": $('input[name=csrfmiddlewaretoken]').val() },
url: '/ru/routes/find_routes/',
type: "POST",
// async: true,
cache: false,
processData: false,
contentType: false,
// enctype: 'json',
data: JSON.stringify(data_d),
success: function(data){
document.querySelector(".loader_filters_routes").classList.toggle("show")
document.querySelector(".block-finded-routes").innerHTML = data.html
if (data.html === "\n\n\n\n\n"){
// document.querySelector(".block-finded-routes").innerHTML = "<span style='color: #ff0000;font-weight: 800;font-size: 18px;padding: 10px;'>Нечего не найдено!</span>"
document.querySelector(".block-finded-routes").innerHTML = "<div class=\"not_found_routes show\">\n" +
" <div class=\"text-align-center fw-700 font-large c-txt-b2 m-a w-80 m-t-8p\">\n" +
" Упс... <span class=\"orange-text\">Ничего не найдено</span>, попробуйте\n" +
" изменить параметры поиска или оставьте заявку\n" +
" на перевозку посылки\n" +
" </div>\n" +
" <img class=\"boxes_not_fond_routes left\" src=\"/static/img/boxes_for_not_found_routes/b_1.svg\"\">\n" +
" <img class=\"boxes_not_fond_routes right\" src=\"/static/img/boxes_for_not_found_routes/b_2.svg\"\">\n" +
" </div>"
} else {
document.querySelector(".block-finded-routes").innerHTML = data.html
if (timeout_range_slider) {
clearTimeout(timeout_range_slider)
}
// window.location.href = window.location.href + "?" + get_url
// window.location.search = "?" + get_url
history.pushState({'data':data_d,'str_data':get_url}, "state_filters", `?${get_url}`);
// let element = document.createElement("img")
// element.classList.add("loader_filters_routes")
// element.src = "/static/img/svg/loader.svg"
let div = document.createElement("div")
div.classList.add("width-100")
div.classList.add("text-align-center")
div.classList.add("mb-10")
div.innerHTML = "<img src='/static/img/svg/loader.svg' class='loader_filters_routes'/>"
let ins_bef_el = document.querySelector(".block-finded-routes").firstChild
$(div).insertBefore(ins_bef_el)
// window.history.pushState({data:get_url
// },{})
},
errors: function (data){
timeout_range_slider = setTimeout(
function () {
ajax_for_filter(data_d, get_url)
}
,3000)
} else {
ajax_for_filter(data_d, get_url)
}
});
}
}
function ajax_for_filter (data_d,get_url){
$.ajax({
headers: { "X-CSRFToken": $('input[name=csrfmiddlewaretoken]').val() },
url: '/ru/routes/find_routes/',
type: "POST",
// async: true,
cache: false,
processData: false,
contentType: false,
// enctype: 'json',
data: JSON.stringify(data_d),
success: function(data){
document.querySelector(".block-finded-routes").innerHTML = data.html
if (data.html === "\n\n\n\n\n"){
// document.querySelector(".block-finded-routes").innerHTML = "<span style='color: #ff0000;font-weight: 800;font-size: 18px;padding: 10px;'>Нечего не найдено!</span>"
document.querySelector(".block-finded-routes").innerHTML = "<div class=\"not_found_routes show\">\n" +
" <div class=\"text-align-center fw-700 font-large c-txt-b2 m-a w-80 m-t-8p\">\n" +
" Упс... <span class=\"orange-text\">Ничего не найдено</span>, попробуйте\n" +
" изменить параметры поиска или оставьте заявку\n" +
" на перевозку посылки\n" +
" </div>\n" +
" <img class=\"boxes_not_fond_routes left\" src=\"/static/img/boxes_for_not_found_routes/b_1.svg\"\">\n" +
" <img class=\"boxes_not_fond_routes right\" src=\"/static/img/boxes_for_not_found_routes/b_2.svg\"\">\n" +
" </div>"
} else {
document.querySelector(".block-finded-routes").innerHTML = data.html
}
// window.location.href = window.location.href + "?" + get_url
// window.location.search = "?" + get_url
history.pushState({'data':data_d,'str_data':get_url}, "state_filters", `?${get_url}`);
// let element = document.createElement("img")
// element.classList.add("loader_filters_routes")
// element.src = "/static/img/svg/loader.svg"
let div = document.createElement("div")
div.classList.add("width-100")
div.classList.add("text-align-center")
div.classList.add("mb-10")
div.innerHTML = "<img src='/static/img/svg/loader.svg' class='loader_filters_routes'/>"
let ins_bef_el = document.querySelector(".block-finded-routes").firstChild
$(div).insertBefore(ins_bef_el)
// window.history.pushState({data:get_url
// },{})
// clearTimeout(t)
},
errors: function (data){
// clearTimeout(t)
}
});
return null
}

View File

@@ -61,7 +61,7 @@ function init_arrival_DT (){
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'))
$('#id_arrival_DT').val(start.format('DD.MM.YYYY HH:mm'))
});
$(`${place_1.id} .drp-calendar.right`).hide();
@@ -98,7 +98,7 @@ function init_departure_DT (){
// $('#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'))
$('#id_departure_DT').val(start.format('DD.MM.YYYY HH:mm'))
});

View File

@@ -460,4 +460,12 @@ function send_subscribe (id){
}
});
}
function show_header_list () {
let el = document.querySelector(".menu_profile_btn")
if (el) {
el.classList.toggle("show")
}
}

View File

@@ -37,21 +37,30 @@
</div>
{% if user.is_authenticated %}
{# boris changed #}
<div class="cont_header_btn_profile">
<div class="button_profile_header" onclick="show_header_list()" data-user-id="{{ user.id }}">
<a class="button_profile_header" data-user-id="{{ user.id }}"
href="{% url "user_profile" %}">
<span>
{{ user.first_name }} {{ user.last_name }}
</span>
<div class="icon_unread_messages" style="padding-top: 2px;padding-right: 13px;">
<div class="cost-messages-in-user-tab-messenger" style="background: #FFFFFF;">
<span class="unredmessages_value_text" style="padding-top: 2px;padding-left: 0; color: #000000;"></span>
</div>
<span>
{{ user.first_name }} {{ user.last_name }}
</span>
<div class="icon_unread_messages" style="padding-top: 2px;padding-right: 13px;">
<div class="cost-messages-in-user-tab-messenger" style="background: #FFFFFF;">
<span class="unredmessages_value_text" style="padding-top: 2px;padding-left: 0; color: #000000;"></span>
</div>
</div>
</div>
</a>
<div class="menu_profile_btn">
<div class="subscribe_type_txt"><span>Подписка:</span> <span>Стандарт</span></div>
<a class="btn_menu_profile" href="{% url "user_profile" %}" >Перейти в профиль</a>
<a class="btn_menu_profile" href="{% url 'profile_page' 'create_route_for_mover' %}">Перевезти посылку</a>
<a class="btn_menu_profile" href="{% url 'profile_page' 'create_route_for_customer' %}">Отправить посылку</a>
<a class="btn_menu_profile" href="{% url 'profile_page' 'my_routes' %}" >Мои объявления</a>
<div class="separator_menu_profile"></div>
<button class="btn_menu_profile">Выйти из профиля</button>
</div>
</div>
{# end #}
{% endif %}
{% if not user.is_authenticated %}

View File

@@ -70,7 +70,7 @@
<div class="methods_transportation_form_filters">
<label for="weight">Вес посылки (кг)</label>
<div class="range-slider">
<input oninput="filters_func_find_route_main(this,'{{ owner_type }}')" type="text" class="range_slider_form_filters el_form_find_route" name="weight" value="{{ route_form.fields.weight.initial }}" />
<input oninput="filters_func_find_route_main(this,'{{ owner_type }}',null,'weight')" type="text" class="range_slider_form_filters el_form_find_route" name="weight" value="{{ route_form.fields.weight.initial }}" />
</div>
<div class="inputs_for_slider_cont">
<input type="text" class="input_f_slider_start" value="100" />