0.0.21 buf gix registration

This commit is contained in:
2023-07-19 17:16:46 +03:00
parent 7c320d2709
commit 0866e605e6
6 changed files with 63 additions and 8 deletions

View File

@@ -917,6 +917,11 @@ form.new_route>div{
flex-direction: row;
flex-wrap: wrap;
}
form.new_route>div.range-slider{
margin-bottom: 30px;
margin-top: 30px;
display: block;
}
form.new_route{
width:100%;

View File

@@ -15,6 +15,20 @@ function createRoute(){
// location.href = '/profile'
document.querySelector(".info_profile").innerHTML = data.html
$(document).ready(function (e){
$('#id_weight').ionRangeSlider({
skin: "round",
type: "single",
min: 0,
max: 1000,
from: 500,
step: 1,
grid: true,
grid_num: 5,
});
});
//get dynamic value
// let fromCountry = document.getElementById('id_from_country');
// let toCounytry = document.getElementById('id_to_country')

View File

@@ -19,7 +19,7 @@ function sendRoute(el){
document.querySelector(".info_profile").innerHTML = data.html
},
error: function (data, exception){
document.querySelector(".button_register").innerHTML = data.responseJSON.html
document.querySelector(".info_profile").innerHTML = data.responseJSON.html
}
});
}

View File

@@ -14,6 +14,9 @@
<option value="{{ item.0 }}"{% if form.fields.type_transport.initial == item.0 %} selected="selected"{% endif %}>{{ item.1 }}</option>
{% endfor %}
</select>
{% if form.errors and form.errors.type_transport %}
<span>{{ form.errors.type_transport }}</span>
{% endif %}
</div>
<hr>
@@ -21,10 +24,16 @@
<div>
<label for="id_departure_DT">{{ form.fields.departure_DT.label }}</label>
<input type="datetime-local" name="departure_DT"{% if form.fields.departure_DT.required %} required{% endif %} id="id_departure_DT">
{% 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.errors and form.errors.arrival_DT %}
<span>{{ form.errors.arrival_DT }}</span>
{% endif %}
</div>
</div>
<hr>
@@ -32,11 +41,16 @@
<div>
<label for="id_from_country">{{ form.fields.from_country.label }}</label>
<input type="text" name="from_country"{% if form.fields.from_country.required %} required{% endif %} id="id_from_country">
{% if form.errors and form.errors.from_country %}
<span>{{ form.errors.from_country }}</span>
{% endif %}
</div>
<div>
<label for="id_to_country">{{ form.fields.to_country.label }}</label>
<input type="text" name="to_country"{% if form.fields.to_country.required %} required{% endif %} id="id_to_country">
{% if form.errors and form.errors.to_country %}
<span>{{ form.errors.to_country }}</span>
{% endif %}
</div>
</div>
{# <div>#}
@@ -55,6 +69,9 @@
<option value="{{ item.0 }}"{% if form.fields.type_transport.initial == 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>
@@ -63,6 +80,9 @@
<option value="{{ item.0 }}"{% if form.fields.to_place.initial == 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>
@@ -77,6 +97,9 @@
<option value="{{ item.0 }}"{% if form.fields.cargo_type.initial == item.0 %} selected="selected"{% endif %}>{{ item.1 }}</option>
{% endfor %}
</select>
{% if form.errors and form.errors.cargo_type %}
<span>{{ form.errors.cargo_type }}</span>
{% endif %}
</div>
<hr>
@@ -84,8 +107,9 @@
<div class="range-slider">
<label for="id_weight">{{ form.fields.weight.label }}</label>
<input type="text" id="id_weight"{% if form.fields.weight.required %} required{% endif %} name="weight" value="" />
{% if form.errors and form.errors.weight %}
<span>{{ form.errors.weight }}</span>
{% endif %}
</div>
<hr>
@@ -93,10 +117,16 @@
<div>
<label for="id_phone">{{ form.fields.phone.label }}</label>
<input type="text" name="phone"{% if form.fields.phone.required %} required{% endif %} id="id_phone">
{% if form.errors and form.errors.phone %}
<span>{{ form.errors.phone }}</span>
{% endif %}
</div>
<div>
<label for="id_extra_phone">{{ form.fields.extra_phone.label }}</label>
<input type="text" name="extra_phone" id="id_extra_phone">
{% if form.errors and form.errors.extra_phone %}
<span>{{ form.errors.extra_phone }}</span>
{% endif %}
</div>
<hr>
@@ -104,13 +134,12 @@
<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>
<script>
$('#id_weight').ionRangeSlider();
</script>
</form>

View File

@@ -1,4 +1,5 @@
{% extends 'tb_base.html' %}
{% load static %}
{% block meta %}
<script src='{% static "js/registration.js" %}'></script>

View File

@@ -7,6 +7,12 @@
<script src='{% static "js/rangeSlider.js" %}'></script>
<script src='{% static "js/sendRoute.js" %}'></script>
<script src='{% static "js/jquery_v3_6_4.js" %}'> </script>
<script src='{% static "js/ion.rangeSlider.min.js" %}'> </script>
<script src='{% static "js/autocomplete.js" %}'> </script>
<link rel="stylesheet" href="{% static 'css/ion.rangeSlider.min.css' %}">
{% endblock %}
{% block content %}