This commit is contained in:
2023-07-28 19:10:48 +03:00
parent c0ed5d5803
commit 624e0729cc

View File

@@ -35,66 +35,14 @@
<div> <div>
<label for="id_departure_DT">{{ form.fields.departure_DT.label }}</label> <label for="id_departure_DT">{{ form.fields.departure_DT.label }}</label>
<input <input
type="datetime-local" type="datetime-local"
name="departure_DT" name="departure_DT"
{% if form.fields.departure_DT.required %} required{% endif %} {% if form.fields.departure_DT.required %} required{% endif %}
id="id_departure_DT" id="id_departure_DT"
{% if form.data.departure_DT %}value="{{ form.data.departure_DT }}"{% endif %} {% if form.data.departure_DT %}value="{{ form.data.departure_DT }}"{% endif %}
/> />
{% if form.errors and form.errors.departure_DT %}
<span>{{ form.errors.departure_DT }}</span>
{% endif %}
</div>
<div>
<label for="id_arrival_DT">{{ form.fields.arrival_DT.label }}</label>
<input
type="datetime-local"
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.errors and form.errors.arrival_DT %}
<span>{{ form.errors.arrival_DT }}</span>
{% endif %}
</div>
</div>
<hr>
<div class="from_to_country">
<div class="from_country_container">
<label for="id_from_address_point">{{ form.fields.from_address_point.label }}</label>
<input type="number" name="from_address_point" id="id_from_address_point" hidden />
<input
oninput="searchTown(this)"
onclick="searchTown(this)"
onblur="onblurInputField(event, this)"
type="text"
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 %}
/>
<div class="input_list" name="from_address_point_txt_list">
</div>
{% if form.errors and form.errors.from_address_point %}
<span>{{ form.errors.from_address_point}}</span>
{% endif %}
</div>
<div>
<label for="id_to_address_point">{{ form.fields.to_address_point.label }}</label>
<input type="number" name="to_address_point" id="id_to_address_point" hidden />
<input
oninput="searchTown(this)"
onclick="searchTown(this)"
onblur="onblurInputField(event, this)"
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.errors and form.errors.departure_DT %} {% if form.errors and form.errors.departure_DT %}
<span>{{ form.errors.departure_DT }}</span> <span>{{ form.errors.departure_DT }}</span>
{% endif %} {% endif %}
@@ -148,94 +96,83 @@
id="id_to_address_point_txt" 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.cleaned_data.to_address_point_txt %}value="{{ form.cleaned_data.to_address_point_txt}}"{% endif %}
/> />
<div class="input_list" name="to_address_point_txt_list"> <div class="input_list" name="to_address_point_txt_list">
</div>
{% if form.errors and form.errors.to_address_point %}
<span>{{ form.errors.to_address_point }}</span>
{% endif %}
</div>
</div>
{# <div>#}
{# <label for="id_from_city">{{ form.fields.from_city.label }}</label>#}
{# <input type="text" name="from_city"{% if form.fields.from_city.required %} required{% endif %} id="id_from_city">#}
{# </div>#}
{# <div>#}
{# <label for="id_to_city">{{ form.fields.to_city.label }}</label>#}
{# <input type="text" name="to_city"{% if form.fields.to_city.required %} required{% endif %} id="id_to_city">#}
{# </div>#}
<div class="from_to_place">
<div>
<label for="id_from_place">{{ form.fields.from_place.label }}</label>
<select
name="from_place"
id="id_from_place"
{% 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 %}
selected="selected"{% endif %}>{{ item.1 }}
</option>
{% endfor %}
</select>
{% if form.errors and form.errors.from_place %}
<span>{{ form.errors.from_place }}</span>
{% endif %}
</div>
<div>
<label for="id_to_place">{{ form.fields.to_place.label }}</label>
<select
name="to_place"
id="id_to_place"
{% 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 %}
selected="selected"{% endif %}>{{ item.1 }}
</option>
{% endfor %}
</select>
{% if form.errors and form.errors.to_place %}
<span>{{ form.errors.to_place }}</span>
{% endif %}
</div>
</div>
<hr>
<div>
<label for="id_cargo_type">{{ form.fields.cargo_type.label }}</label>
</div>
{#<div>#}
{# <select#}
{# multiple#}
{# size="5"#}
{# name="cargo_type"#}
{# id="id_cargo_type"#}
{# {% if form.fields.cargo_type.required %} required{% endif %}>#}
{# {% for item in form.fields.cargo_type.choices %}#}
{# <option#}
{# value="{{ item.0 }}"{% if form.fields.cargo_type == item.0 %}#}
{# selected="selected"{% endif %}>{{ item.1 }}#}
{# </option>#}
{# {% endfor %}#}
{##}
{# </select>#}
{# </div>#}
</div>
{% if form.errors and form.errors.to_address_point %}
<span>{{ form.errors.to_address_point }}</span>
{% endif %}
</div>
</div>
{# <div>#}
{# <label for="id_from_city">{{ form.fields.from_city.label }}</label>#}
{# <input type="text" name="from_city"{% if form.fields.from_city.required %} required{% endif %} id="id_from_city">#}
{# </div>#}
{# <div>#}
{# <label for="id_to_city">{{ form.fields.to_city.label }}</label>#}
{# <input type="text" name="to_city"{% if form.fields.to_city.required %} required{% endif %} id="id_to_city">#}
{# </div>#}
<div class="from_to_place">
<div> <div>
{% for item in form.fields.cargo_type.choices %} <label for="id_from_place">{{ form.fields.from_place.label }}</label>
<input <select
type="checkbox" name="from_place"
name="cargo_type" id="id_from_place"
id="id_cargo_type" {% if form.fields.from_place.required %} required{% endif %}>
{% if form.fields.cargo_type.required %} required{% endif %} {% for item in form.fields.from_place.choices %}
value="{{ item.0 }}" <option
{% if form.fields.cargo_type == item.0 %} value="{{ item.0 }}"{% if form.cleaned_data.from_place == item.0 %}
{% endif %}/>{{ item.1 }} selected="selected"{% endif %}>{{ item.1 }}
{% endfor %} </option>
{% endfor %}
</select>
{% if form.errors and form.errors.from_place %}
<span>{{ form.errors.from_place }}</span>
{% endif %}
</div>
<div>
<label for="id_to_place">{{ form.fields.to_place.label }}</label>
<select
name="to_place"
id="id_to_place"
{% 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 %}
selected="selected"{% endif %}>{{ item.1 }}
</option>
{% endfor %}
</select>
{% if form.errors and form.errors.to_place %}
<span>{{ form.errors.to_place }}</span>
{% endif %}
</div>
</div>
<hr>
<div>
<label for="id_cargo_type">{{ form.fields.cargo_type.label }}</label>
</div>
{#<div>#}
{# <select#}
{# multiple#}
{# size="5"#}
{# name="cargo_type"#}
{# id="id_cargo_type"#}
{# {% if form.fields.cargo_type.required %} required{% endif %}>#}
{# {% for item in form.fields.cargo_type.choices %}#}
{# <option#}
{# value="{{ item.0 }}"{% if form.fields.cargo_type == item.0 %}#}
{# selected="selected"{% endif %}>{{ item.1 }}#}
{# </option>#}
{# {% endfor %}#}
{##}
{# </select>#}
{# </div>#}
<div class="checkbox_cargo_type"> <div class="checkbox_cargo_type">
{% for item in form.fields.cargo_type.choices %} {% for item in form.fields.cargo_type.choices %}
<input <input
@@ -248,79 +185,79 @@
{% endif %}/>{{ item.1 }} {% endif %}/>{{ item.1 }}
{% endfor %} {% endfor %}
{# <lable for="">#} {# <lable for="">#}
{##} {##}
{# </lable>#} {# </lable>#}
{% if form.errors and form.errors.cargo_type %} {% if form.errors and form.errors.cargo_type %}
<span>{{ form.errors.cargo_type }}</span> <span>{{ form.errors.cargo_type }}</span>
{% endif %} {% endif %}
</div> </div>
<hr> <hr>
<div class="range-slider"> <div class="range-slider">
<label for="id_weight">{{ form.fields.weight.label }}</label> <label for="id_weight">{{ form.fields.weight.label }}</label>
<input <input
type="text" type="text"
id="id_weight" id="id_weight"
{% if form.fields.weight.required %} required{% endif %} {% if form.fields.weight.required %} required{% endif %}
name="weight" name="weight"
{# value=""#} {# value=""#}
{% if form.cleaned_data.weight %}value="{{ form.cleaned_data.weight}}"{% endif %} {% if form.cleaned_data.weight %}value="{{ form.cleaned_data.weight}}"{% endif %}
/> />
{% if form.errors and form.errors.weight %} {% if form.errors and form.errors.weight %}
<span>{{ form.errors.weight }}</span> <span>{{ form.errors.weight }}</span>
{% endif %}
</div>
<hr>
<div class="phone">
<div>
<label for="id_phone">{{ form.fields.phone.label }}</label>
<input
type="text"
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.errors and form.errors.phone %}
<span>{{ form.errors.phone }}</span>
{% endif %} {% endif %}
</div> </div>
<hr> <div>
<div class="phone"> <label for="id_extra_phone">{{ form.fields.extra_phone.label }}</label>
<div> <input
<label for="id_phone">{{ form.fields.phone.label }}</label> type="text"
<input name="extra_phone"
type="text" id="id_extra_phone"
name="phone" placeholder="{{ form.fields.extra_phone.label }}"
placeholder="{{ form.fields.phone.label }}" {% if form.cleaned_data.extra_phone %}value="{{ form.cleaned_data.extra_phone}}"{% endif %}
{% if form.fields.phone.required %} required{% endif %} />
id="id_phone" {% if form.errors and form.errors.extra_phone %}
{% if form.cleaned_data.phone %}value="{{ form.cleaned_data.phone}}"{% endif %} <span>{{ form.errors.extra_phone }}</span>
{% endif %}
</div>
</div>
/> <hr>
{% if form.errors and form.errors.phone %}
<span>{{ form.errors.phone }}</span>
{% endif %}
</div>
<div> <div>
<label for="id_receive_msg_by_email">{{ form.fields.receive_msg_by_email.label }}</label>
<label for="id_extra_phone">{{ form.fields.extra_phone.label }}</label> <input type="checkbox" name="receive_msg_by_email" id="id_receive_msg_by_email">
<input {% if form.errors and form.errors.receive_msg_by_email %}
type="text" <span>{{ form.errors.receive_msg_by_email }}</span>
name="extra_phone" {% endif %}
id="id_extra_phone" </div>
placeholder="{{ form.fields.extra_phone.label }}" <div class="button_register">
{% if form.cleaned_data.extra_phone %}value="{{ form.cleaned_data.extra_phone}}"{% endif %} <button id="registration" onclick="sendRoute(this)"> Разместить объявления </button>
/> </div>
{% if form.errors and form.errors.extra_phone %}
<span>{{ form.errors.extra_phone }}</span>
{% endif %}
</div>
</div>
<hr>
<div>
<label for="id_receive_msg_by_email">{{ form.fields.receive_msg_by_email.label }}</label>
<input type="checkbox" name="receive_msg_by_email" id="id_receive_msg_by_email">
{% if form.errors and form.errors.receive_msg_by_email %}
<span>{{ form.errors.receive_msg_by_email }}</span>
{% endif %}
</div>
<div class="button_register">
<button id="registration" onclick="sendRoute(this)"> Разместить объявления </button>
</div>
{% endif %} {% endif %}