This commit is contained in:
SDE
2023-08-01 17:01:49 +03:00
parent ff008bfc7d
commit 7d743652c0
7 changed files with 68 additions and 322 deletions

View File

@@ -17,7 +17,7 @@
{% for item in form.fields.type_transport.choices %}
<option
value="{{ item.0 }}"
{% if form.cleaned_data.type_transport == item.0 %}
{% if form.initial.type_transport == item.0 %}
selected="selected"
{% endif %}>
{{ item.1 }}
@@ -29,7 +29,7 @@
{% endif %}
</div>
{% if form.cleaned_data and form.cleaned_data.type_transport and form.cleaned_data.type_transport != '' %}
{% if form.initial and form.initial.type_transport and form.initial.type_transport != '' %}
<hr>
<div class="departure_arrival">
<div>
@@ -40,7 +40,7 @@
name="departure_DT"
{% if form.fields.departure_DT.required %} required{% endif %}
id="id_departure_DT"
{% if form.data.departure_DT %}value="{{ form.data.departure_DT }}"{% endif %}
{% if form.initial.departure_DT %}value="{{ form.initial.departure_DT.date|date:"Y-m-d" }}T{{ form.initial.departure_DT.time|date:"H:i" }}"{% endif %}
/>
{% if not errors_off and form.errors and form.errors.departure_DT %}
@@ -54,8 +54,7 @@
name="arrival_DT"
{% if form.fields.arrival_DT.required %} required{% endif %}
id="id_arrival_DT"
{% if form.data.arrival_DT %}value="{{ form.data.arrival_DT }}"{% endif %}
{# |date: 'Y-m-d H:i' #}
{% if form.initial.arrival_DT %}value="{{ form.initial.arrival_DT.date|date:"Y-m-d" }}T{{ form.initial.arrival_DT.time|date:"H:i" }}"{% endif %}
/>
{% if not errors_off and form.errors and form.errors.arrival_DT %}
<span>{{ form.errors.arrival_DT }}</span>
@@ -71,12 +70,13 @@
oninput="searchTown(this)"
onclick="searchTown(this)"
onblur="setTimeout(()=>onblurInputField(event, this), 100)"
onFocus="this.select()"
autocomplete="off"
type="text"
list="from_address_point"
name="from_address_point_txt"
{% if form.fields.from_address_point.required %} required{% endif %}
id="id_from_address_point_txt"
{% if form.cleaned_data.from_address_point_txt %}value="{{ form.cleaned_data.from_address_point_txt }}"{% endif %}
{% if form.initial.from_address_point_txt %}value="{{ form.initial.from_address_point_txt }}"{% endif %}
/>
<datalist id="from_address_point">
@@ -95,11 +95,13 @@
oninput="searchTown(this)"
onclick="searchTown(this)"
onblur="setTimeout(()=>onblurInputField(event, this), 100)"
onFocus="this.select()"
autocomplete="off"
type="text"
name="to_address_point_txt"
{% if form.fields.to_address_point.required %} required{% endif %}
id="id_to_address_point_txt"
{% if form.cleaned_data.to_address_point_txt %}value="{{ form.cleaned_data.to_address_point_txt}}"{% endif %}
{% if form.initial.to_address_point_txt %}value="{{ form.initial.to_address_point_txt}}"{% endif %}
/>
<div class="input_list" name="to_address_point_txt_list">
@@ -128,7 +130,7 @@
{% if form.fields.from_place.required %} required{% endif %}>
{% for item in form.fields.from_place.choices %}
<option
value="{{ item.0 }}"{% if form.cleaned_data.from_place == item.0 %}
value="{{ item.0 }}"{% if form.initial.from_place == item.0 %}
selected="selected"{% endif %}>{{ item.1 }}
</option>
{% endfor %}
@@ -145,7 +147,7 @@
{% if form.fields.to_place.required %} required{% endif %}>
{% for item in form.fields.to_place.choices %}
<option
value="{{ item.0 }}"{% if form.cleaned_data.to_place == item.0 %}
value="{{ item.0 }}"{% if form.initial.to_place == item.0 %}
selected="selected"{% endif %}>{{ item.1 }}
</option>
{% endfor %}
@@ -210,7 +212,7 @@
{% if form.fields.weight.required %} required{% endif %}
name="weight"
value=""
{% if form.cleaned_data.weight %}value="{{ form.cleaned_data.weight}}"{% endif %}
{% if form.initial.weight %}value="{{ form.initial.weight}}"{% endif %}
/>
{% if not errors_off and form.errors and form.errors.weight %}
<span>{{ form.errors.weight }}</span>
@@ -240,12 +242,12 @@
<div>
<label for="id_phone">{{ form.fields.phone.label }}</label>
<input
type="text"
type="phone"
name="phone"
placeholder="{{ form.fields.phone.label }}"
{% if form.fields.phone.required %} required{% endif %}
id="id_phone"
{% if form.cleaned_data.phone %}value="{{ form.cleaned_data.phone}}"{% endif %}
{% if form.initial.phone %}value="{{ form.initial.phone}}"{% endif %}
/>
{% if not errors_off and form.errors and form.errors.phone %}
@@ -257,11 +259,11 @@
<label for="id_extra_phone">{{ form.fields.extra_phone.label }}</label>
<input
type="text"
type="phone"
name="extra_phone"
id="id_extra_phone"
placeholder="{{ form.fields.extra_phone.label }}"
{% if form.cleaned_data.extra_phone %}value="{{ form.cleaned_data.extra_phone}}"{% endif %}
{% if form.initial.extra_phone %}value="{{ form.initial.extra_phone}}"{% endif %}
/>
{% if not errors_off and form.errors and form.errors.extra_phone %}
<span>{{ form.errors.extra_phone }}</span>