]> git.decadent.org.uk Git - memories.git/commitdiff
Ajaxify the calendar. Closes #5.
authorSimon Cozens <simon@simon-cozens.org>
Mon, 12 Feb 2007 20:57:14 +0000 (20:57 +0000)
committerSimon Cozens <simon@simon-cozens.org>
Mon, 12 Feb 2007 20:57:14 +0000 (20:57 +0000)
git-svn-id: http://svn.simon-cozens.org/memories/trunk@30 041978f6-d955-411f-a9d7-1d8545c9c3c7

templates/calendar

index c71bf824e02e6b12f67eae30cd8a46d37ca55b34..68403a87329446d8fac9dcaf4d7257066d9484d0 100644 (file)
@@ -1,4 +1,10 @@
+<div id="calendar">
 <div align="center" style="border: 1px solid black; background: #eee">
+<script>
+  function redo_self(arg) {
+    new Ajax.Updater("calendar","[%base%]/calendar?view_cal="+arg, { method: "get" })
+  }
+</script>
 [% IF request.action == "view" %]
     [% SET shot = photo.shot %]
 [% END %]
 [% SET calendar = request.calendar(date.ymd) %]
 <table class="calendar">
     <tr>
-        <th> <a href="[%base%]/[%request.path%]?view_cal=[%prev.ymd%]">&laquo; </a></th>
+        <th> <a href="javascript:redo_self('[%prev.ymd%]')">&laquo; </a></th>
         <th colspan="5"> 
             [% date.strftime("%Y-%m") %] 
         </th>
         <th> [% IF next %]
-            <a href="[%base%]/[%request.path%]?view_cal=[%next.ymd%]">&raquo; </a>
+            <a href="javascript:redo_self('[%next.ymd%]')">&raquo; </a>
             [% END %]
         </th>
     </tr>
@@ -41,3 +47,4 @@
 [% END %]
 </table>
 </div>
+</div>