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

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

    <table class="records_list">
        <thead>
            <tr>
                <th>Id</th>
                <th>Code</th>
                <th>Description</th>
                <th>Createdat</th>
                <th>Updatedat</th>
                <th>Actions</th>
            </tr>
        </thead>
        <tbody>
        {% for entity in entities %}
            <tr>
                <td><a href="{{ path('stocks_show', { 'id': entity.id }) }}">{{ entity.id }}</a></td>
                <td>{{ entity.code }}</td>
                <td>{{ entity.description }}</td>
                <td>{% if entity.createdat %}{{ entity.createdat|date('Y-m-d H:i:s') }}{% endif %}</td>
                <td>{% if entity.updatedat %}{{ entity.updatedat|date('Y-m-d H:i:s') }}{% endif %}</td>
                <td>
                <ul>
                    <li>
                        <a href="{{ path('stocks_show', { 'id': entity.id }) }}">show</a>
                    </li>
                    <li>
                        <a href="{{ path('stocks_edit', { 'id': entity.id }) }}">edit</a>
                    </li>
                </ul>
                </td>
            </tr>
        {% endfor %}
        </tbody>
    </table>

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