{% load static %}
{% load i18n %}
<div class="carrier-card" data-number-of-route="{{ route.id }}">
    <div class="left-part-carrier-card">

        {% if route.owner_type == 'mover'  %}
            <div class="first-line-card-carrier">
                <div class="carrier-title">
                   {% translate "Перевозчик:" %}
                </div>

                <div class="type_transportation_carrier">
                    {% if route.type_transport == 'road' %}
                        <img class="inf_carrier_icon" src="{% static "/img/svg/Car.svg" %}"/>
                        {% elif route.type_transport == 'avia'%}
                        <img class="inf_carrier_icon" src="{% static "/img/svg/Airplane.svg" %}"/>
                    {% endif %}
                    {{ route.get_type_transport_display }}
                </div>
                <div class="clear_both"></div>
            </div>
        {% endif %}
        {% if route.owner_type == 'customer'  %}
            <div class="route_info_about">
                    <span class="cargo_type_disp">
                        {% translate "Тип: " %}{{ route.get_cargo_type_display }}
                    </span>

                    <span class="cargo_weight">
                       {% translate "Вес: " %}{{ route.weight }} {% translate "кг" %}
                    </span>

                    <span class="cargo_type_trans">

                        {% if route.type_transport == 'road' %}
                            <img class="inf_carrier_icon" src="{% static "/img/svg/Car.svg" %}"/>
                            {% elif route.type_transport == 'avia'%}
                            <img class="inf_carrier_icon" src="{% static "/img/svg/Airplane.svg" %}"/>
                        {% endif %}

                        {{ route.get_type_transport_display }}
                    </span>
            <div class="clear_both"></div>

            </div>
        {% endif %}
        <div class="from-to-country-container-carrier">
            <div class="from-to-country-text left fl-left txt-al-right" title="{{ route.from_country_n_city_str }}">
                {{ route.from_country_n_city_str }}
            </div>
            <div class="splitter-from-to-country"></div>
            <div class="from-to-country-text right fl-right txt-al-left" title="{{ route.to_country_n_city_str }}">
                {{ route.to_country_n_city_str }}
            </div>
        </div>
        {% include "small_INCLUDES/carrier_card/inf_about_moving.html" %}

    </div>
{#    <div class="splliter-left-right-part-carrier-card"></div>#}
    <div class="inf_carrier_container">
        <div class="title_container_inf_carrier">
            {% translate 'Контакты' %}
            {% if route.owner_type == 'mover' %}
                {% translate "перевозчика" %}
                <img class="inf_carrier_icon" src="{% static "/img/svg/mover.svg" %}"/>
            {% elif route.owner_type == 'customer'%}
                {% translate "отправителя" %}
                <img class="inf_carrier_icon" src="{% static "/img/svg/cargo.svg" %}"/>
            {% endif %}
        </div>
        <div>
            <img src="{% static "/delete_later/Avatar.png" %}">
            <span class="name_carrier">{{ route.owner.last_name }} {{ route.owner.first_name }}</span>
        </div>
        <div name="form_carrier">
            <div class="inf_carrier">
                <a class="phones_carrier" data-href="tel:{{ route.phone }}">
                    <img class="inf_carrier_icon" src="{% static "/img/svg/phone.svg" %}"/>
                    <span class="phones_carrier_span{% if route.owner == user %} active{% endif %} el_for_open_el">{{ route.phone }}</span>
    {#                <input value="{{ route.phone }}">#}
                    <div class="clear_both"></div>
                </a>
                <a class="email_carrier" data-href="mailto:{{ route.owner.email }}">
                    <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">{{ route.owner.email }}</span>
    {#                <input value="{{ route.owner.email }}">#}
                    <div class="clear_both"></div>
{#                    <div>{{ route.get_cargo_type_display }}</div>#}
{#                    <div>{{ route.weight }}</div>#}
{#                    <div>{{ route.get_owner_type_display }}</div>#}
{#                    <div>{{ route.id }},{{ forloop.counter }}</div>#}
                </a>
            </div>
            {% if route.owner != user %}
                <button class="open_chat_carrier" onclick="open_chat({{ route.owner_id }})">
                    <img src="{% static "img/svg/Logo.svg" %}" width="30px">
                    <span> {% translate "Написать сообщение" %}</span>
    {#                <img src="{% static "/img/svg/email.svg" %}" width="25px" style="position:relative;left: 3px;">#}
                </button>
                <button class="open_inf_carrier" onclick="show_inf_carrier(this)">{% translate "Открыть контакт"%}</button>
            {% endif %}
        </div>


    </div>
    <div class="clear_both"></div>

</div>