{% extends '::base.html.twig' %}

{% block body -%}
    <h1>Image list</h1>

    <table class="records_list">
        <thead>
            <tr>
                <th>Id</th>
                <th>Name</th>
                <th>Alt</th>
                <th>Path</th>
                <th>Uploaded_at</th>
                <th>Actions</th>
            </tr>
        </thead>
        <tbody>
        {% for entity in entities %}
            <tr>
                <td><a href="{{ path('images_show', { 'id': entity.id }) }}">{{ entity.id }}</a></td>
                <td>{{ entity.name }}</td>
                <td>{{ entity.alt }}</td>
                <td>{{ entity.path }}</td>
                <td>{% if entity.uploadedat %}{{ entity.uploadedat|date('Y-m-d H:i:s') }}{% endif %}</td>
                <td>
                <ul>
                    <li>
                        <a href="{{ path('images_show', { 'id': entity.id }) }}">show</a>
                    </li>
                    <li>
                        <a href="{{ path('images_edit', { 'id': entity.id }) }}">edit</a>
                    </li>
                </ul>
                </td>
            </tr>
        {% endfor %}
        </tbody>
    </table>

        <ul>
        <li>
            <a href="{{ path('images_new') }}">
                Create a new entry
            </a>
        </li>
    </ul>
    {% endblock %}
