This commit is contained in:
2023-10-31 22:07:27 +03:00
parent 8c05b987ed
commit 189b9233ab
2 changed files with 19 additions and 2 deletions

View File

@@ -166,10 +166,27 @@ function forloop_func_form (data,get,str) {
}
}
}
if (!data["type_transport"]){
data["type_transport"] = ""
str = `${str}type_transport=&`
}
let btn_find_routes = document.querySelector(".btn_find_routes")
if (btn_find_routes){
if (!str.includes('owner_type')){
if (data['owner_type']){
str = `${str}owner_type=${data['owner_type']}`
} else {
let btn_find_routes = document.querySelector(".btn_find_routes")
if (btn_find_routes.dataset){
let dataset = btn_find_routes.dataset
if (dataset['owner_type']){
str = `${str}owner_type=${dataset['owner_type']}`
}
}
}
}
}
if (get !== null){
let list = [data,str]
return list

View File

@@ -101,9 +101,9 @@
<div class="cont-el-form-search-carrier el_form_find_route">
<label style="opacity: 0">test</label>
{% if show_filter_and_results %}
<button onclick="filters_func_find_route_main(this,'{{ owner_type }}')">Найти</button>
<button class="btn_find_routes" onclick="filters_func_find_route_main(this,'{{ owner_type }}')" data-owner_type='{{ owner_type }}'>Найти</button>
{% else %}
<button onclick="filters_func_find_route_main(this,'{{ owner_type }}','{% url "route_search_results_View" %}')">Найти</button>
<button class="btn_find_routes" onclick="filters_func_find_route_main(this,'{{ owner_type }}','{% url "route_search_results_View" %}')" data-owner_type='{{ owner_type }}'>Найти</button>
{% endif %}
</div>
</div>