{% extends "membership/membership_detail.html" %}
{% load i18n humanize %}

{% block title %} {% trans 'Ladder Score for' %} {{membership.username}} {% endblock %}

{% block teaser %} <h1>{% trans 'Mai-Star Games' %}: {{membership.username}} <br/> {% trans 'Season' %} {{season}}</h1> {% endblock %}

{% block score_list %}
<h2 class="grid_12">{% trans 'Mai-Star Games with' %} {{ membership.username }} - {{season}}</h2>

 <table>
 <thead>
 <tr>
  <th rowspan="2">{% trans 'Date' %}</th>
  <th rowspan="2">{% trans 'Event' %}</th>
  <th colspan="6">{% trans 'Players' %}</th>
  <th rowspan="2"></th>
 </tr>
 <tr>
  <th>{{ '1'|ordinal }}</th>
  <th>{{ '2'|ordinal }}</th>
  <th>{{ '3'|ordinal }}</th>
  <th>{{ '4'|ordinal }}</th>
  <th>{{ '5'|ordinal }}</th>
  <th>{{ '6'|ordinal }}</th>
 </tr>
 </thead>
<tbody>
{% for game in game_list %}
 <tr>
  <td class="center">{{ game.event.start|date:'SHORT_DATE_FORMAT' }}</td>
  <td><a href="{{ game.get_absolute_url }}">{{ game.event.name }}</a></td>
  {% for player in game.player_list %}
  <td class="center">
   <a href="{% url 'maistar-player-games' username=player.user.username season=season %}">{{ player.user.username }}</a>
   <br/>{{player.score}} {% trans 'Points' %}
  </td>
  {% endfor %}
  <td>
  {% if perms.maistar_ranking.delete_game %}
   <a href="{% url 'maistar-delete-game' game.pk %}"><span class="fa fa-trash" title="{% trans 'Delete Game' %}"></span></a>
  {% endif %}
  {% if perms.maistar_ranking.change_game %}
   <a href="{% url 'maistar-edit-game' game.pk %}"><span class="fa fa-pencil" title="{% trans 'Edit Game' %}"></span></a>
  {% endif %}
  </td>
 </tr>
{% endfor %}
</tbody>
</table>
{% endblock %}