changeset 3902:4431145e4994

MonthCalendar macro: fix height6,anniversary,template params parsing / url generation
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sat, 26 Jul 2008 16:19:12 +0200
parents 5b6ba9b8158d
children 0f86861f1adb 4353a470388e
files MoinMoin/macro/MonthCalendar.py
diffstat 1 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/macro/MonthCalendar.py	Fri Jul 25 22:22:51 2008 +0200
+++ b/MoinMoin/macro/MonthCalendar.py	Sat Jul 26 16:19:12 2008 +0200
@@ -6,7 +6,7 @@
     The days are links to Wiki pages following this naming convention:
     BasePageName/year-month-day
 
-    @copyright: 2002-2007 MoinMoin:ThomasWaldmann
+    @copyright: 2002-2008 MoinMoin:ThomasWaldmann
     @license: GNU GPL, see COPYING for details.
 
     Revisions:
@@ -91,7 +91,7 @@
         * adapted to moin 1.7 new macro parameter parsing
 
     Usage:
-        <<MonthCalendar(BasePage,year,month,monthoffset,monthoffset2,height6)>>
+        <<MonthCalendar(BasePage,year,month,monthoffset,monthoffset2,height6,anniversary,template)>>
 
         each parameter can be empty and then defaults to currentpage or currentdate or monthoffset=0
 
@@ -144,7 +144,7 @@
 
 This creates a calendar which uses MonthCalendarTemplate for directly editing
 nonexisting day pages:
-<<MonthCalendar(,,,,,,MonthCalendarTemplate)>>
+<<MonthCalendar(,,,,,,,MonthCalendarTemplate)>>
 """
 
 Dependencies = ['namespace', 'time', ]
@@ -221,6 +221,8 @@
         try:
             cparmpagename, cparmyear, cparmmonth, cparmoffset, cparmoffset2, cparmheight6, cparmanniversary, cparmtemplate = \
                 parseargs(request, text2, thispage, currentyear, currentmonth, 0, 0, False, False, u'')
+            # Note: cparmheight6 and cparmanniversary are not used, they are just there
+            # to have a consistent parameter string in calparms and macro args
         except (ValueError, TypeError), err:
             return macro.format_error(err)
     else:
@@ -272,7 +274,7 @@
     p = Page(request, thispage)
     qpagenames = '*'.join([wikiutil.quoteWikinameURL(pn) for pn in parmpagename])
     qtemplate = wikiutil.quoteWikinameURL(parmtemplate)
-    querystr = "calparms=%%s,%d,%d,%d,%%d,%%s" % (parmyear, parmmonth, parmoffset)
+    querystr = "calparms=%%s,%d,%d,%d,%%d,,,%%s" % (parmyear, parmmonth, parmoffset)
     prevlink = p.url(request, querystr % (qpagenames, parmoffset2 - 1, qtemplate))
     nextlink = p.url(request, querystr % (qpagenames, parmoffset2 + 1, qtemplate))
     prevylink = p.url(request, querystr % (qpagenames, parmoffset2 - 12, qtemplate))