thomas-claireau/PHP-P6-Openclassrooms

View on GitHub
templates/admin/category/index.html.twig

Summary

Maintainability
Test Coverage
{% extends 'base.html.twig' %}

{% block title %}
    Category index
{% endblock %}

{% block h1 'Gérer les figures' %}
{% block subtitle 'Snow Tricks' %}


{% block body %}
    {% include "flash.html.twig" %}

    <h1 style="margin-bottom: 20px">
        Toutes les catégories
    </h1>

    <table class="table">
        <thead>
            <tr>
                <th>
                    Name
                </th>
                <th>
                    actions
                </th>
            </tr>
        </thead>
        <tbody>
            {% for category in categories %}
                <tr>
                    <td>
                        {{ category.name }}
                    </td>
                    <td>
                        <div class="actions" style="display: flex; justify-content: flex-start; align-item: center">
                            <a href="{{ path('admin.category.edit', {'id': category.id}) }}" class="btn btn-primary" style="margin-right: 15px">
                                Modifier
                            </a>
                            {{ include('admin/category/_delete_form.html.twig') }}
                        </div>
                    </td>
                </tr>
            {% else %}
                <tr>
                    <td colspan="3">
                        Aucune catégorie trouvée
                    </td>
                </tr>
            {% endfor %}
        </tbody>
    </table>

    <a href="{{ path('admin.category.new') }}" class="btn btn-primary">
        Créer une nouvelle catégorie
    </a>
{% endblock %}