{% load i18n %}
<div class="table-responsive">
    <table class="table table-calendar">
        <thead>
        <tr>
            <th>{{ weeks.1.0.date|date:"D" }}</th>
            <th>{{ weeks.1.1.date|date:"D" }}</th>
            <th>{{ weeks.1.2.date|date:"D" }}</th>
            <th>{{ weeks.1.3.date|date:"D" }}</th>
            <th>{{ weeks.1.4.date|date:"D" }}</th>
            <th>{{ weeks.1.5.date|date:"D" }}</th>
            <th>{{ weeks.1.6.date|date:"D" }}</th>
        </tr>
        </thead>
        <tbody>
        {% for week in weeks %}
            <tr>
                {% for day in week %}
                    {% if day %}
                        <td class="day {% if day.events %}has-events{% else %}no-events{% endif %}"
                            data-date="{{ day.date|date:"SHORT_DATE_FORMAT" }}">
                            <h3>{{ day.day }}</h3>
                            <div class="events">
                                {% for event in day.events %}
                                    <a class="event {% if event.continued %}continued{% endif %}"
                                       href="{{ event.url }}">
                                        <span class="event-name">
                                            {{ event.event.name }}
                                        </span>
                                        {% if not event.continued %}
                                            {% if event.time %}
                                                <span class="event-time">
                                                <span class="fa fa-clock-o"></span>
                                                {{ event.time|date:"TIME_FORMAT" }}
                                                    {% if multiple_timezones %}
                                                        {{ event.timezone }}
                                                    {% endif %}
                                                </span>
                                            {% endif %}
                                            <span class="event-status">
                                                {% if event.event.presale_is_running %}
                                                    <span class="fa fa-ticket"></span> {% trans "Tickets on sale" %}
                                                {% elif event.event.presale_has_ended %}
                                                    <span class="fa fa-ticket"></span> {% trans "Sale over" %}
                                                {% elif event.event.settings.presale_start_show_date and event.event.presale_start %}
                                                    <span class="fa fa-ticket"></span>
                                                    {% blocktrans with start_date=event.event.presale_start|date:"SHORT_DATE_FORMAT" %}
                                                        from {{ start_date }}
                                                    {% endblocktrans %}
                                                {% else %}
                                                    <span class="fa fa-ticket"></span> {% trans "Soon" %}
                                                {% endif %}
                                            </span>
                                        {% endif %}
                                    </a>
                                {% endfor %}
                            </div>
                        </td>
                    {% else %}
                        <td class="no-day"></td>
                    {% endif %}
                {% endfor %}
            </tr>
        {% endfor %}
        <tr class="selected-day">
            <td colspan="7"></td>
        </tr>
        </tbody>
    </table>
</div>
