diff --git a/static/v2/js/blocks/b_my_routes.js b/static/v2/js/blocks/b_my_routes.js new file mode 100644 index 0000000..410146c --- /dev/null +++ b/static/v2/js/blocks/b_my_routes.js @@ -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(` +
+ `)); + appendNodes($parent, templateStrToNode(res.html)); + } + }); + + request.ajaxRequest() +} \ No newline at end of file diff --git a/templates/pages/profile/p_user_profile.html b/templates/pages/profile/p_user_profile.html index e1c65ff..a0218d6 100644 --- a/templates/pages/profile/p_user_profile.html +++ b/templates/pages/profile/p_user_profile.html @@ -37,6 +37,7 @@ + {% include "connect_ws_js.html" %} diff --git a/templates/v2/blocks/b_my_routes.html b/templates/v2/blocks/b_my_routes.html index 446dd7b..830c8bb 100644 --- a/templates/v2/blocks/b_my_routes.html +++ b/templates/v2/blocks/b_my_routes.html @@ -5,4 +5,15 @@ {% for route in routes %} {% include 'v2/widgets/w_route_card.html' with route=route %} {% endfor %} - \ No newline at end of file + +{% if not last_block %} +
+
+ {% trans "Показать ещё" %} {{ next_page_els_count }} +
+
+{% endif %} \ No newline at end of file diff --git a/templates/v2/content_widgets/w_route_card/route_card_info_data.html b/templates/v2/content_widgets/w_route_card/route_card_info_data.html index b7d5ca1..babe78b 100644 --- a/templates/v2/content_widgets/w_route_card/route_card_info_data.html +++ b/templates/v2/content_widgets/w_route_card/route_card_info_data.html @@ -12,7 +12,7 @@
{% if route.owner_type == 'customer' %}{% trans "Нужен перевозчик" %}{% else %}{% trans "Могу перевезти" %}{% endif %}
{% trans "Тип посылки:" %}
{{ route.cargo_type|get_cargo_type_for_show }}
-
+
{{ route.phone }}
diff --git a/templates/v2/forms/f_create_mover_route.html b/templates/v2/forms/f_create_mover_route.html index f16bb0a..d8bb8ff 100644 --- a/templates/v2/forms/f_create_mover_route.html +++ b/templates/v2/forms/f_create_mover_route.html @@ -16,12 +16,12 @@
- {% 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 %}
{{ form.errors.from_city.0 }}
{% endif %}
- {% 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 %}
{{ form.errors.to_city.0 }}
{% endif %}