0.0.146 routes
This commit is contained in:
@@ -345,16 +345,19 @@
|
||||
}
|
||||
}
|
||||
.place_title{
|
||||
--max-width: calc(var(--from-to-place-data-width) - 45.3px);
|
||||
--gradient_100: var(--max-width);
|
||||
--max-width: calc(var(--from-to-place-data-width) - 52.3px);
|
||||
font-size: var(--big-font-size);
|
||||
font-weight: 800;
|
||||
max-width: var(--max-width);
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
&.gradient{
|
||||
color: transparent;
|
||||
background-clip: text;
|
||||
-webkit-background-clip: text;
|
||||
background-image: linear-gradient(90deg, rgb(0 0 0) 0%, #FFFFFF calc(var(--max-width) - 30px));
|
||||
background-image: linear-gradient(90deg, rgb(0 0 0) 0%, #FFFFFF var(--gradient_100));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
function searchRoutes (form) {
|
||||
function searchRoutes (form=undefined) {
|
||||
event.preventDefault()
|
||||
let $filter_form = $('.b_filter_routes form')[0];
|
||||
let $search_form = $('.b_search_routes form')[0];
|
||||
|
||||
let formData = getFormData(form);
|
||||
let formData = getFormData($search_form);
|
||||
formData = getFormData($filter_form, formData);
|
||||
formData.append('owner_type', 'customer');
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
function chooseCheckbox(el) {
|
||||
function chooseCheckbox(el, callback) {
|
||||
if (!el) return;
|
||||
resetFieldError(el);
|
||||
|
||||
@@ -6,6 +6,7 @@ function chooseCheckbox(el) {
|
||||
let $checkbox = $parent.querySelector('.checkbox')
|
||||
|
||||
$checkbox.classList.toggle("checked");
|
||||
if (callback) callback($checkbox.classList.contains('checked'));
|
||||
}
|
||||
|
||||
function getFormData(form, formData=new FormData()) {
|
||||
|
||||
@@ -16,18 +16,18 @@
|
||||
<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)"></div>
|
||||
<div class="checkbox_label" onclick="chooseCheckbox(this)">{% trans "Автоперевозка" %}</div>
|
||||
<div class="checkbox{% if route_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 %}
|
||||
</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)"></div>
|
||||
<div class="checkbox_label" onclick="chooseCheckbox(this)">{% trans "Авиатранспорт" %}</div>
|
||||
<div class="checkbox{% if route_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 %}
|
||||
</div>
|
||||
<div class="field_container" data-type="select" data-name="cargo_type">
|
||||
<label for="id_cargo_type">{% trans "Тип посылки" %}</label>
|
||||
<select name="cargo_type" id="id_cargo_type">
|
||||
<select name="cargo_type" id="id_cargo_type" onchange="searchRoutes()">
|
||||
<option value="">{% trans "Любой" %}</option>
|
||||
{% for cargo_type in route_form.fields.cargo_type.choices %}
|
||||
<option value="{{ cargo_type.0 }}">{{ cargo_type.1 }}</option>
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<img src="{{ route.from_city.country.flag.url }}" alt="">
|
||||
<div class="country_code">{{ route.from_city.country.code }}</div>
|
||||
</div>
|
||||
<div class="place_title">
|
||||
<div class="place_title{% if route.from_city.name|length > 14 %} gradient{% endif %}">
|
||||
{{ route.from_city.name }}
|
||||
</div>
|
||||
</div>
|
||||
@@ -48,7 +48,7 @@
|
||||
<img src="{{ route.to_city.country.flag.url }}" alt="">
|
||||
<div class="country_code">{{ route.to_city.country.code }}</div>
|
||||
</div>
|
||||
<div class="place_title">
|
||||
<div class="place_title{% if route.to_city.name|length > 14 %} gradient{% endif %}">
|
||||
{{ route.to_city.name }}
|
||||
</div>
|
||||
</div>
|
||||
@@ -62,7 +62,7 @@
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if route.owner_type == 'mover' %}
|
||||
<div class="route_date_data" style="--route-date-data-justify: right;--route-date-data-margin: 10px 0 0 0;">
|
||||
<div class="route_date_data {% if route.to_city.name|length > 14 %} gradient{% endif %}" style="--route-date-data-justify: right;--route-date-data-margin: 10px 0 0 0;">
|
||||
{% trans "Прибытие:" %}
|
||||
<div class="date_data_value">{{ route.arrival_DT|date:'j E Y' }}</div>
|
||||
</div>
|
||||
@@ -86,8 +86,8 @@
|
||||
<img src="{{ route.from_city.country.flag.url }}" alt="">
|
||||
<div class="country_code">{{ route.from_city.country.code }}</div>
|
||||
</div>
|
||||
<div class="place_title">
|
||||
{{ route.from_city.name }}/{{ route.from_city.country.name }}
|
||||
<div class="place_title{% if route.to_city.name|length > 14 %} gradient{% endif %}">
|
||||
{{ route.from_city.name }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -127,8 +127,8 @@
|
||||
<img src="{{ route.to_city.country.flag.url }}" alt="">
|
||||
<div class="country_code">{{ route.to_city.country.code }}</div>
|
||||
</div>
|
||||
<div class="place_title">
|
||||
{{ route.to_city.name }}/{{ route.to_city.country.name }}
|
||||
<div class="place_title{% if route.to_city.name|length > 14 %} gradient{% endif %}">
|
||||
{{ route.to_city.name }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user