templates/channel_calendar.tmpl
changeset 54 b65a95eb9f6b
child 55 5667d2bbdc50
equal deleted inserted replaced
53:8103d18907a0 54:b65a95eb9f6b
       
     1 <%inherit file="channel.tmpl" />
       
     2 
       
     3 <%def name="month_table(cal, month, dates)">
       
     4 <table class="calendar">
       
     5 ## table header - month name
       
     6     <tr>
       
     7         <th colspan="7">${h.fmt_month(month)}</th>
       
     8     </tr>
       
     9 ## month header - weekday names    
       
    10     <tr>
       
    11     % for weekday in cal.iterweekdays() :
       
    12         <th>${h.fmt_weekday(weekday)}</th>
       
    13     % endfor
       
    14     </tr>
       
    15 ## iterate over the weeks
       
    16 % for week in cal.monthdays2calendar(month.year, month.month) :
       
    17     <tr>
       
    18     ## iterate over the week's days
       
    19     % for day, weekday in week :
       
    20         ## is it an empty cell?
       
    21         % if not day :
       
    22         <td>&nbsp;</td>
       
    23         % else :
       
    24         ## build date
       
    25         <% date = h.build_date(month, day) %>
       
    26         ## is it today?
       
    27         % if day and h.is_today(date) :
       
    28         <td id="today">\
       
    29         % else :
       
    30         <td>\
       
    31         % endif
       
    32         ## link to logs for this day?
       
    33         % if date in dates :
       
    34         <a href="${urls.channel_date.build(req, channel=channel, date=date)}">${day}</a>\
       
    35         % else :
       
    36         ${day}\
       
    37         % endif
       
    38 </td>
       
    39     % endif
       
    40     % endfor
       
    41     </tr>
       
    42 % endfor
       
    43 </table>
       
    44 </%def>
       
    45 
       
    46 ${month_table(calendar, month, days)}
       
    47