<tal:defs define="status view/update"/>
<html metal:use-macro="view/@@schooltool_macros/calendar/page"
      i18n:domain="schooltool">
  <metal:block metal:fill-slot="calendar-body">
    <table id="calendar-view-month" cellpadding="0" cellspacing="0"
           tal:define="weeks view/getCurrentMonth">
      <tr>
          <th>&nbsp;</th>
          <th class="weekday"
              tal:repeat="weekday python:weeks[0]"
              tal:content="python:view.dayOfWeek(weekday.date)" />
        </tr>
        <tr tal:repeat="week weeks">
          <td class="weekno" width="30">
            <a tal:content="python:week[0].date.isocalendar()[1]"
                tal:attributes="href
                    python: view.calURL('weekly', week[0].date)"/>
          </td>
          <tal:block tal:repeat="day week">
            <td class="day" width="70" valign="top"
              tal:define="same_month python:day.date.month == view.cursor.month"
              tal:attributes="class python:same_month and 'day' or 'day-other'">
              <a tal:attributes="href python:view.calURL('daily', day.date)">
                <span tal:content="day/date/day"
                      tal:attributes="class day/today" />
                <tal:loop repeat="event day/events">
                  <tal:if condition="not:event/allday">
                    <span tal:content="structure event/renderShort"
                          tal:attributes="class event/cssClass;
                                          style string:background: ${event/color1};;
                                          border-color: ${event/color2}" />
                  </tal:if>
                  <tal:if condition="event/allday">
                    <span tal:attributes="class event/cssClass;
                                          style string:background: ${event/color1};;
                                          border-color: ${event/color2}">
                      <span tal:content="event/shortTitle"/>
                      (<span i18n:translate="">All day</span>)
                    </span>
                  </tal:if>
                </tal:loop>
              </a>
            </td>
          </tal:block>
        </tr>
    </table>
  </metal:block>
</html>
