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

{% block page-title %}
  {% trans "Time tracking" %}
{% endblock %}

{% block navigation %}
  {% activetab "main" "time" %}
  {{ block.super }}
{% endblock %}

{% block sub-navigation %}
  <ul>
    <li><a href="{% url inhouse.views.show_today %}">{% trans "Current day" %}</a></li>
    <li><a href="{% url inhouse.views.overview %}">{% trans "Overview" %}</a></li>
    <li><a href="{% url inhouse.views.show_week today.year today.month today.day %}">{% trans "Weekly view" %}</a></li>
    <li><a href="">{% trans "Month" %}</a></li>
  </ul>
{% endblock %}

{% block content %}
  <h3>
    <a id="bookings-pointer" href="javascript:inhouse.toggle_section('bookings');" class="toggled-section">{% trans "Last activity" %}</a>
  </h3>
  <div id="bookings" class="default-list">
  <div class="pagination">
    <div style="float: left; margin-bottom: 5px;">
      <a href="javascript:inhouse.timeline.expand_all('timeline');">{% trans "Expand all" %}</a>
      |
      <a href="javascript:inhouse.timeline.collapse_all('timeline');">{% trans "Collapse all" %}</a>
    </div>
  </div>
  <table id="timeline" width="100%">
    <thead>
    </thead>
    <tbody>
      <tr>
        <td class="first last" style="padding:0px" width="100%">
          <div class="timeline-list">
            {% if not bookings_today and not bookings_last_week and not bookings_last_month %}
              <ul class="timeline">
                <li>{% trans "No entries found" %}</li>
              </ul>
            {% endif %}
            {% if bookings_today %}
              <h4>{% trans "Today" %}</h4>
              <ul class="timeline">
                {% for booking in bookings_today %}
                  {% include "timeline_row.html" %}
                {% endfor %}
              </ul>
            {% endif %}
            {% if bookings_last_week %}
              <h4>{% trans "Last 7 days" %}</h4>
              <ul class="timeline">
                {% for booking in bookings_last_week %}
                  {% include "timeline_row.html" %}
                {% endfor %}
              </ul>
            {% endif %}
            {% if bookings_last_month %}
              <h4>{% trans "Last 30 days" %}</h4>
              <ul class="timeline">
                {% for booking in bookings_last_month %}
                  {% include "timeline_row.html" %}
                {% endfor %}
              </ul>
            {% endif %}
          </div>
        </td>
      </tr>
    </tbody>
  </table>
  </div>
{% endblock %}
