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

{% block datebook_content %}
<div class="datebook-calendar-year">{% for month_date, month_datebook in datebooks_map %}
    <div class="small-12 medium-3 columns{% if not month_datebook %} empty{% endif %}">
        <div class="panel radius text-center">
            <h3>{{ month_date|date:"F" }}</h3>
            {% if month_datebook %}
                <p>
                    <a href="{% url 'datebook-author-month' author=author year=month_datebook.period.year month=month_datebook.period.month %}" class="button">{% blocktrans with count=month_datebook.dayentry_set.count %}{{ count }} entries{% endblocktrans %}</a>
                </p>
            {% else %}
                <p>
                    <a href="#" class="button secondary" data-reveal-id="new-datebook-{{ month_date.month }}">{% trans "Create it" %}</a>
                </p>
            {% endif %}
        </div>
    </div>
{% endfor %}</div>
{% endblock %}

{% block foot_more_js %}{{ block.super }}
{% for month_date, month_datebook in datebooks_map %}{% if not month_datebook %}
<div id="new-datebook-{{ month_date.month }}" class="reveal-modal text-center tiny" data-reveal>
    <h3>{% trans "Create a new datebook" %}</h3>
    <p>{% blocktrans with name=month_date|date:"F" year=month_date.year %}This will create a datebook for <strong>{{ name }} {{ year }}</strong>, confirm this.{% endblocktrans %}</p>
    <p><a href="{% url 'datebook-author-month-add' author=author year=year month=forloop.counter %}" class="radius success button">{% trans "I confirm" %}</a></p>
    <a class="close-reveal-modal">&#215;</a>
</div>
{% endif %}{% endfor %}
{% endblock %}