{% extends 'core/base_print.html' %}

{% load data_helpers static i18n %}

{% block extra_head %}
  <link rel="stylesheet" href="{% static 'css/chronos/timetable.css' %}">
  <link rel="stylesheet" href="{% static 'css/chronos/timetable_print.css' %}">
{% endblock %}

{% block page_title %}
  {% trans "Timetable" %} <i>{{ el.short_name }}</i>
{% endblock %}
{% block content %}
  <div class="timetable-plan">
    {#  Week days #}
    <div class="row">
      <div class="col s2">

      </div>
      {% for weekday in weekdays_short %}
        <div class="col s2">
          <div class="card timetable-title-card">
            <div class="card-content">
              <span class="card-title">
                {{ weekday.name }}
              </span>
            </div>
          </div>
        </div>
      {% endfor %}
    </div>

    {% for row in timetable %}
      <div class="row">
        <div class="col s2">
          {% if row.type == "period" %}
            {% include "chronos/partials/period_time.html" with period=row.period periods=periods %}
          {% endif %}
        </div>

        {% for col in row.cols %}
          {# A lesson #}
          <div class="col s2">
            {% if row.type == "period" %}
              {% include "chronos/partials/elements.html" with elements=col %}
            {% else %}
              {% include "chronos/partials/supervision.html" with supervision=col %}
            {% endif %}
          </div>
        {% endfor %}
      </div>
    {% endfor %}
  </div>

{% endblock %}
