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

{% block title %}Administration > Meneur(euse) de jeux > Éditer{% endblock %}

{% block content %}

    {{ form_errors(form) }}
    {{ form_start(form) }}

    {{ form_row(form.firstName) }}
    {{ form_row(form.lastName) }}
    {{ form_row(form.preferedName) }}
    {{ form_row(form.slug) }}
    {{ form_row(form.description)}}

    <div class="box">
        {{ form_row(form.email) }}
        {{ form_row(form.phone) }}
    </div>

    {# gestion de l'illustration #}
    <div class="box">
    <div class="field">
        <div class="columns">
            <div class="column">
                {{ form_label(form.picture) }}
                <div class="file has-name is-fullwidth" id="file-js"  {{ stimulus_controller('bulma-filenames') }}>
                <label class="file-label" >
                    {{ form_widget(form.picture) }}
                    <span class="file-cta">
                    <span class="file-icon">
                        <twig:ux:icon name="bi:cloud-upload" />
                    </span>
                    <span class="file-label"> Choisissez un fichier… </span>
                    </span>
                    <span class="file-name"> aucun fichier </span>
                </label>
                </div>
                {{ form_help(form.picture) }}
                {% if gamemaster.picture %}
                <div class="field mt-2">
                <p><a href="#" data-id="{{ path('app_admin_gamemaster_del_pic', {id: gamemaster.id}) }}" class="button is-danger" {{ stimulus_controller('admin_confirm') }}><twig:ux:icon name="bi:trash-fill" class="small-icon-in-text"/> Supprimer l'image chargée.</a></p>
                </div>
                {% endif %}
                

            </div>
            <div class="column">
                {% if gamemaster.picture %}
                <img src="/images/gamemasters/{{ gamemaster.picture }}" class="image is-1by1"/>
                {% endif %}
            </div>
        </div>
    </div>
    </div>

    <div class="box">
    <div class="field">
        {{ form_label(form.gamesCanMaster) }}
        {{ form_widget(form.gamesCanMaster) }}
        {{ form_help(form.gamesCanMaster) }}
    </div>
    </div>
    
        
    <div class="box">
    <div class="field">
        {{ form_label(form.authorOfGames) }}
        {{ form_widget(form.authorOfGames) }}
        {{ form_help(form.authorOfGames) }}
    </div>
    </div>

    <div class="box">
        {{ form_row(form.linkToUser) }}
    </div>



    {{ form_widget(form) }}
    




    <div class="control">
        <button class="button is-primary" type="submit">Envoyer</button>
        <a href="{{ path('app_admin_gm') }}" class="button">Annuler</a>
    </div>

    {{ form_end(form) }}

{% endblock %}
