{% extends "base.html" %}
{% load url from future %}
{% load i18n %}
{% block meta_title %}{% trans "Agenda" %} {{ this_month|date:"F" }} {{ this_month|date:"Y" }}{% endblock %}


{% block javascript %}
{{ block.super }}
<script type="text/javascript" src="{{ STATIC_URL }}js/jquery.prettyPhoto.js" charset="utf-8"></script>
<script type="text/javascript" src="{{ STATIC_URL }}js/jquery.biggerlink.min.js" charset="utf-8"></script>
{% endblock javascript %}


{% block document %}


{% block title %}
    <h3 class="agenda-title">
        <a href="{% url 'agenda-monthly-view' last_month.year last_month.month %}"
           title="{% trans "Last Month" %}">&larr;</a>
        {{ this_month|date:"F" }}
        {# <a title="{% blocktrans with this_month.year as year %}View {{ year}}{% endblocktrans %}" href="{% url 'agenda-yearly-view' this_month.year %}"> #}
            {{ this_month|date:"Y" }}
        {# </a> #}
        <a href="{% url 'agenda-monthly-view' next_month.year next_month.month %}"
           title="{% trans "Next Month" %}">&rarr;</a>
    </h3>
{% endblock %}
{% block article %}
    <table class="month-view">
        <thead>
            <tr>
              {% for day in week %}
                <th>{{ day }}</th>
              {% endfor %}
            </tr>
        </thead>
        <tbody>
            {% for row in calendar %}
            <tr>
                {% for day,items in row  %}
                <td{% ifequal day today.day  %} class="today"{% endifequal %}>
                {% if day %}

                    <div class="day-ordinal">
                        {# <a href="{% url 'agenda-daily-view' today.year today.month day %}">{{ day }}</a> #}
                        <span class="bg-day">{{day}}</span>
                    </div> 

                    {% if items %}
                    <ul>
                    {% for item in items %}
                        <li class="cal_item">
                            <span class="event_times">{{ item.start_time|time:"H:i" }}</span>
                            <a href="{% url "coop.agenda.views.event_minimal_view" item.event.id %}?ajax=true&amp;width=400&amp;height=240"
                                rel="prettyPhoto" class="cal_popup">{{ item.event.title }}</a>
                        </li>
                    {% endfor %}
                    </ul>
                    {% endif %}


                {% endif %}
                </td>
                {% endfor %}
            </tr>
            {% endfor %}
        </tbody>
    </table>
{% endblock %}


{% endblock %}


{% block jquery_footer %}
    $("a.cal_popup").prettyPhoto({wmode:'opaque',social_tools:''})
    $("li.cal_item").biggerlink({follow:false});
{% endblock %}