0.0.172 routes
This commit is contained in:
@@ -266,18 +266,8 @@ function getFormDataElValue($field) {
|
||||
|
||||
function formDataToQueryString (formData, forms) {
|
||||
let str = ``
|
||||
formData.forEach((index, name) => {
|
||||
let el = null;
|
||||
for (let i = 0; i < forms.length; i++) {
|
||||
let _el = forms[i].querySelector(`[data-name="${name}"]`)
|
||||
if (_el){
|
||||
el = _el;
|
||||
i = forms.length;
|
||||
}
|
||||
}
|
||||
|
||||
if (!el) return;
|
||||
let value = getFormDataElValue(el);
|
||||
formData.forEach((value, name) => {
|
||||
str+=`${name}=${value}&`;
|
||||
})
|
||||
|
||||
|
||||
@@ -16,14 +16,14 @@
|
||||
<form name="filter_routes">
|
||||
<div class="label" style="margin-bottom: 16px;">{% trans "Способ перевозки" %}</div>
|
||||
<div class="field_container line" data-type="checkbox" data-name="type_transport">
|
||||
<div class="checkbox{% if route_form.initial.type_transport %} checked{% endif %}" data-value="road" onclick="chooseCheckbox(this, searchRoutes)"></div>
|
||||
<div class="checkbox{% if 'road' in form.initial.type_transport %} checked{% endif %}" data-value="road" onclick="chooseCheckbox(this, searchRoutes)"></div>
|
||||
<div class="checkbox_label" onclick="chooseCheckbox(this, searchRoutes)">{% trans "Автоперевозка" %}</div>
|
||||
{% if route_form.errors.type_transport %}<div class="error_container">{{ route_form.errors.type_transport.0 }}</div>{% endif %}
|
||||
{% if form.errors.type_transport %}<div class="error_container">{{ form.errors.type_transport.0 }}</div>{% endif %}
|
||||
</div>
|
||||
<div class="field_container line" data-type="checkbox" data-name="type_transport">
|
||||
<div class="checkbox{% if route_form.initial.type_transport %} checked{% endif %}" data-value="avia" onclick="chooseCheckbox(this, searchRoutes)"></div>
|
||||
<div class="checkbox{% if 'avia' in form.initial.type_transport %} checked{% endif %}" data-value="avia" onclick="chooseCheckbox(this, searchRoutes)"></div>
|
||||
<div class="checkbox_label" onclick="chooseCheckbox(this, searchRoutes)">{% trans "Авиатранспорт" %}</div>
|
||||
{% if route_form.errors.type_transport %}<div class="error_container">{{ route_form.errors.type_transport.0 }}</div>{% endif %}
|
||||
{% if form.errors.type_transport %}<div class="error_container">{{ form.errors.type_transport.0 }}</div>{% endif %}
|
||||
</div>
|
||||
<div class="field_container" data-type="select" data-name="cargo_type">
|
||||
<label for="id_cargo_type">{% trans "Тип посылки" %}</label>
|
||||
|
||||
Reference in New Issue
Block a user