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

{% block title %}Mon compte{% endblock %}

{% block content %}

    <nav class="breadcrumb has-arrow-separator" aria-label="breadcrumbs">
      <ul>
        <li><a href="{{ path('app_main') }}">Accueil</a></li>
        <li class="is-active"><a href="{{ path('app_profile') }}">Mon compte</a></li>
      </ul>
    </nav>

    <div class="tabs is-boxed">
        <ul>
            <li><a href="{{ path('app_profile') }}">Compte utilisateur(rice)</a></li>
            {% if app.user.linkToGamemaster %}
            <li class="is-active"><a>Meneur(euse) de jeu</a></li>
            <li><a>Disponibilités MJ</a></li>
            <li><a href="{{ path('app_profile_gamelist')}}">Ludothèque</a></li>
            <li><a href="{{ path('app_profile_gameadd') }}">Proposer un jeu</a></li>
            {% endif %}
        </ul>
    </div>


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

    <div class="columns">
        <div class="column">
            {{ form_row(form.preferedName) }}
        </div>
        <div class="column">
            {{ form_row(form.slug) }}
        </div>
    </div>

    {{ form_row(form.description)}}

    {# 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="{{ path('app_profile_gamemaster_del_pic', {id: gamemaster.id}) }}" class="button is-danger"><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>


    {{ form_widget(form) }}
    




    <div class="control">
        <button class="button is-primary" type="submit">Envoyer</button>
    </div>

    {{ form_end(form) }}

{% endblock %}
