index.html.twig 1.83 KB
{% extends 'base.html.twig' %}

{% block body %}
{% for type, flashMessage in app.session.flashbag.all() %}
         <div class="alert alert-{{ type }} fade in">
         <button class="close" data-dismiss="alert" type="button">×</button>
        {% if flashMessage.title is defined %}
            <strong>{{ flashMessage.title }}</strong>
          {{ flashMessage.message }}
        {% else %}
            {{ type }}
        {% endif %}
         </div>
    {% endfor %}
    <h1>Formulario de Candidatos</h1>

<ul>
    <a class="btn btn-info" role="button" href="{{ path('candidato_new') }}"><span class="glyphicon glyphicon-plus"></span></a>
</ul>

    <table class="table table-bordered">
        <thead>
            <tr>
                <th>Cedula</th>
                <th>Nombre</th>
                <th>Apellido</th>
                <th>Pais</th>
                <th>Estado</th>
                <th>Acciones</th>
            </tr>
        </thead>
        <tbody>
        {% for candidato in candidatos %}
            <tr>
                <td><a href="{{ path('candidato_show', { 'id': candidato.id }) }}">{{ candidato.cedula }}</a></td>
                <td>{{ candidato.nombre }}</td>
                <td>{{ candidato.apellido }}</td>
                <td>{{ candidato.pais }}</td>
                <td>{{ candidato.estado }}</td>
                <td>
                    <ul>
                        <a class="btn btn-info" role="button" href="{{ path('candidato_show', { 'id': candidato.id }) }}"><span class="glyphicon glyphicon-eye-open"></span></a>
                        <a class="btn btn-danger" role="button" href="{{ path('candidato_edit', { 'id': candidato.id }) }}"><span class="glyphicon glyphicon-pencil"></span></a>
                    </ul>
                </td>
            </tr>
        {% endfor %}
        </tbody>
    </table>
{% endblock %}