--- a/templates/channel_calendar.tmpl Wed Feb 11 22:56:43 2009 +0200
+++ b/templates/channel_calendar.tmpl Wed Feb 11 23:22:13 2009 +0200
@@ -1,6 +1,6 @@
<%inherit file="channel.tmpl" />
-<%def name="month_table(month)">
+<%def name="month_table(month, is_center=True)">
## the set of available days
<% log_dates = h.set(channel.source.get_month_days(month)) %>
## the calendar table
@@ -8,9 +8,22 @@
## table header - month name
<tr class="month-header">
<th colspan="7"${' class="this-month"' if h.is_this_month(month) else ''}>
- <a href="${urls.channel_calendar.build(req, channel=channel, year=h.next_month(month).year, month=h.next_month(month).month)}" class="next-month">»</a>
- <a href="${urls.channel_calendar.build(req, channel=channel, year=h.prev_month(month).year, month=h.prev_month(month).month)}" class="prev-month">«</a>
+ % if is_center :
+ <a href="${urls.channel_calendar.build(req, channel=channel, year=h.next_month(month).year, month=h.next_month(month).month)}" class="next-month" title="Next month">»</a>
+ <a href="${urls.channel_calendar.build(req, channel=channel, year=h.prev_month(month).year, month=h.prev_month(month).month)}" class="prev-month" title="Previous month">«</a>
+
+ <form action="${urls.channel_calendar.build(req, channel=channel)}" method="GET">
+ <select name="month">
+ ${h.select_options(((month_num, name) for month_num, name in h.months), month.month)}
+ </select>
+ <select name="year">
+ ${h.select_options(((None, 2006), (None, 2007), (None, 2008), (None, 2009)), month.year)}
+ </select>
+ <input type="submit" value="Go »" />
+ </form>
+ % else :
<span id="month-name">${h.fmt_month(month)}</span>
+ % endif
</th>
</tr>
## month header - weekday names
@@ -47,7 +60,7 @@
</%def>
## three months
-${month_table(h.prev_month(month))}
-${month_table(month )}
-${month_table(h.next_month(month))}
+${month_table(h.prev_month(month), is_center=False )}
+${month_table(month, is_center=True )}
+${month_table(h.next_month(month), is_center=False )}