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

{% block title %}{{ gamemaster.preferedName }}{% endblock %}

{% block content %}
<article class="media">
  <figure class="media-left">
    <p class="image is-128x128">
        {% if gamemaster.picture %}
        <img class="is-rounded" src="/images/gamemasters/{{ gamemaster.picture }}" />
        {% else %}
        <twig:ux:icon name="bi:person-fill"/>
        {% endif %}
    </p>
  </figure>
  <div class="media-content">
    <div class="content">
      <p>
       {{ gamemaster.description }}
      </p>
      {% if gamemaster.isAuthor %}
      <p>
        <em>Je suis auteur(rice) des jeux suivants : </em><br/>
       {{ gamemaster.authorOfGames|map(game => game.name)|join(', ') }}

      </p>
      {% endif %}
      {%  if is_granted('ROLE_MANAGER') %}
      <hr/>
      <p>
        <em>Je peux animer des parties des jeux suivants : </em><br/>
       {# TODO: limiter aux jeux dispo dans l'événement #}
       {{ gamemaster.gamesCanMaster
            |map(game => game.name)
            |join(', ')
        }}
      </p>
		  {%  endif  %}
    </div>
  </div>
</article>
{% if is_granted('ROLE_MANAGER') or is_granted('ROLE_ADMIN') %}

    <div class="columns">
      {% if gamemaster.phone %}
      <div class="column has-text-centered">
        <a class="button is-primary" href="tel:{{ gamemaster.phone }}"><span class="icon-text"><span class="icon mr-3"><twig:ux:icon name="bi:telephone-fill"/></span>Appel</a>
      </div>
      <div class="column has-text-centered">
        <a class="button is-primary" href="sms:{{ gamemaster.phone }}"><span class="icon-text"><span class="icon mr-3"><twig:ux:icon name="bi:envelope"/></span>SMS</a>
      </div>
      {% endif %}
      <div class="column has-text-centered">
        <a class="button is-primary" href="mailto:{{ gamemaster.email }}"><span class="icon-text"><span class="icon mr-3"><twig:ux:icon name="bi:envelope-fill"/></span>Mail</a>
      </div>
    </div>

{% endif %}


{% endblock %}

