{% extends 'layouts/admin.twig' %}

{% block content %}

    <ul class="breadcrumbs el">
        <li><a href="/admin/">Home</a> /</li>
        <li class="end">{{ page_meta.title }}</li>
    </ul>

    <h1>{{ page_meta.title }}</h1>
    <p>
        This section displays last 50 ID check attempts
    </p>

    <table class="manage-items">
        <tr>
            <th>
                Date
            </th>
            <th>
                Order
            </th>
            <th>
                Member
            </th>
            <th>
                Response
            </th>
        </tr>
        <tbody class="tabular">
        {% for entry in log %}
            <tr>
                <td>
                    {{ entry.created_at }}
                </td>
                <td>
                    <a href="/shop/admin/orders/manage.order.php?id={{ entry.order_id }}">
                        {{ entry.order_id }}
                    </a>
                </td>
                <td>
                    <a href="/modules/Members/admin/manage_member.php?id={{ entry.member_id }}">
                        {{ entry.member.fullname }}
                    </a>
                </td>
                <td>
                    {% if entry.response_data %}
                        {% for error in entry.response_data.Summary.Errors %}
                            <strong>Service</strong> {{ error.Service }}<br/>
                            <strong>Details</strong> {{ error.Details }}<br/>
                        {% endfor %}
                    {% else %}
                        {{ entry.response }}
                    {% endif %}
                </td>
            </tr>
        {% endfor %}
        </tbody>
    </table>

{% endblock %}