{% load i18n %}

<h2>{% trans 'Latest Hanchans' %}</h2>
<ul class="fa-ul">
    {% for hanchan in latest_hanchan_list %}
    <li><span class="fa-li fa fa-table"></span>
        <a href="{% url 'event-hanchan-list' hanchan.event_id %}">
            <time datetime="{{ hanchan.start|date:'c' }}">{{ hanchan.start|date:'D' }}
                {{ hanchan.start|date:'SHORT_DATE_FORMAT' }} {{hanchan.start|time:'H:i'}}
            </time></a>:<br />
        <small>{{hanchan.player_names}}</small>
    </li>
    {% endfor %}
</ul>
<h3>{% trans 'Latest Events' %}</h3>
<ul class="fa-ul">
    {% for event in latest_event_list %}
    <li>
        <span class="fa-li fa fa-calendar-o"></span>
        <a href="{% url 'event-hanchan-list' event.pk %}">
        <time datetime="{{event.start|date:'c'}}">{{ event.start|date:'D' }} {{ event.start|date:'SHORT_DATE_FORMAT' }}</time>:
        {{event.name}}</a></li>
    {% endfor %}
</ul>

{% if season_list %}
<h3>{% trans 'Ladder Archive' %}</h3>
<form name="season_select">
    <label for="season">{% trans 'Season' %}</label>
        <select id="season" name="season" size="1" onChange="window.location.href = document.season_select.season.options[document.season_select.season.selectedIndex].value;">
        {% for season_link in season_list%}
        <option
          value="{% url 'mahjong-ladder' season_link %}"
          {% ifequal season season_link %} selected="selected"{% endifequal %}>{{ season_link }}
        </option>
        {% endfor %}
        </select>
</form>
{% endif %}
