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; 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.maxSpan = !1,
this.autoApply = 1, this.autoApply = 1,
this.singleDatePicker = !1, this.singleDatePicker = !1,
this.showDropdowns = !1, this.showDropdowns = 1,
this.minYear = t().subtract(100, "year").format("YYYY"), this.minYear = t().subtract(100, "year").format("YYYY"),
this.maxYear = t().add(100, "year").format("YYYY"), this.maxYear = t().add(100, "year").format("YYYY"),
this.showWeekNumbers = !1, 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") console.log("asd")
if (win_loc_replace){ if (win_loc_replace){
event.preventDefault() event.preventDefault()
let data_d = {} let data_d = {}
@@ -33,7 +37,24 @@ function filters_func_find_route_main (el,owner_type=null,win_loc_replace=null){
get_url = get_url + `owner_type=${owner_type}` get_url = get_url + `owner_type=${owner_type}`
} }
if (weight){
if (timeout_range_slider) {
clearTimeout(timeout_range_slider)
}
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({ $.ajax({
headers: { "X-CSRFToken": $('input[name=csrfmiddlewaretoken]').val() }, headers: { "X-CSRFToken": $('input[name=csrfmiddlewaretoken]').val() },
url: '/ru/routes/find_routes/', url: '/ru/routes/find_routes/',
@@ -45,7 +66,6 @@ function filters_func_find_route_main (el,owner_type=null,win_loc_replace=null){
// enctype: 'json', // enctype: 'json',
data: JSON.stringify(data_d), data: JSON.stringify(data_d),
success: function(data){ success: function(data){
document.querySelector(".loader_filters_routes").classList.toggle("show")
document.querySelector(".block-finded-routes").innerHTML = data.html document.querySelector(".block-finded-routes").innerHTML = data.html
if (data.html === "\n\n\n\n\n"){ 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 = "<span style='color: #ff0000;font-weight: 800;font-size: 18px;padding: 10px;'>Нечего не найдено!</span>"
@@ -78,11 +98,11 @@ function filters_func_find_route_main (el,owner_type=null,win_loc_replace=null){
$(div).insertBefore(ins_bef_el) $(div).insertBefore(ins_bef_el)
// window.history.pushState({data:get_url // window.history.pushState({data:get_url
// },{}) // },{})
// clearTimeout(t)
}, },
errors: function (data){ errors: function (data){
// clearTimeout(t)
} }
}); });
return null
}
} }

View File

@@ -61,7 +61,7 @@ function init_arrival_DT (){
function (start, end, label) { function (start, end, label) {
// $('#displayRegervation').text('Registration date is: ' + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD')); // $('#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(); $(`${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')); // $('#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['departure_DT'] = start.format('YYYY-MM-DD');
// $('#regervation')[0].dataset['arrival_DT'] = end.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

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

View File

@@ -37,10 +37,10 @@
</div> </div>
{% if user.is_authenticated %} {% 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> <span>
{{ user.first_name }} {{ user.last_name }} {{ user.first_name }} {{ user.last_name }}
</span> </span>
@@ -49,9 +49,18 @@
<span class="unredmessages_value_text" style="padding-top: 2px;padding-left: 0; color: #000000;"></span> <span class="unredmessages_value_text" style="padding-top: 2px;padding-left: 0; color: #000000;"></span>
</div> </div>
</div> </div>
</a> </div>
<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 %} {% endif %}
{% if not user.is_authenticated %} {% if not user.is_authenticated %}

View File

@@ -70,7 +70,7 @@
<div class="methods_transportation_form_filters"> <div class="methods_transportation_form_filters">
<label for="weight">Вес посылки (кг)</label> <label for="weight">Вес посылки (кг)</label>
<div class="range-slider"> <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>
<div class="inputs_for_slider_cont"> <div class="inputs_for_slider_cont">
<input type="text" class="input_f_slider_start" value="100" /> <input type="text" class="input_f_slider_start" value="100" />