{% extends 'admin/base_admin.html.twig' %}


{% block contentHeader %}
    <h1>
        Modération d'une annonce
        <small>{{ ad.referenceTt }}</small>
    </h1>
    <ol class="breadcrumb">
        <li><a href="{{ path('admin_dashboard') }}"><i class="fa fa-dashboard"></i> Dashboard</a></li>
        <li><a href="{{ path('admin_ad_moderation_list') }}">Annonces</a></li>
        <li class="active">Modération</li>
    </ol>
{% endblock %}

{% block content %}

    <div class="col-xs-8">
        <div class="box box-primary">
            <div class="box-header">
                <h3 class="box-title">{{ ad.title }}</h3>
            </div>
            <div class="box-body">

                {% if ad.video %}
                    <iframe src="https://player.vimeo.com/video/{{ ad.video.getCdnVideoId() }}"
                            width="100%" height="350" frameborder="0" webkitallowfullscreen mozallowfullscreen
                            allowfullscreen></iframe>
                    <h4>Description</h4>
                    <p>{{ ad.description|nl2br }}</p>

                    <h4> Mots clé</h4>
                    <p>
                        {% for tag in ad.publicTag %}
                            <span class="btn bg-green ">{{ tag }}</span>
                        {% endfor %}
                    </p>
                {% endif %}
            </div>
        </div>
    </div>

    <div class="col-xs-4">
        <div class="row">
            <div class="col-xs-12">
                <div class="box">
                    <div class="box-header">
                        <h3 class="box-title">Informations</h3>
                    </div>
                    <div class="box-body">
                        <table class="table">
                            <tbody>
                            <tr>
                                <td>Ref</td>
                                <td>{{ ad.referenceTt }}</td>
                            </tr>
                            <tr>
                                <td>Date publication</td>
                                <td>{{ ad.publishedAt|date('d/m/Y') }}</td>
                            </tr>
                            <tr>
                                <td>Date Fin</td>
                                <td>{{ ad.unpublishedAt|date('d/m/Y') }}</td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-xs-12">
                <div class="box box-success">
                    <div class="box-header">
                        <h3 class="box-title">Modération</h3>
                    </div>
                    <div class="box-body">
                        {{ form_start(form, {'action': path('admin_ad_invalid', {'id':ad.id}), 'method': 'POST'}) }}
                        {{ form_row(form.message) }}
                        <div class="text-center">
                            <a href="{{ path('admin_ad_validation', {'id':ad.id}) }}" class="btn btn-app"
                               style="margin-top: 20px;"><i class="fa fa-check" aria-hidden="true"></i>
                                Valider</a>
                            <button type="submit" class="btn btn-app" style="margin-top: 20px;">
                                <i class="fa fa-times" aria-hidden="true"></i>
                                Refuser
                            </button>
                            {{ form_end(form) }}
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
{% endblock %}

{% block javascripts %}

{% endblock %}