{% extends "base/base.html" %}
{% import "widgets/user.html" as widget_member %}

{% block title %}
<h1>Profil de {{ member.name }}</h1>
{% endblock %}

{% block content %}
<section>
  {{ widget_member.profile(member) }}

  {% if current_user.is_authenticated %}
    {% if current_user == member %}
        <div><a href="{{ url_for('edit_account') }}">Modifier le compte</a></div>
    {% elif current_user.priv('access-admin-panel') %}
        <div><a href="{{ url_for('adm_edit_account', user_id=member.id) }}">Modifier le compte</a></div>
    {% endif %}
  {% endif %}

  <h2>Trophées</h2>
  <div>
  {% if member.trophies %}
    <ul>
    {% for t in member.trophies %}
      <li>{{ t.name }}</li>
    {% endfor %}
    </ul>
  {% else %}
    Aucun trophée.
  {% endif %}
</div>
</section>
{% endblock %}
