1.1.50 add pagination for b_my_routes.html && upd conditional rendering for carrier card based on departure date

This commit is contained in:
2024-07-29 19:32:13 +03:00
parent d37b694d5a
commit b905fab6c5
3 changed files with 26 additions and 4 deletions

View File

@@ -1,3 +1,15 @@
<div>
{% load static %}
{% load i18n %}
<div class="page_paging_elements_1">
{% include 'blocks/routes/b_my_routes_list.html' %}
</div>
{% if last_block == False and next_page_els_count %}
<div class="text-align-center">
<button class="button-find-more-routes" id="{{ last_el }}" onclick="load_routes(this,null,{{ next_page_els_count }},'{{ owner_type }}')">{% trans "Показать ещё" %}<span class="col_vo_els_f_load"> {{ next_page_els_count }}</span></button>
<div class="width-100 text-align-center mb-10">
<img class="loader_f_loading_routes" src="{% static "img/svg/loader.svg" %}">
</div>
</div>
{% endif %}

View File

@@ -2,7 +2,17 @@
{% load i18n %}
<div class="carrier-card {% if route.highlight_color %} highlight-color {% endif %}" data-number-of-route="{{ route.id }}">
{% if route.departure_DT %}
{% with current_datetime=route.from_city.get_current_datetime %}
{% with departure_datetime=route.departure_DT %}
{% if current_datetime|date:"Y-m-d H:i:s" > departure_datetime|date:"Y-m-d H:i:s" %}
<div class="carrier-card out_of_date" data-number-of-route="{{ route.id }}">
{% else %}
<div class="carrier-card {% if route.highlight_color %} highlight-color {% endif %}" data-number-of-route="{{ route.id }}">
{% endif %}
{% endwith %}
{% endwith %}
{% endif %}
{#<div class="carrier-card"{% if route.highlight_color %} style="border: 5px solid {{ route.highlight_color }};"{% endif %} data-number-of-route="{{ route.id }}">#}
<div class="left-part-carrier-card">
{# <div class="first-line-card-carrier">#}

View File

@@ -148,7 +148,7 @@
<span class="phones_carrier_span{% if route.owner == user %} active{% endif %} el_for_open_el"></span>
<div class="clear_both"></div>
</a>
<a class="email_carrier" data-href="mailto:{{ route.owner.email }}">
<a class="email_carrier" data-href="mailto:">
<img class="inf_carrier_icon" src="{% static "/img/svg/email.svg" %}">
<span class="email_carrier_span{% if route.owner == user %} active{% endif %} el_for_open_el"></span>