{% extends "main.html" %}
{% load i18n %}

{% block user_entries_selected %}{% if user %}selected{% endif %}{% endblock %}
{% block all_entries_selected %}{% if not user %}selected{% endif %}{% endblock %}


{% block title %}{% trans "Entry list" %}{% endblock %}

{% block content %}
{% if user %}
  <h2>{% trans "Entries of" %} {% firstof user.first_name user.username %}</h2>
{% else %}
  <h2>{% trans "All entries" %}</h2>
{% endif %}

<table class="table">
  <thead>
    <tr>
      <th>ID</th>
      <th>User</th>
      <th>Code size</th>
      <th>Uploaded time</th>
    </tr>
  </thead>
  {% for entry in entries %}
  <tr>
    <td>{{ entry.id }}</a>
      <td>
         <a href="{% url "tictactoe.contest.views.entries" uid=entry.user.id %}">
           {{ entry.user.get_full_name }} ({{ entry.user.username }})
         </a>
       </td>
    <td>{{ entry.codesize|filesizeformat }}</td>
    <td><a href="{{ entry.get_absolute_url }}">{{ entry.uploaded|date:"Y-m-d H:i:s" }}</a></td>
  </tr>
  {% endfor %}
</table>
{% endblock %}
