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

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

    <table>
        <thead>
            <tr>
                <th>Id</th>
                <th>Name</th>
                <th>Description</th>
                <th>Actions</th>
            </tr>
        </thead>
        <tbody>
        {% for charity in charities %}
            <tr>
                <td><a href="{{ path('charity_show', { 'id': charity.id }) }}">{{ charity.id }}</a></td>
                <td>{{ charity.name }}</td>
                <td>{{ charity.description }}</td>
                <td>
                    <ul>
                        <li>
                            <a href="{{ path('charity_show', { 'id': charity.id }) }}">show</a>
                        </li>
                        <li>
                            <a href="{{ path('charity_edit', { 'id': charity.id }) }}">edit</a>
                        </li>
                    </ul>
                </td>
            </tr>
        {% endfor %}
        </tbody>
    </table>

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