templates/channel_calendar.tmpl
changeset 113 9fc0eb751b6a
parent 112 090192b64d7e
child 114 d4848d807fd1
--- 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">&raquo;</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">&laquo;</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">&raquo;</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">&laquo;</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 &raquo;" />
+            </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  )}