{% import "macro/table.html" as table %}
<table class="ui bottom attached table codes">
    <thead>
        <tr>
            <th>{% trans %}Code{% endtrans %}</th>
            <th>{% trans %}Client{% endtrans %}</th>
            <th>{% trans %}Subject{% endtrans %}</th>
            <th>{% trans %}Created{% endtrans %}</th>
        </tr>
    </thead>
    <tbody>
        {% for authorization in table_form.items_slice %}
            <tr>
                <td><a href="{{ url_for('oidc.authorizations.view', authorization=authorization) }}">{{ authorization.authorization_code_id }}</a></td>
                <td><a href="{{ url_for('oidc.clients.edit', client=authorization.client) }}">{{ authorization.client.client_id }}</a></td>
                <td>
                    <a href="{{ url_for("core.account.profile_edition", edited_user=authorization.subject) }}">
                        {{ authorization.subject.user_name }}
                    </a>
                </td>
                <td>{{ authorization.issue_date }}</td>
            </tr>
        {% else %}
            <tr>
                <td colspan="4">
                    <div class="ui icon message">
                        <i class="exclamation icon"></i>
                        <div class="content">
                            {% if request.headers.get("Hx-Request") %}
                                <div class="header">
                                    {% trans %}No item matches your request{% endtrans %}
                                </div>
                                <p>{% trans %}Maybe try with different criteria?{% endtrans %}</p>
                            {% else %}
                                <div class="header">
                                    {% trans %}There is nothing here{% endtrans %}
                                </div>
                            {% endif %}
                        </div>
                    </div>
                </td>
            </tr>
        {% endfor %}
    </tbody>
    <tfoot>
        <tr>
            <th colspan="4">
                {{ table.pagination(table_form) }}
            </th>
        </tr>
    </tfoot>
</table>
