WikiCalendar Macro
Description
Renders a calendar of links to date-based wiki pages. Its primary use is for maintaining a calendar of meeting minutes, but it can be used in any situation where the wiki page name is based on the date. It is designed to work well with the Blog macro, so if a previous month is selected from the Blog, the calendar will display the selected month.
Non-existent pages link directly to the edit form for the requested page to make it easy to add new meeting minutes pages.
It takes one argument to specify the format of the page names. It uses the time format syntax from the Python time module's strftime method.
Another Version: Automatic linking to Milestones
I have created another version http://myhpi.de/~alexklim/WikiCalendar.py (newer than the attached file, includes a time parse bug fix!) which has these new features: (I cannot attach any file to this page anymore, so the link is external. If someone with more privileges could attach that file again under the name WikiCalendar?.py it would be very nice)
- allows to specify the year,month to display
- allows to enable/disable the prev/next buttons
- still allows to define a wiki page
- but will display a link to a milestone in bold if there is one placed on that day
- default format for wiki page is "%Y-%m-%d"
- table header with weekdays will be in bold
Description:
Format: WikiCalendar([year,month,[showbuttons,[wiki_page_format]]]) Description: Displays a calendar, the days will link to: - milestones (day in bold) if there is one on that day - a wiki page that has wiki_page_format (if exist) - create that wiki page if it does not exist Arguments: year, month = display calendar for month in year ('*' for current year/month) showbuttons = true/false, show prev/next buttons wiki_page_format = strftime format for wiki pages to display as link (if there is not a milestone placed on that day) (if exist, otherwise link to create page) default is "%Y-%m-%d" Examples: WikiCalendar shows a calendar for the current month, wiki pages will have the format "%Y-%m-%d" WikiCalendar(2006,07) shows a calender for July 2006, wiki pages will have the format "%Y-%m-%d" WikiCalendar(2006,07,false) as above, but don't display the prev/next buttons WikiCalendar(*,*,true,Meeting-%Y-%m-%d) shows a calendar for the current month, with buttons, and wiki pages with the format "Meeting-%Y-%m-%d" WikiCalendar(2006,07,false,Meeting-%Y-%m-%d) shows a calendar for July 2006, no buttons, and wiki pages with the format "Meeting-%Y-%m-%d"
Credits: Alexander Klimetschek
Bugs/Feature Requests
Existing bugs and feature requests for WikiCalendarMacro are here.
If you have any issues, create a new ticket.
Download
- WikiCalendarMacro for 0.8.
- WikiCalendarMacro for 0.9.
- Download the entire tree as a ZIP file.
Source
You can check out the source for WikiCalendarMacro from Subversion here or browse the source with Trac.
Example
[[WikiCalendar(Meeting-%Y-%m-%d)]]
will render as
Version 5 renders as
Author/Contributors
Author: mgood
Contributors:
Attachments
- WikiCalendarMacro.png (10.5 kB) - added by jornh on 02/08/06 22:14:02.
- WikiCalendar.py (6.8 kB) -
Another Calendar with more configuration and links to milestones
, added by alexander.klimetschek@hpi.uni-potsdam.de on 03/08/06 17:55:51. - WikiCalendarMacro.py (7.4 kB) -
A version of WikiCalendarMacro for 0.11dev-r5987
, added by sukhoy on 09/20/07 20:49:36. - WikiCalendarMacro.2.py (9.0 kB) -
Refactored: uses CSS, Javascript - tested with Trac 0.11b1, Python 2.5, Firefox 2.0
, added by Andy on 03/11/08 17:40:31. - wiki-calendar-screen.png (8.6 kB) -
screen clip of CSS / Javascript version of WikiCalendar?
, added by Andy on 03/11/08 17:46:49. - WikiCalendarMacro.3.py (9.8 kB) -
Further refinement of CSS / Javascript version, removed all Javascript
, added by Andy on 03/24/08 20:02:02. - WikiCalendarMacro.4.py (9.7 kB) -
For some reason, version 3 failed for me in python 2.4, trac 0.11rc1, with a date error. This is fixed.
, added by JasonWinnebeck on 05/02/08 00:28:13. - WikiCalendarMacro.5.py (10.0 kB) -
updated version 4's CSS slightly; tested on FF2, IE6
, added by Andy on 07/15/08 20:30:20. - wiki-calendar-screen.2.png (8.3 kB) -
Screenshot of version 5
, added by Andy on 07/15/08 20:31:39. - WikiCalendarMacro.6.py (9.8 kB) -
version 4 may have fixed something while running with Python 2.4, but it broke the SQL query for Milestones, so I've regressed the patch. This version tested with Python 2.5 ONLY. Expected to break with Python 2.4.
, added by Andy on 07/15/08 21:39:44. - WikiCalendarMacro.4.1.py (10.1 kB) -
Fix to my version 4, to fix prev/next button link generation, tested in Trac 0.11-r7405 and python 2.4
, added by JasonWinnebeck on 09/04/08 15:51:01.