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

{% block title %}DrinkType index{% endblock %}

{% block body %}
    <h1>DrinkType index</h1>

    <table class="table">
        <thead>
            <tr>
                <th>Id</th>
                <th>CreatedAt</th>
                <th>UpdatedAt</th>
                <th>Name</th>
                <th>Description</th>
                <th>DesiredStock</th>
                <th>DrinkStock</th>
                <th>actions</th>
            </tr>
        </thead>
        <tbody>
        {% for drink_stock in drink_stocks %}
            {% set drink_type = drink_stock.record.drinkType %}
            <tr>
                <td>{{ drink_type.id }}</td>
                <td>{{ drink_type.createdAt ? drink_type.createdAt|date('Y-m-d H:i:s') : '' }}</td>
                <td>{{ drink_type.updatedAt ? drink_type.updatedAt|date('Y-m-d H:i:s') : '' }}</td>
                <td>{{ drink_type.name }}</td>
                <td>{{ drink_type.description }}</td>
                <td>{{ drink_type.desiredStock }}</td>
                <td>{{ drink_stock.record.quantity }}</td>
                <td>
                    <a href="{{ path('app_drink_type_show', {'id': drink_type.id}) }}">show</a>
                    <a href="{{ path('app_drink_type_edit', {'id': drink_type.id}) }}">edit</a>
                </td>
            </tr>
        {% else %}
            <tr>
                <td colspan="7">no records found</td>
            </tr>
        {% endfor %}
        </tbody>
    </table>

    <a href="{{ path('app_drink_type_new') }}">Create new</a>
{% endblock %}
