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

{% block body %}
    <h1>Answers list</h1>

    <table>
        <thead>
            <tr>
                <th>Id</th>
                <th>Optionvalue</th>
                <th>Nextquestion</th>
                <th>Createdat</th>
                <th>Actions</th>
            </tr>
        </thead>
        <tbody>
        {% for answer in answers %}
            <tr>
                <td><a href="{{ path('answer_show', { 'id': answer.id }) }}">{{ answer.id }}</a></td>
                <td>{{ answer.optionValue }}</td>
                <td>{{ answer.nextQuestion }}</td>
                <td>{% if answer.createdAt %}{{ answer.createdAt|date('Y-m-d H:i:s') }}{% endif %}</td>
                <td>
                    <ul>
                        <li>
                            <a href="{{ path('answer_show', { 'id': answer.id }) }}">show</a>
                        </li>
                        <li>
                            <a href="{{ path('answer_edit', { 'id': answer.id }) }}">edit</a>
                        </li>
                    </ul>
                </td>
            </tr>
        {% endfor %}
        </tbody>
    </table>

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