{% extends 'admin/base_admin.html.twig' %}
{% set user = talent.users|first %}

{% block contentHeader %}
    <h1>
        Modification d'un talent
        <small>{{ user.firstname }} {{ user.lastname }}</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_config_talent') }}">Talent</a></li>
        <li class="active">Editer</li>
    </ol>
{% endblock %}

{% block content %}

    {{ form_start(form) }}
    <div class="row">
        <div class="col-xs-6">
            <div class="box box-primary">
                <div class="box-header">
                    <h3 class="box-title">
                        {{ user.firstname }} {{ user.lastname }}
                        {% if talent.emphasis %}
                            <span class="color-gold" data-toggle="popover" data-placement="top"
                                  data-content="A la une" data-trigger="hover">
                                        <i class="fa fa-star color-gold" aria-hidden="true"></i>
                                    </span>
                        {% endif %}
                        <br/><i class="fa fa-link"></i>Url :<br /> https://www.talentstube.com{{ path("talent_show",{'alias':user.company.alias})}}<br />
                    </h3>
                    <br>
                    <span><a href="mailto:{{ user.email }}">{{ user.email }}</a></span>
                </div>
                <div class="box-body">
                    {{ form_errors(form) }}
                    {{ form_row(form.emphasis) }}
                    {{ form_row(form.emphasisOrder) }}
                    {{ form_row(form.address) }}
                    {{ form_row(form.addressComp) }}
                    {{ form_row(form.zipcode) }}
                    {{ form_row(form.city) }}
                    {{ form_row(form.country) }}
                    {{ form_row(form.tagsComma) }}
                    {{ form_row(form.website) }}
                    {{ form_row(form.twitter) }}
                    {{ form_row(form.linkedin) }}
                </div>
            </div>
        </div>
        <div class="col-xs-6">
            {% if user.company.presentationVideo != null %}
                <div class="col-xs-12">
                    <div class="box box-primary">
                        <div class="box-header">
                            <h3 class="box-title">Vidéo de présentation
                                <small>{{ user.company.presentationVideo.title }}</small>
                            </h3>
                        </div>
                        <div class="box-body">
                            <iframe src="https://player.vimeo.com/video/{{ user.company.presentationVideo.getCdnVideoId() }}"
                                    width="100%" height="350" frameborder="0" webkitallowfullscreen mozallowfullscreen
                                    allowfullscreen></iframe>
                        </div>
                    </div>
                </div>
            {% endif %}

            <div class="col-xs-12">
                <div class="box box-primary">
                    <div class="box-header">
                        <h3 class="box-title">Autres vidéos</h3>
                    </div>
                    <div class="box-body table-responsive no-padding">

                        <div id="player-zone"></div>
                        <table id="table-media" class="table table-hover">
                            <tbody>
                            {% for media in user.medias %}
                                <tr>
                                    <td>
                                        <a href="#!" class="c-pointer" data-media="{{ media.id }}">
                                            {{ media.title }}
                                        </a>
                                    </td>
                                    <td>
                                        {% if media.status == "VALIDATED" %}
                                            <span class="label bg-green">{{ media.status }}</span>
                                        {% else %}
                                            <span class="label bg-red">{{ media.status }}</span>
                                        {% endif %}
                                    </td>
                                </tr>
                            {% endfor %}
                            </tbody>
                        </table>
                    </div>
                    <div id="loading1">
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-xs-12">
            <button class="btn btn-success" type="submit">Enregistrer</button>
        </div>
    </div>
    {{ form_end(form) }}

    {#<div id="player-modal"></div>#}

{% endblock %}

{% block javascripts %}
    <script>
        $(document).ready(function () {
            $('[data-toggle="popover"]').popover();
        });
    </script>
{% endblock %}
