{% extends "::admin.html.twig" %}

{% block title %}Архив обратной связи{% endblock %}

{% block body %}

<form action="{{admin_action}}" method="Post">

{% if data %}

<table class="admin-table" cellspacing="0" cellpadding="5" width="100%">
    <tr>
        <th align="left" valign="top" width="0%" nowrap="nowrap">
            x
        </th>
        <th align="left" valign="top" width="0%" nowrap="nowrap">
            ID
        </th>
        <th align="left" valign="top" width="20%" nowrap="nowrap">
            Отправитель
        </th>
        <th align="left" valign="top" width="20%" nowrap="nowrap">
            E-mail
        </th>
        <th align="left" valign="top" width="40%" nowrap="nowrap">
            Текст сообщения
        </th>
        <th align="left" valign="top" width="20%" nowrap="nowrap">
            Время отправки
        </th>
    </tr>
    {% for item in data %}
    {% if item.read %}
    <tr class="admin-table-data-row">
    {% else %}
    <tr class="admin-table-data-row" style="background-color: yellow">
    {% endif %}
        <td align="left" valign="top">
            <input id="check{{ item.id }}" type="checkbox" name="check[]" value="{{ item.id }}" />
        </td>
        <td align="left" valign="top">
            {{ item.id }}
        </td>
        <td align="left" valign="top">
            {% if item.profile_link %}            
            <a href="{{ item.profile_link }}" target="_blank">{{ item.name }}</a>
            {% else %}
            {{ item.name }}
            {% endif %}
        </td>
        <td align="left" valign="top">
            {{ item.email }}
        </td>
        <td align="left" valign="top">
            {{ item.text|nl2br }}
        </td>
        <td align="left" valign="top">
            {{ item.time }}
        </td>
    </tr>
    {% else %}            
    <tr>
        <td align="left" valign="top" colspan="10">
            Нет сообщений
        </td>
    </tr>
    {% endfor %}        
</table>

{{ pager|raw }}

<div class="comments-admin-submit">
    <div id="comments-admin-submit-label">
        Действия над отмеченными:
    </div>
    <input id="comments-admin-submit-delete" type="submit" name="delete" value="Удалить" />
</div>
</form>     

{% endif %}
{% endblock %}