]> git.decadent.org.uk Git - memories.git/blob - templates/calendar
Unpatch before cleaning
[memories.git] / templates / calendar
1 <div id="calendar">
2 <div align="center" style="border: 1px solid black; background: #eee">
3 <script>
4   function redo_self(arg) {
5     new Ajax.Updater("calendar","[%base%]/calendar?view_cal="+arg, { method: "get" })
6   }
7 </script>
8 [% IF request.action == "view" %]
9     [% SET shot = photo.shot %]
10 [% END %]
11 [% SET date = view_cal || shot || now %]
12 [% SET imp_date = shot || now %]
13 [% SET next = date.next_month %]
14 [% SET prev = date.prev_month %]
15 [% SET calendar = request.calendar(date.ymd) %]
16 <table class="calendar">
17     <tr>
18         <th> <a href="javascript:redo_self('[%prev.ymd%]')">&laquo; </a></th>
19         <th colspan="5"> 
20             [% date.strftime("%Y-%m") %] 
21         </th>
22         <th> [% IF next %]
23             <a href="javascript:redo_self('[%next.ymd%]')">&raquo; </a>
24             [% END %]
25         </th>
26     </tr>
27     <tr>
28     <td>S </td><td> M </td><td>
29     T</td><td>W</td><td>T</td><td>F</td><td>S</td>
30     </tr>
31 [% FOR week = calendar %]
32     <tr>
33
34 [% FOR day = week %]
35     [% IF day.tag %]
36         [% IF shot AND day.day == imp_date.mday %]
37             <td class="caltoday"> 
38         [% ELSE %]
39             <td class="caltagged"> 
40         [% END %]
41         <a href="[%base%][%day.tag%]?view_cal=[%date.ymd%]">[% day.day %]</a> </td>
42     [% ELSE %]
43     <td class="calempty"> [% day.day %] </td>
44     [% END %]
45 [% END %]
46     </tr>
47 [% END %]
48 </table>
49 </div>
50 </div>