# HG changeset patch # User Paul Boddie # Date 1254516157 -7200 # Node ID c8ca5d3a4587ca1d014f2a89040b72b3801eb864 # Parent 98c85dafd26197add3409fbd2e9cf09833ddca70 Added a table view to the macro. Added styles to support the table view and to colour events for special topics. Updated the documentation. Updated the release information. diff -r 98c85dafd261 -r c8ca5d3a4587 EventAggregatorSupport.py --- a/EventAggregatorSupport.py Mon Jun 08 23:41:01 2009 +0200 +++ b/EventAggregatorSupport.py Fri Oct 02 22:42:37 2009 +0200 @@ -16,7 +16,7 @@ import time import re -__version__ = "0.3" +__version__ = "0.4" # Date labels. diff -r 98c85dafd261 -r c8ca5d3a4587 PKG-INFO --- a/PKG-INFO Mon Jun 08 23:41:01 2009 +0200 +++ b/PKG-INFO Fri Oct 02 22:42:37 2009 +0200 @@ -1,12 +1,12 @@ Metadata-Version: 1.1 Name: EventAggregator -Version: 0.3 +Version: 0.4 Author: Paul Boddie Author-email: paul at boddie org uk Maintainer: Paul Boddie Maintainer-email: paul at boddie org uk Home-page: http://moinmo.in/MacroMarket/EventAggregator -Download-url: http://moinmo.in/MacroMarket/EventAggregator?action=AttachFile&do=view&target=EventAggregator-0.3.tar.gz +Download-url: http://moinmo.in/MacroMarket/EventAggregator?action=AttachFile&do=view&target=EventAggregator-0.4.tar.gz Summary: Aggregate event data and display it in an event calendar (or summarise it in iCalendar and RSS resources) License: GPL (version 2 or later) Description: The EventAggregator macro for MoinMoin can be used to display event diff -r 98c85dafd261 -r c8ca5d3a4587 README.txt --- a/README.txt Mon Jun 08 23:41:01 2009 +0200 +++ b/README.txt Fri Oct 02 22:42:37 2009 +0200 @@ -152,6 +152,12 @@ Copyright and licence information can be found in the docs directory - see docs/COPYING.txt and docs/LICENCE.txt for more information. +New in EventAggregator 0.4 (Changes since EventAggregator 0.3) +-------------------------------------------------------------- + + * Added a table view in the macro, using special topic/category styles to + provide background colours for events. + New in EventAggregator 0.3 (Changes since EventAggregator 0.2) -------------------------------------------------------------- @@ -178,7 +184,7 @@ Update the EventAggregatorSupport.py __version__ attribute and the setup.py version details. Change the version number and package filename/directory in the documentation. -Update the setup.py file. +Update the setup.py and PKG-INFO files. Update the release notes (see above). Tag, export. Archive, upload. diff -r 98c85dafd261 -r c8ca5d3a4587 css/event-aggregator.css --- a/css/event-aggregator.css Mon Jun 08 23:41:01 2009 +0200 +++ b/css/event-aggregator.css Fri Oct 02 22:42:37 2009 +0200 @@ -223,5 +223,23 @@ padding-bottom: 2em; } +/* Table view */ + +.event-table-heading { + font-weight: bold; +} + +.event-table-category-conference { + background-color: #ff9999; +} + +.event-table-category-training { + background-color: #99ff99; +} + +.event-table-category-special { + background-color: #ffff99; +} + /* vim: tabstop=4 expandtab shiftwidth=4 */ diff -r 98c85dafd261 -r c8ca5d3a4587 macros/EventAggregator.py --- a/macros/EventAggregator.py Mon Jun 08 23:41:01 2009 +0200 +++ b/macros/EventAggregator.py Fri Oct 02 22:42:37 2009 +0200 @@ -277,9 +277,31 @@ # Output top-level information. + # Start of list view output. + if mode == "list": output.append(fmt.bullet_list(on=1, attr={"class" : "event-listings"})) + # Start of table view output. + + elif mode == "table": + + # Output a table. + + output.append(fmt.table(on=1, attrs={"tableclass" : "event-table"})) + + output.append(fmt.table_row(on=1)) + output.append(fmt.table_cell(on=1, attrs={"class" : "event-table-heading"})) + output.append(fmt.text(_("Event dates"))) + output.append(fmt.table_cell(on=0)) + output.append(fmt.table_cell(on=1, attrs={"class" : "event-table-heading"})) + output.append(fmt.text(_("Event location"))) + output.append(fmt.table_cell(on=0)) + output.append(fmt.table_cell(on=1, attrs={"class" : "event-table-heading"})) + output.append(fmt.text(_("Event details"))) + output.append(fmt.table_cell(on=0)) + output.append(fmt.table_row(on=0)) + # Visit all months in the requested range, or across known events. for year, month in EventAggregatorSupport.daterange(first, last): @@ -692,6 +714,62 @@ output.append(fmt.bullet_list(on=0)) + # Or output a table of events... + + elif mode == "table": + + # Get the events in order. + + ordered_events = EventAggregatorSupport.getOrderedEvents(shown_events.get((year, month), [])) + + # Show the events in order. + + for event_page, event_details in ordered_events: + event_summary = EventAggregatorSupport.getEventSummary(event_page, event_details) + + # Prepare CSS classes with category-related styling. + + css_classes = ["event-table-details"] + + for topic in event_details.get("topics") or event_details.get("categories"): + + # Filter the category text to avoid illegal characters. + + css_classes.append("event-table-category-%s" % "".join(filter(lambda c: c.isalnum(), topic))) + + attrs = {"class" : " ".join(css_classes)} + + output.append(fmt.table_row(on=1)) + + # Start and end dates. + + output.append(fmt.table_cell(on=1, attrs=attrs)) + output.append(fmt.span(on=1)) + output.append(fmt.text("%04d-%02d-%02d" % event_details["start"])) + output.append(fmt.span(on=0)) + output.append(fmt.text(" - ")) + output.append(fmt.span(on=1)) + output.append(fmt.text("%04d-%02d-%02d" % event_details["end"])) + output.append(fmt.span(on=0)) + output.append(fmt.table_cell(on=0)) + + # Location. + + output.append(fmt.table_cell(on=1, attrs=attrs)) + + if event_details.has_key("location"): + output.append(fmt.text(event_details["location"])) + + output.append(fmt.table_cell(on=0)) + + # Link to the page using the summary. + + output.append(fmt.table_cell(on=1, attrs=attrs)) + output.append(linkToPage(request, event_page, event_summary)) + output.append(fmt.table_cell(on=0)) + + output.append(fmt.table_row(on=0)) + # Output top-level information. # End of list view output. @@ -699,6 +777,11 @@ if mode == "list": output.append(fmt.bullet_list(on=0)) + # End of table view output. + + elif mode == "table": + output.append(fmt.table(on=0)) + return ''.join(output) # vim: tabstop=4 expandtab shiftwidth=4 diff -r 98c85dafd261 -r c8ca5d3a4587 pages/CategoryEvents --- a/pages/CategoryEvents Mon Jun 08 23:41:01 2009 +0200 +++ b/pages/CategoryEvents Fri Oct 02 22:42:37 2009 +0200 @@ -9,6 +9,10 @@ <> +Each event must be created on a new page belonging to the appropriate event category. The following action can be used to create a new event page (using !EventAggregatorNewEvent): + +(!) <> + Some ideas: * You can add other categories and then separate groups of events by assigning their pages to different categories. diff -r 98c85dafd261 -r c8ca5d3a4587 pages/HelpOnEventAggregator --- a/pages/HelpOnEventAggregator Mon Jun 08 23:41:01 2009 +0200 +++ b/pages/HelpOnEventAggregator Fri Oct 02 22:42:37 2009 +0200 @@ -44,7 +44,7 @@ Title:: the preferred name of the event in the calendar Summary:: a synonym for title Topics:: a list of topics related to the event - use a comma (`,`) to separate topic names - Categories:: a synonym for topics + Categories:: a synonym for topics - note that this means "event categories", not "page categories" which are a distinct concept Location:: the location of the event These properties may be incorporated into representations or summaries of events. @@ -116,7 +116,7 @@ Without any time period, the calendar would show all events, and there would be no real need to provide navigation, since there would be no events outside the displayed period to navigate to. It is possible to omit either the `start` or the `end` parameter and still provide navigation, however. -== Showing Event Lists == +== Showing Event Lists and Tables == A more plain view of events can be displayed by specifying the `mode` parameter as follows: @@ -124,7 +124,25 @@ <> }}} -The `list` value causes a list view to be employed; the `calendar` value causes the default calendar view to be employed. +The `list` value causes a list view to be employed. + +Another alternative view can be chosen by specifying the `mode` parameter with a value of `table` as in the following example: + +{{{ +<> +}}} + +This collects all appropriate events into a single table, applying colouring to the cells belonging to a particular event based on that event's topic (or category) information. By default, only the following topics (or categories) cause cell colouring: + + * `conference` - using the `event-table-category-conference` style + * `special` - using the `event-table-category-special` style + * `training` - using the `event-table-category-training` style + +To define your own topic colours, edit the `event-aggregator.css` file which is provided with the !EventAggregator distribution, and then reinstall that file for each of the Wiki themes of interest. Topics involved in event colouring should be mutually exclusive: more than one such topic should not be specified for any given event. + +=== Note === + +The `calendar` value causes the default calendar view to be employed. == See Also == diff -r 98c85dafd261 -r c8ca5d3a4587 setup.py --- a/setup.py Mon Jun 08 23:41:01 2009 +0200 +++ b/setup.py Fri Oct 02 22:42:37 2009 +0200 @@ -8,6 +8,6 @@ author = "Paul Boddie", author_email = "paul@boddie.org.uk", url = "http://moinmo.in/MacroMarket/EventAggregator", - version = "0.3", + version = "0.4", py_modules = ["EventAggregatorSupport"] )