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

{% block head_base_js %}{{ block.super }}
{% comment %}<script language="JavaScript">
//<![CDATA[
$('td.item').click(function(e) {
    return;
});
//]]>
</script>{% endcomment %}
{% endblock %}

{% block datebook_container_css_classes %} row-fluid{% endblock %}

{% block datebook_content %}

<table class="datebook-calendar-month">
    <thead>
        <tr>{% spaceless %}
            <td class="weekno"></td>
            {% for classname, name in datebook_calendar.weekheader %}
            <th class="{% cycle 'mon' 'tue' 'wed' 'thu' 'fri' 'sat' 'sun' %}">{% trans name %}</th>
            {% endfor %}
        {% endspaceless %}</tr>
    </thead>
    <tbody>{% for week in datebook_calendar.month %}
        <tr>{% spaceless %}
            <td class="weekno">
                <a class="button round tiny" href="{% url 'datebook-author-month-week' author=datebook.author year=datebook.period.year month=datebook.period.month week=forloop.counter %}" title="{% trans 'Week' %} {{ forloop.counter }}"><i class="icon-edit"></i>&nbsp;Week&nbsp;{{ forloop.counter }}</a>
            </td>
            {% for day in week %}
                <td class="item {% cycle 'mon' 'tue' 'wed' 'thu' 'fri' 'sat' 'sun' %}{% if day.entry %} entry{% endif %}{% if day.is_current %} current{% endif %}{% if day.noday %} noday{% endif %}">
                    {% if not day.noday %}
                        <div class="container">
                            {% if day.entry %}
                                <p><span class="label text-center">{{ day.date.day }}</span></p>
                                {% if day.entry.vacation %}
                                    <p><em>Vacation</em></p>
                                {% else %}
                                    <p class="working-hour"><strong>{{ day.entry.get_working_hours }}</strong></p>
                                    <hr>
                                    <div class="content">{{ day.entry.content }}</div>
                                    <hr>
                                    <p class="length">{{ day.entry.get_elapsed_time }}</p>
                                {% endif %}
                            {% else %}
                                <p><span class="label text-center">{{ day.date.day }}</span></p>
                            {% endif %}
                        </div>
                    {% endif %}
                </td>
            {% endfor %}
        {% endspaceless %}</tr>{% endfor %}
    </tbody>
</table>
{% endblock %}