{% extends template ~ '.html.twig' %}

{% block title %} {{ title }} {% endblock %}

{% block js %}
    <script id="smartCaptcha" src="https://smartcaptcha.yandexcloud.net/captcha.js"></script>
{% endblock %}

{% block filter %}
    <div class="filter__title">Найти специалиста</div>
    {{ include('specialist/_search_form.html.twig', {'searchForm': searchForm}) }}
{% endblock %}

{% block body %}
<div id="specialist" class="main">
    {% if(isMobile() == false) %}
        <div class="sort-block">
            <div class="call-back">
                Не нашли нужного врача?&nbsp;
                    <a href="#" data-controller="uslugi"  data-company="">Оставьте заявку для записи</a>
            </div>
            <div class="sort-line" data-controller="searchOrderByInput">
                <span id="sort-time" class="sort-line__item sort-line__item asc mx-2">
                    <i class="fa fa-sort-amount-asc d-none" aria-hidden="true"></i>
                    <i class="fa fa-sort-amount-desc d-none" aria-hidden="true"></i>
                    по времени приема
                </span>
                {# <span id="sort-price" class="mr-2 asc">
                    <i class="fa fa-sort-amount-asc d-none" aria-hidden="true"></i>
                    <i class="fa fa-sort-amount-desc d-none" aria-hidden="true"></i>
                    по стоимости приема
                </span> #}
                <span id="sort-abc" class="sort-line__item sort-line__item sort-line__item--active asc">
                    <i class="fa fa-sort-amount-asc" aria-hidden="true"></i>
                    <i class="fa fa-sort-amount-desc d-none" aria-hidden="true"></i>
                    по афавиту
                </span>
            </div>
        </div>
    {% else %}
        <div class="mobile-actions">
            <div class="sort-select-wrap">

                <select class="form-control" data-controller="mobileSearchOrderByInput">
                    <option value="sort-time" class="acs">по времени приема</option>
                    <option value="sort-abc" class="acs">по афавиту</option>
                </select>
            </div>
            <a href="#" data-controller="filterMenu" class="mobile-filter-btn">
                <svg width="16" height="17" viewBox="0 0 16 17" fill="none" xmlns="http://www.w3.org/2000/svg">
                    <path d="M1.3335 1.33325V0.683252C1.0972 0.683252 0.879525 0.811482 0.764979 1.01815C0.650432 1.22482 0.657063 1.47738 0.782297 1.67775L1.3335 1.33325ZM14.6668 1.33325L15.218 1.67775C15.3433 1.47738 15.3499 1.22482 15.2353 1.01815C15.1208 0.811482 14.9031 0.683252 14.6668 0.683252V1.33325ZM5.50016 7.99992H6.15016C6.15016 7.8781 6.11593 7.75872 6.05136 7.65542L5.50016 7.99992ZM10.5002 7.99992L9.94896 7.65542C9.8844 7.75872 9.85016 7.8781 9.85016 7.99992H10.5002ZM5.50016 12.9999H4.85016C4.85016 13.2461 4.98926 13.4712 5.20947 13.5813L5.50016 12.9999ZM10.5002 15.4999L10.2095 16.0813C10.411 16.182 10.6503 16.1713 10.8419 16.0528C11.0335 15.9344 11.1502 15.7252 11.1502 15.4999H10.5002ZM0.782297 1.67775L4.94896 8.34442L6.05136 7.65542L1.88469 0.988753L0.782297 1.67775ZM11.0514 8.34442L15.218 1.67775L14.1156 0.988753L9.94896 7.65542L11.0514 8.34442ZM4.85016 7.99992V12.9999H6.15016V7.99992H4.85016ZM5.20947 13.5813L10.2095 16.0813L10.7909 14.9185L5.79085 12.4185L5.20947 13.5813ZM11.1502 15.4999V7.99992H9.85016V15.4999H11.1502ZM1.3335 1.98325H14.6668V0.683252H1.3335V1.98325Z" fill="#005B33"/>
                </svg>
                фильтр
            </a>
        </div>
    {% endif %}

    <div class="specialist-items staff-block-wrap" data-controller="specialistView" data-st="{{ st|date('Y-m-d') }}" data-en="{{ en|date('Y-m-d') }}">

        {% for specialist in pagination %}
            {% include '/specialist/_item.html.twig' with {'link': true} %}
        {% else %}
            <p colspan="5">Не найдено, повторите поиск</p>
        {% endfor %}         
    </div>
    <div class="d-block text-center">
        {{ knp_pagination_render(pagination) }}
    </div>
</div>

{% include '/specialist/_calendar.html.twig' %}

{% endblock %}