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

{% block datebook_content %}

<ul class="datebook-calendar-month-week">{% for datekey, entry in weekdays %}
    <li class="item" id="week-day-{{ datekey.day }}">
        <h3>{{ datekey|date:"d - l" }}</h3>
        <div class="container{% if not entry %} empty{% elif entry.vacation %} vacation{% endif %}">
        {% if entry %}
            {% if entry.vacation %}
                <p class="text-center"><em>{% trans "Vacation" %}</em></p>
            {% else %}
                <p class="working-hour">{{ entry.get_working_hours }}</p>
                <div class="content">{{ entry.content|linebreaks }}</div>
                <p class="length">{{ entry.get_elapsed_time }}</p>
            {% endif %}
            <p class="text-right"><a href="{% url 'datebook-author-day-edit' author=author year=datebook.period.year month=datebook.period.month day=datekey|date:"d" %}" class="button round success">{% trans 'Edit' %} <i class="icon-pencil"></i></a></p>
        {% else %}
            <p class="text-right"><a href="{% url 'datebook-author-day-add' author=author year=datebook.period.year month=datebook.period.month day=datekey|date:"d" %}" class="button round success">{% trans 'Add' %} <i class="icon-add-circle"></i></a></p>
        {% endif %}
        </div>
    </li>
{% endfor %}</ul>
{% endblock %}