templates/channel_calendar.tmpl
changeset 54 b65a95eb9f6b
child 55 5667d2bbdc50
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/templates/channel_calendar.tmpl	Mon Feb 09 04:39:24 2009 +0200
@@ -0,0 +1,47 @@
+<%inherit file="channel.tmpl" />
+
+<%def name="month_table(cal, month, dates)">
+<table class="calendar">
+## table header - month name
+    <tr>
+        <th colspan="7">${h.fmt_month(month)}</th>
+    </tr>
+## month header - weekday names    
+    <tr>
+    % for weekday in cal.iterweekdays() :
+        <th>${h.fmt_weekday(weekday)}</th>
+    % endfor
+    </tr>
+## iterate over the weeks
+% for week in cal.monthdays2calendar(month.year, month.month) :
+    <tr>
+    ## iterate over the week's days
+    % for day, weekday in week :
+        ## is it an empty cell?
+        % if not day :
+        <td>&nbsp;</td>
+        % else :
+        ## build date
+        <% date = h.build_date(month, day) %>
+        ## is it today?
+        % if day and h.is_today(date) :
+        <td id="today">\
+        % else :
+        <td>\
+        % endif
+        ## link to logs for this day?
+        % if date in dates :
+        <a href="${urls.channel_date.build(req, channel=channel, date=date)}">${day}</a>\
+        % else :
+        ${day}\
+        % endif
+</td>
+    % endif
+    % endfor
+    </tr>
+% endfor
+</table>
+</%def>
+
+${month_table(calendar, month, days)}
+