0.0.201
This commit is contained in:
@@ -1477,6 +1477,16 @@
|
||||
display: block;
|
||||
}
|
||||
|
||||
.loader_filters_routes{
|
||||
width: 25px;
|
||||
height: 25px;
|
||||
display: none;
|
||||
}
|
||||
|
||||
.loader_filters_routes.show{
|
||||
display: block;
|
||||
}
|
||||
|
||||
.line_separator_page_w_el{
|
||||
width: 100%;
|
||||
border-bottom: 1px solid #919BA5;
|
||||
|
||||
@@ -7,9 +7,10 @@ function load_routes (el) {
|
||||
'from_el':parseInt(number_last_route) + 1,
|
||||
'to_el':parseInt(number_last_route) + 11
|
||||
}
|
||||
let list = forloop_func_form(data_d,"get")
|
||||
let get_url = ""
|
||||
let list = forloop_func_form(data_d,"get",get_url)
|
||||
data_d = list[0]
|
||||
let get_url = list[1]
|
||||
get_url = list[1]
|
||||
let loader = document.querySelector(".loader_f_loading_routes")
|
||||
loader.classList.toggle("show")
|
||||
el.classList.toggle("hide")
|
||||
|
||||
@@ -1,36 +1,43 @@
|
||||
function filters_func_find_route_main (el){
|
||||
event.preventDefault()
|
||||
// let form = el.form
|
||||
// let formData = new FormDat a(form)
|
||||
let data_d = {}
|
||||
let list = forloop_func_form(data_d,"get")
|
||||
data_d = list[0]
|
||||
let get_url = list[1]
|
||||
$.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>"
|
||||
} else {
|
||||
if (el !== document.querySelector(".range_slider_form_filters")){
|
||||
event.preventDefault()
|
||||
}
|
||||
// document.querySelector(".loader_filters_routes").classList.toggle("show")
|
||||
let one_sec = setTimeout(function (){
|
||||
// let form = el.form
|
||||
// let formData = new FormDat a(form)
|
||||
let data_d = {}
|
||||
let get_url = ""
|
||||
let list = forloop_func_form(data_d,"get",get_url)
|
||||
data_d = list[0]
|
||||
get_url = list[1]
|
||||
$.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
|
||||
}
|
||||
// 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}`);
|
||||
// window.history.pushState({data:get_url
|
||||
// },{})
|
||||
},
|
||||
errors: function (data){
|
||||
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>"
|
||||
} 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}`);
|
||||
// window.history.pushState({data:get_url
|
||||
// },{})
|
||||
},
|
||||
errors: function (data){
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
},1000)
|
||||
}
|
||||
@@ -148,6 +148,7 @@
|
||||
type="checkbox"
|
||||
name="type_transport"
|
||||
id="id_cargo_type_car_{{ forloop.counter }}"
|
||||
onchange="filters_func_find_route_main(this)"
|
||||
value="{{ item.0 }}"
|
||||
/>
|
||||
|
||||
@@ -173,7 +174,7 @@
|
||||
</div>
|
||||
<div class="methods_transportation_form_filters">
|
||||
<div class="title_el_methods_transportation">Откуда забрать посылку</div>
|
||||
<select class="select_form_filters_find_route el_form_find_route" name="from_place">
|
||||
<select onchange="filters_func_find_route_main(this)" class="select_form_filters_find_route el_form_find_route" name="from_place">
|
||||
<option value="" selected="selected">--не имеет значения--</option>
|
||||
{% for item in form.fields.from_place.choices %}
|
||||
<option value="{{ item.0 }}">{{ item.1 }}</option>
|
||||
@@ -185,7 +186,7 @@
|
||||
</div>
|
||||
<div class="methods_transportation_form_filters">
|
||||
<div class="title_el_methods_transportation">Куда доставить посылку</div>
|
||||
<select class="select_form_filters_find_route el_form_find_route" name="to_place">
|
||||
<select onchange="filters_func_find_route_main(this)" class="select_form_filters_find_route el_form_find_route" name="to_place">
|
||||
<option value="" selected="selected">--не имеет значения--</option>
|
||||
{% for item in form.fields.to_place.choices %}
|
||||
<option value="{{ item.0 }}">{{ item.1 }}</option>
|
||||
@@ -195,7 +196,7 @@
|
||||
<div class="methods_transportation_form_filters">
|
||||
<label for="weight">Вес посылки (кг)</label>
|
||||
<div class="range-slider">
|
||||
<input type="text" class="range_slider_form_filters el_form_find_route" name="weight" value="{{ form.fields.weight.initial }}" />
|
||||
<input oninput="filters_func_find_route_main(this)" type="text" class="range_slider_form_filters el_form_find_route" name="weight" value="{{ form.fields.weight.initial }}" />
|
||||
</div>
|
||||
<div class="inputs_for_slider_cont">
|
||||
<input type="text" class="input_f_slider_start" value="100" />
|
||||
@@ -206,13 +207,14 @@
|
||||
</div>
|
||||
<div class="methods_transportation_form_filters">
|
||||
<div class="title_el_methods_transportation">Сортировать по:</div>
|
||||
<select name="sort" class="select_form_filters_find_route el_form_find_route">
|
||||
<select onchange="filters_func_find_route_main(this)" name="sort" class="select_form_filters_find_route el_form_find_route">
|
||||
<option value="last">По последним</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="block-finded-routes">
|
||||
<img class="loader_filters_routes" src="{% static "img/svg/loader.svg" %}">
|
||||
<div class="page_routes_1">
|
||||
{% include "blocks/b_search_routes.html" %}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user