0.0.34
change algo get_address_point_ajax
This commit is contained in:
@@ -40,8 +40,12 @@ def get_address_point_ajax(request):
|
||||
else:
|
||||
res_data = search_cities_in_db(data['search_str'])
|
||||
|
||||
res_data_str_list = []
|
||||
for item in res_data:
|
||||
res_data_str_list.append(render_to_string('widgets/w_ac_input_address_point.html', item))
|
||||
|
||||
res_Dict = {
|
||||
'data': list(res_data)
|
||||
'res_search_list': res_data_str_list
|
||||
}
|
||||
|
||||
return JsonResponse(res_Dict)
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
<input type="number" name="from_address_point" id="id_from_address_point" hidden />
|
||||
<input oninput="searchTown(this)" type="text" name="from_address_point_txt"{% if form.fields.from_address_point.required %} required{% endif %} id="id_from_address_point_txt">
|
||||
<div class="input_list" name="from_address_point_txt">
|
||||
{% include 'widgets/w_autocomplete_input.html' %}
|
||||
{% include 'widgets/w_ac_input_address_point.html' %}
|
||||
</div>
|
||||
{% if form.errors and form.errors.from_address_point %}
|
||||
<span>{{ form.errors.from_address_point}}</span>
|
||||
@@ -54,7 +54,7 @@
|
||||
<input type="number" name="to_address_point" id="id_to_address_point" hidden />
|
||||
<input oninput="searchTown(this)" type="text" name="to_address_point_txt"{% if form.fields.to_address_point.required %} required{% endif %} id="id_to_address_point"/>
|
||||
<div class="input_list" name="from_address_point_txt">
|
||||
{% include 'widgets/w_autocomplete_input.html' %}
|
||||
{% include 'widgets/w_ac_input_address_point.html' %}
|
||||
</div>
|
||||
{% if form.errors and form.errors.to_address_point %}
|
||||
<span>{{ form.errors.to_address_point }}</span>
|
||||
|
||||
9
templates/widgets/w_ac_input_address_point.html
Normal file
9
templates/widgets/w_ac_input_address_point.html
Normal file
@@ -0,0 +1,9 @@
|
||||
<div
|
||||
onclick="selectItemAddrPoint('+ r.id+', '+ airport_name +')"
|
||||
class="autocomplete-result"
|
||||
data-index="'+ i +'" data-id="'+ r.id + '">
|
||||
<div>
|
||||
<b></b>
|
||||
</div>
|
||||
<div class="autocomplete-location"></div>
|
||||
</div>
|
||||
@@ -1,6 +0,0 @@
|
||||
<div onclick="selectItemAddrPoint('+ r.id+', '+ airport_name +')" class="autocomplete-result" data-index="'+ i +'" data-id="'+ r.id + '">
|
||||
<div>
|
||||
<b></b>
|
||||
</div>
|
||||
<div class="autocomplete-location"></div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user