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

{% set sectionTitle = 'Promos' %}

{% block moderationContent %}
    <section class="section-moderator-list">
        <div class="box">
            <table>
                <tr>
                    <th>Type</th>
                    <th>Title</th>
                    <th>Visible</th>
                    <th style="width: 200px"></th>
                </tr>
                {% for promo in promos %}
                    <tr {{ promo.isVisible ? "class=\"active\"" : ""}}>
                        <td>{{ promo.type }}</td>
                        <td>{{ promo.title }}</td>
                        <td>{{ promo.isVisible ? "Yes" : "No" }}</td>
                        <td>
                            <a href="{{ path('moderation.promos.switchVisibility', {promoId: promo.id}) }}" class="button button-icon"><span class="mdi mdi-eye"></span></a>
                            <a href="{{ path('moderation.promos.edit', {promoId: promo.id}) }}" class="button button-icon"><span class="mdi mdi-pencil"></span></a>
                            <a href="{{ path('moderation.promos.remove', {promoId: promo.id}) }}" class="button button-icon"><span class="mdi mdi-delete"></span></a>
                        </td>
                    </tr>
                {% endfor %}
            </table>
            <br /><br /><a href="{{ path('moderation.promos.add') }}" class="button">New Promo</a>
        </div>
    </section>
{% endblock %}

{% block styles %}
    <link rel="stylesheet" href="{{ asset('assets/css/moderation.css?v=' ~ date().timestamp) }}" />
{% endblock %}