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

{% block page-title %}
  {% if date == today %}
    {% trans "Today" %}
  {% else %}
    {{ date }}
  {% endif %}
{% endblock %}

{% block sub-navigation %}
  <form action="new" method="get">
    <input type="submit" value="{% trans "Create new entry" %}">
  </form>
{% endblock %}

{% block content %}
  {% autopaginate bookings 20 %}
  <form method="post">
  <h3>
    <a id="bookings-pointer" href="javascript:JS_toggleSection('bookings');" class="toggled-section">{% trans "Bookings" %}</a>
  </h3>
  <div id="bookings" class="default-list">
    <div class="pagination">
      <div style="float: left">
        {% trans "Select" %}:
        <a href="">{% trans "All" %},</a>
        <a href="">{% trans "Nothing" %}</a>
      </div>
      <div style="float: right;">
        <input type="submit" value="{% trans "Copy" %}" name="copy">
        <input type="submit" value="{% trans "Delete" %}" name="delete">
      </div>
    </div>
    <table id="booking-list" class="default-table">
      <thead>
        {% include "booking_heading.html" %}
      </thead>
      <tbody>
        {% for booking in bookings %}
          {% include "booking_row.html" %}
        {% empty %}
          <tr><td colspan="11">{% trans "No entries found" %}</td></tr>
        {% endfor %}
        {% if bookings %}
          <tr>
            <td colspan="4"><strong>{% trans "Sum" %}:</strong></td>
            <td style="text-align: center;"><strong>{{ day.get_booking_sum|format_minutes_to_time }}</strong></td>
            <td colspan="5"></td>
          </tr>
        {% endif %}
      </tbody>
    </table>
    <div class="pagination">
      {% paginate %}
    </div>
  </div>
  </form>
{% endblock %}
