{% extends "two-column-content.html" %}
{% set page_type = 'calendar' %}

{% block left_sidebar %}
  {% include "contest/contest-list-tabs.html" %}
{% endblock %}

{% block middle_content %}
  <center style="font-size: 1.6em; margin-top: 0.3em;">
    {% if prev_month %}
      <a href="{{ url('contest_calendar', prev_month.year, prev_month.month) }}">&laquo; {{ _('Prev') }}</a>
    {% endif %}
    {% if not (curr_month.year == now.year and curr_month.month == now.month) %}
      <a href="{{ url('contest_calendar', now.year, now.month) }}"> {{ _('Today') }}</a>
    {% endif %}
    {% if next_month %}
      <a href="{{ url('contest_calendar', next_month.year, next_month.month) }}">{{ _('Next') }} &raquo;</a>
    {% endif %}
  </center>
  <table id="contest-calendar">
    <tr>
      <th>{{ _('Sunday') }}</th>
      <th>{{ _('Monday') }}</th>
      <th>{{ _('Tuesday') }}</th>
      <th>{{ _('Wednesday') }}</th>
      <th>{{ _('Thursday') }}</th>
      <th>{{ _('Friday') }}</th>
      <th>{{ _('Saturday') }}</th>
    </tr>
    {% for week in calendar %}
      <tr>{% for day in week %}
        <td class="{{ day.weekday }}{% if day.is_today %} today{% endif %}{% if day.is_pad %} noday{% endif %}">
          <span class="num">{{ day.date.day }}</span>
          <ul class="fa-ul">
            {% for contest in day.starts %}
              <li class="start"><i class="fa fa-li fa-lg fa-step-forward"></i>
                <a href="{{ url('contest_view', contest.key) }}">{{ contest.name }}</a>
              </li>
            {% endfor %}
            {% for contest in day.oneday %}
              <li class="oneday">
                <i class="fa fa-li fa-lg fa-play"></i>
                <a href="{{ url('contest_view', contest.key) }}">{{ contest.name }}</a>
              </li>
            {% endfor %}
            {% for contest in day.ends %}
              <li class="end"><i class="fa fa-li fa-lg fa-step-backward"></i>
                <a href="{{ url('contest_view', contest.key) }}">{{ contest.name }}</a>
              </li>
            {% endfor %}
          </ul>
        </td>
      {% endfor %}</tr>
    {% endfor %}
  </table>
{% endblock %}