From 6e758cf62eaa03d070c8485783dee0a6bc145d47 Mon Sep 17 00:00:00 2001 From: SDE Date: Tue, 5 Dec 2023 12:47:23 +0300 Subject: [PATCH 1/2] 0.8.34 fix route_search --- static/js/filters_functions_find_route.js | 16 ++++++++-------- .../f_find_route_form_main_find_routes.html | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/static/js/filters_functions_find_route.js b/static/js/filters_functions_find_route.js index 77dc79d..b951d8a 100644 --- a/static/js/filters_functions_find_route.js +++ b/static/js/filters_functions_find_route.js @@ -1,6 +1,6 @@ timeout_range_slider = null -function filters_func_find_route_main (el,owner_type=null,win_loc_replace=null,weight=null){ +function filters_func_find_route_main (el, owner_type=null, win_loc_replace=null, weight=null){ console.log("asd") @@ -11,9 +11,9 @@ function filters_func_find_route_main (el,owner_type=null,win_loc_replace=null,w let list = forloop_func_form(data_d,"get",get_url) data_d = list[0] get_url = list[1] - // if (owner_type !== null) { - // data_d['owner_type'] = owner_type - // } + if (owner_type !== null) { + data_d['owner_type'] = owner_type + } // get_url = get_url + `owner_type=${owner_type}` window.location.href = `${win_loc_replace}?${get_url}` @@ -31,10 +31,10 @@ function filters_func_find_route_main (el,owner_type=null,win_loc_replace=null,w let list = forloop_func_form(data_d,"get",get_url) data_d = list[0] get_url = list[1] - // if (owner_type !== null) { - // data_d['owner_type'] = owner_type - // get_url = get_url + `owner_type=${owner_type}` - // } + if (owner_type !== null) { + data_d['owner_type'] = owner_type + // get_url = get_url + `owner_type=${owner_type}` + } if (weight){ diff --git a/templates/forms/f_find_route_form_main_find_routes.html b/templates/forms/f_find_route_form_main_find_routes.html index 71efd7a..57f5567 100644 --- a/templates/forms/f_find_route_form_main_find_routes.html +++ b/templates/forms/f_find_route_form_main_find_routes.html @@ -101,7 +101,7 @@
{% if show_filter_and_results %} - + {% else %} {% endif %} From fc194d3f85183a040d99c7dded46c65e72ad2a7b Mon Sep 17 00:00:00 2001 From: SDE Date: Tue, 5 Dec 2023 13:25:31 +0300 Subject: [PATCH 2/2] 0.8.35 order for city / country --- ReferenceDataApp/js_views.py | 2 +- RoutesApp/models.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ReferenceDataApp/js_views.py b/ReferenceDataApp/js_views.py index 8cc66bf..2d94c37 100644 --- a/ReferenceDataApp/js_views.py +++ b/ReferenceDataApp/js_views.py @@ -55,7 +55,7 @@ def get_address_point_ajax(request): else: item['city_name'] = item['name'] item['country_name'] = item['country__name'] - item['fullname'] = f'{item["country_name"]} / {item["city_name"]}' + item['fullname'] = f'{item["city_name"]} / {item["country_name"]}' html = f"{html}{render_to_string('widgets/w_ac_input_address_point.html', item)}" i += 1 diff --git a/RoutesApp/models.py b/RoutesApp/models.py index 6172981..3f1d39a 100644 --- a/RoutesApp/models.py +++ b/RoutesApp/models.py @@ -111,8 +111,8 @@ class Route(BaseModel): to_address_point_Dict = to_address_point_objs.values( 'id', 'name', 'country__name')[0] - from_address_point_txt = f'{from_address_point_Dict["country__name"]} / {from_address_point_Dict["name"]}' - to_address_point_txt = f'{to_address_point_Dict["country__name"]} / {to_address_point_Dict["name"]}' + from_address_point_txt = f'{from_address_point_Dict["name"]} / {from_address_point_Dict["country__name"]}' + to_address_point_txt = f'{to_address_point_Dict["name"]} / {to_address_point_Dict["country__name"]}' return { 'from_address_point_obj': from_address_point_objs[0],