{% extends is_mobile ? "::base_m.html.twig" : "::base.html.twig" %}

{% block title %}Пользователи{% endblock %}

{% block body %}

{% if not is_mobile %}
<table class="user-table" cellspacing="0" cellpadding="5" width="100%">
    <tr>
        <th align="left" valign="top" width="40%" nowrap="nowrap">
            Имя
        </th>
        <th align="left" valign="top" width="30%" nowrap="nowrap">
            Зарегистрирован
        </th>
        <th align="left" valign="top" width="30%" nowrap="nowrap">
            Последний визит
        </th>
    </tr>
    {% for item in data %}
    <tr>
        <td align="left" valign="top">
            {{ item.display|raw }}
        </td>
        <td align="left" valign="top">
            {{ item.time_registration }}
        </td>
        <td align="left" valign="top">
            {{ item.time_visit }}
        </td>
    </tr>
    {% else %}            
    <tr>
        <td align="left" valign="top" colspan="8">
            Нет пользователей
        </td>
    </tr>
    {% endfor %}        
</table>

{% else %}

    {% for item in data %}
    <div class="user-list-item">
        <div class="user-list-item-name">
            {{ item.display|raw }}
        </div>
        <div class="user-list-item-time-registration">
            Зарегистрирован - {{ item.time_registration }}
        </div>
        {% if item.time_visit %} 
        <div class="user-list-item-time-visit">
            Последний визит - {{ item.time_visit }}
        </div>
        {% endif %}
    </div>
    {% else %}            
    <p>Нет пользователей</p>
    {% endfor %}        

{% endif %}

{{ pager|raw }} 

{% endblock %}