{% extends "base.html" %}{% load i18n comments thumbnail %}

{% block title %}{{ membership.first_name }} {{membership.last_name}}{% endblock %}

{% block teaser %}<h1>{% trans 'profile for' %} {{membership.username|title}}</h1>{% endblock %}

{% block navigation %}
<ul id="navigation">
  <li><a href="{% url 'player-ladder-score' membership.username %}">{% trans "Ladder Hanchans" %}</a></li>
  <li><a href="{% url 'player-kyu-score' membership.username %}">{% trans "Kyu Hanchans" %}</a></li>
  <li><a href="{% url 'player-dan-score' membership.username %}">{% trans "Dan Hanchans" %}</a></li>
  <li><a href="{% url 'player-invalid-score' membership.username %}">{% trans "Invalid Hanchans" %}</a></li>
  <li><a href="{% url 'maistar-player-games' membership.username %}">{% trans "Mai-Star Games" %}</a></li>
</ul>{% endblock %}

{% block maincontent %}{% if membership.avatar %}
<img class="grid_3" src="{% thumbnail membership.avatar '220x220' crop='smart' %}" alt="{% trans 'Profile Image' %}"/>{% else %}
<div class="grid_3"> Noch kein Foto hoch geladen</div>{% endif %}

<div class="{% if membership == user or perms.membership.change_membership%}grid_4{% else %}grid_9{% endif %}" >
  {% if kyu_dan_ranking %}
  <h3>Mahjong</h3>
  <ul>
    {% if kyu_dan_ranking.dan %}
    <li>
      <strong>{{kyu_dan_ranking.dan}}. Dan: </strong> {{ kyu_dan_ranking.dan_points }} {% trans 'Points' %} ({% trans 'Maximum' %}: {{ kyu_dan_ranking.max_dan_points }})
    </li>
    {% elif kyu_dan_ranking.kyu%}
    <li><strong>{{kyu_dan_ranking.kyu}}. Kyu: </strong> {{ kyu_dan_ranking.kyu_points }} {% trans 'Points' %}</li>
    {% endif %}
    <li>
      <strong>{% trans 'Games Total' %}: </strong> {{ kyu_dan_ranking.hanchan_count }} Hanchans - {{kyu_dan_ranking.won_hanchans }} {% trans 'Won' %} / {{ kyu_dan_ranking.good_hanchans }} {% trans 'Good' %}
    </li>
    <li>
      <strong>{% trans 'Current Season' %}: </strong> {{ ladder_ranking.hanchan_count }} Hanchans - {{ ladder_ranking.won_hanchans }} {% trans 'Won' %} / {{ ladder_ranking.good_hanchans }} {% trans 'Good' %}
    </li>
  </ul>
  {% endif %}
</div>
  {% if membership == user or perms.membership.change_membership%}
  <div class="grid_5">
  <h3>{% trans 'private data' %}</h3>
  <p>{% blocktrans %}This data can only be seen by yourself and members of the board.{% endblocktrans %} </p>
  <ul>
    {% if membership.first_name %}<li><strong>{% trans "name" %}:</strong> {{membership.first_name}} {{membership.last_name}}</li>{% endif %}
    {% if membership.birthday %}<li><strong>{% trans "birthday" %}:</strong> {{membership.birthday}}</li>{% endif %}
    {% if membership.street_name %}<li><strong>{% trans "Address" %}:</strong> <address>{{ membership.street_name }}<br/> {{ membership.post_code }} {{ membership.city }}</address></li>{% endif %}
    {% if membership.email %}<li><strong>{% trans "Email" %}:</strong> <a href="mailto:{{ membership.email }}">{{membership.email}}</a></li>{% endif %}
    {% if membership.telephone %}<li><strong>{% trans "Telephone" %}:</strong> <a href="tel:{{ membership.telephone }}">{{membership.telephone}}</a></li>{% endif %}
    <li><strong>{% trans "Member Since" %}:</strong> {{membership.date_joined}}</li>
    <li><strong>{% trans "Last Login" %}:</strong> {{membership.last_login}}</li>
  </ul>
    {% if membership == user %}
    <a href="{% url 'membership-edit' membership.username %}" class="button"> <span class="fa fa-pencil"></span> {% trans "Edit Profile" %} </a>
    <a href="{% url 'password_change' %}" class="button"> <span class="fa fa-key"></span> {% trans 'Change Password' %}</a>
    {% endif %}
  </div>
  {% endif %}



{% block score_list %} {% endblock %}{% endblock %}

{% block comments %}{% if membership %}{% render_comment_list for membership %}{% render_comment_form for membership %}{% endif %}{% endblock %}

{% block buttonbar%}{%endblock%}
