templates/channel_calendar.tmpl
changeset 113 9fc0eb751b6a
parent 112 090192b64d7e
child 114 d4848d807fd1
equal deleted inserted replaced
112:090192b64d7e 113:9fc0eb751b6a
     1 <%inherit file="channel.tmpl" />
     1 <%inherit file="channel.tmpl" />
     2 
     2 
     3 <%def name="month_table(month)">
     3 <%def name="month_table(month, is_center=True)">
     4 ## the set of available days
     4 ## the set of available days
     5 <% log_dates = h.set(channel.source.get_month_days(month)) %>
     5 <% log_dates = h.set(channel.source.get_month_days(month)) %>
     6 ## the calendar table
     6 ## the calendar table
     7 <table class="calendar">
     7 <table class="calendar">
     8 ## table header - month name
     8 ## table header - month name
     9     <tr class="month-header">
     9     <tr class="month-header">
    10         <th colspan="7"${' class="this-month"' if h.is_this_month(month) else ''}>
    10         <th colspan="7"${' class="this-month"' if h.is_this_month(month) else ''}>
    11             <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>
    11         % if is_center :
    12             <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>
    12             <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>
       
    13             <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>
       
    14             
       
    15             <form action="${urls.channel_calendar.build(req, channel=channel)}" method="GET">
       
    16                 <select name="month">
       
    17                     ${h.select_options(((month_num, name) for month_num, name in h.months), month.month)}
       
    18                 </select>
       
    19                 <select name="year">
       
    20                     ${h.select_options(((None, 2006), (None, 2007), (None, 2008), (None, 2009)), month.year)}
       
    21                 </select>
       
    22                 <input type="submit" value="Go &raquo;" />
       
    23             </form>
       
    24         % else :
    13             <span id="month-name">${h.fmt_month(month)}</span>
    25             <span id="month-name">${h.fmt_month(month)}</span>
       
    26         % endif
    14         </th>
    27         </th>
    15     </tr>
    28     </tr>
    16 ## month header - weekday names    
    29 ## month header - weekday names    
    17     <tr class="week-header">
    30     <tr class="week-header">
    18     % for weekday in h.calendar.iterweekdays() :
    31     % for weekday in h.calendar.iterweekdays() :
    45 % endfor
    58 % endfor
    46 </table>
    59 </table>
    47 </%def>
    60 </%def>
    48 
    61 
    49 ## three months
    62 ## three months
    50 ${month_table(h.prev_month(month))}
    63 ${month_table(h.prev_month(month), is_center=False  )}
    51 ${month_table(month              )}
    64 ${month_table(month,               is_center=True   )}
    52 ${month_table(h.next_month(month))}
    65 ${month_table(h.next_month(month), is_center=False  )}
    53 
    66