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

{% block title %}Banner index{% endblock %}

{% block body %}
    <h1>Banner index</h1>

    <table class="table">
        <thead>
            <tr>
                <th>Id</th>
                <th>Href</th>
                <th>Src</th>
                <th>City</th>
                <th>Active</th>
                <th>actions</th>
            </tr>
        </thead>
        <tbody>
        {% for banner in banners %}
            <tr>
                <td>{{ banner.id }}</td>
                <td>{{ banner.href }}</td>
                <td><img src="/banners/{{ banner.src }}" alt="banner" width="100%"> </td>
                <td>{{ banner.city.name }}</td>
                <td>{{ banner.active? 'on' : 'off' }}</td>
                <td>
                    <a href="{{ path('banner_edit', {'id': banner.id}) }}">edit</a>
                </td>
            </tr>
        {% else %}
            <tr>
                <td colspan="5">no records found</td>
            </tr>
        {% endfor %}
        </tbody>
    </table>

    <a href="{{ path('banner_new') }}">Create new</a>
{% endblock %}
