{% macro profile(user) %}
{% if user.type == "member" %}
	<div class="profile">
		<img class="profile-avatar" src="{{ user.avatar_url }}" alt="Avatar de {{ user.name }}">
		<div>
			<div class="profile-name"><a href="{{ url_for('user', username=user.name) }}">{{ user.name }}</a></div>
			{% if user.title %}
			<div class="profile-title" style="{{ user.title.css }}">{{ user.title.name }}</div>
			{% else %}
			<div class="profile-title">Membre</div>
			{% endif %}
			<div class="profile-points">Niveau {{ user.level[0] }} <span>({{ user.xp }})</span></div>
			<div class="profile-points-small">Niv. {{ user.level[0] }}</div>
			{% if user.level[0] <= 100 %}
				<div class="profile-xp"><div style='width: {{ user.level[0] }}%;'></div></div>
			{% else %}
				<div class="profile-xp profile-xp-100"><div style='width: {{ user.level[0] - 100 }}%;'></div></div>
			{% endif %}
		</div>
	</div>
{% else %}
	<div class="profile guest">
		<em>{{ user.name }}</em>
		<span>Invité</span>
	</div>
{% endif %}
{% endmacro %}
