0.0.176 routes
This commit is contained in:
31
static/v2/js/blocks/b_my_routes.js
Normal file
31
static/v2/js/blocks/b_my_routes.js
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
function loadMoreMyRoutesRoutes (el){
|
||||||
|
if (!el) return;
|
||||||
|
let formData = new FormData();
|
||||||
|
let from_el = parseInt(el.dataset.from_el);
|
||||||
|
let to_el = from_el + parseInt(el.dataset.more_count);
|
||||||
|
formData.append('from_el', from_el);
|
||||||
|
formData.append('to_el', to_el);
|
||||||
|
|
||||||
|
let request = new api({
|
||||||
|
url: '/routes/get_routes/',
|
||||||
|
data: formData,
|
||||||
|
data_type: 'formData',
|
||||||
|
success: (res) => {
|
||||||
|
if (!res.html) return;
|
||||||
|
let $parent = $('.info_profile')[0];
|
||||||
|
let $next_page_btn = $parent.querySelector('.container_btns[data-next_page_btn]')
|
||||||
|
$next_page_btn.remove();
|
||||||
|
|
||||||
|
appendNodes($parent, templateStrToNode(`
|
||||||
|
<div class="next_page" style="
|
||||||
|
margin: 50px 0;
|
||||||
|
width: 100%;
|
||||||
|
background: #212121;
|
||||||
|
height: 1px;"></div>
|
||||||
|
`));
|
||||||
|
appendNodes($parent, templateStrToNode(res.html));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
request.ajaxRequest()
|
||||||
|
}
|
||||||
@@ -37,6 +37,7 @@
|
|||||||
<script src='{% static "v2/js/widgets/w_textarea_w_counter.js" %}'></script>
|
<script src='{% static "v2/js/widgets/w_textarea_w_counter.js" %}'></script>
|
||||||
<script src='{% static "v2/js/forms/f_make_poster_order.js" %}'></script>
|
<script src='{% static "v2/js/forms/f_make_poster_order.js" %}'></script>
|
||||||
<script src='{% static "v2/js/forms/f_make_mover_order.js" %}'></script>
|
<script src='{% static "v2/js/forms/f_make_mover_order.js" %}'></script>
|
||||||
|
<script src='{% static "v2/js/blocks/b_my_routes.js" %}'></script>
|
||||||
{% include "connect_ws_js.html" %}
|
{% include "connect_ws_js.html" %}
|
||||||
<link rel="stylesheet" href="{% static "v2/css/widgets/w_route_card.css" %}">
|
<link rel="stylesheet" href="{% static "v2/css/widgets/w_route_card.css" %}">
|
||||||
|
|
||||||
|
|||||||
@@ -6,3 +6,14 @@
|
|||||||
{% include 'v2/widgets/w_route_card.html' with route=route %}
|
{% include 'v2/widgets/w_route_card.html' with route=route %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
|
{% if not last_block %}
|
||||||
|
<div class="container_btns" data-next_page_btn="true" style="--justify: center;margin-top: 20px">
|
||||||
|
<div class="primary_btn"
|
||||||
|
onclick="loadMoreMyRoutesRoutes(this)"
|
||||||
|
style="--padding: 19px 34px 21px 34px"
|
||||||
|
data-from_el="{{ last_el }}"
|
||||||
|
data-more_count="{{ next_page_els_count }}">
|
||||||
|
{% trans "Показать ещё" %} {{ next_page_els_count }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
<div class="card_owner_type {{ route.owner_type }}">{% if route.owner_type == 'customer' %}{% trans "Нужен перевозчик" %}{% else %}{% trans "Могу перевезти" %}{% endif %}</div>
|
<div class="card_owner_type {{ route.owner_type }}">{% if route.owner_type == 'customer' %}{% trans "Нужен перевозчик" %}{% else %}{% trans "Могу перевезти" %}{% endif %}</div>
|
||||||
<div class="card_cargo_type">{% trans "Тип посылки:" %} <div class="orange">{{ route.cargo_type|get_cargo_type_for_show }}</div></div>
|
<div class="card_cargo_type">{% trans "Тип посылки:" %} <div class="orange">{{ route.cargo_type|get_cargo_type_for_show }}</div></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="route_btn inactive" style="--route-btn-width: max-content;--route-btn-height: min-content;--route-btn-padding: 7.5px 11px;max-width: 142px;">
|
<div class="route_btn inactive" style="--route-btn-width: max-content;--route-btn-height: min-content;--route-btn-padding: 7.5px 11px;max-width: 155px;">
|
||||||
<img src="{% static "v2/icons/widgets/w_route_card/phone_half_opacity.svg" %}" alt="">
|
<img src="{% static "v2/icons/widgets/w_route_card/phone_half_opacity.svg" %}" alt="">
|
||||||
<div class="route_btn_title big">{{ route.phone }}</div>
|
<div class="route_btn_title big">{{ route.phone }}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -16,12 +16,12 @@
|
|||||||
<div class="form_line _50_grid">
|
<div class="form_line _50_grid">
|
||||||
<div class="field_container" data-type="location" data-name="from_city" data-datepicker="departure_DT">
|
<div class="field_container" data-type="location" data-name="from_city" data-datepicker="departure_DT">
|
||||||
<label for="id_from_city"><div class="required_field_icon">*</div> {% trans "Пункт отправления" %}</label>
|
<label for="id_from_city"><div class="required_field_icon">*</div> {% trans "Пункт отправления" %}</label>
|
||||||
{% include 'v2/widgets/w_select_country.html' with name='from_city' placeholder=placeholder_for_city initial=form.initial.from_city %}
|
{% include 'v2/widgets/w_select_country.html' with name='from_city' placeholder=placeholder_for_city initial=form.instance.from_city %}
|
||||||
{% if form.errors.from_city %}<div class="error_container">{{ form.errors.from_city.0 }}</div>{% endif %}
|
{% if form.errors.from_city %}<div class="error_container">{{ form.errors.from_city.0 }}</div>{% endif %}
|
||||||
</div>
|
</div>
|
||||||
<div class="field_container" data-type="location" data-name="to_city" data-datepicker="arrival_DT">
|
<div class="field_container" data-type="location" data-name="to_city" data-datepicker="arrival_DT">
|
||||||
<label for="id_from_city"><div class="required_field_icon">*</div> {% trans "Пункт прибытия" %}</label>
|
<label for="id_from_city"><div class="required_field_icon">*</div> {% trans "Пункт прибытия" %}</label>
|
||||||
{% include 'v2/widgets/w_select_country.html' with name='to_city' placeholder=placeholder_for_city initial=form.initial.to_city %}
|
{% include 'v2/widgets/w_select_country.html' with name='to_city' placeholder=placeholder_for_city initial=form.instance.to_city %}
|
||||||
{% if form.errors.to_city %}<div class="error_container">{{ form.errors.to_city.0 }}</div>{% endif %}
|
{% if form.errors.to_city %}<div class="error_container">{{ form.errors.to_city.0 }}</div>{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user