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

{% block title %}Pokemon{% endblock %}

{% block body %}
    <h1>Pokemon</h1>

    <table class="table">
        <tbody>

            <tr>
                <th>Numero</th>
                <td>{{ pokemon.numero }}</td>
            </tr>
            <tr>
                <th>Nom</th>
                <td>{{ pokemon.nom }}</td>
            </tr>
            <tr>
                <th>Vie</th>
                <td>{{ pokemon.vie }}</td>
            </tr>
            <tr>
                <th>Attaque</th>
                <td>{{ pokemon.attaque }}</td>
            </tr>
            <tr>
                <th>Defense</th>
                <td>{{ pokemon.defense }}</td>
            </tr>
            <tr>
                <th>Legendaire</th>
                <td>{{ pokemon.legendaire ? 'Yes' : 'No' }}</td>
            </tr>
            <tr>
                <th>Type 1</th>
                <td>{{ pokemon.type1.name }}</td>
            </tr>

            {% if pokemon.type2 %}
                <tr>
                    <th>Type 2</th>
                    <td>{{ pokemon.type2.name }}</td>
                </tr>
            {% endif %}

            <tr>
                <th>Generation</th>
                <td>{{ pokemon.generation.name }}</td>
            </tr>


        </tbody>
    </table>

    <a href="{{ path('pokemon_index') }}"> <button class="btn btn-secondary">back to list</button></a>

    <a href="{{ path('pokemon_edit', {'id': pokemon.id}) }}"><button class="btn btn-primary">edit</button></a>

    {{ include('pokemon/_delete_form.html.twig') }}
{% endblock %}