# HG changeset patch # User Paul Boddie # Date 1265239441 -3600 # Node ID 3c3880a95e3897ae6521e9127091ce323329bc24 # Parent 155ceab3c1222ec40a2f72f4b60f008c00aa71ef Fixed parent page trimming from event summaries where an empty parent page name is given. Introduced parent page support in the summary action in order to remove unwanted page components from events with non-overridden summaries. diff -r 155ceab3c122 -r 3c3880a95e38 EventAggregatorSupport.py --- a/EventAggregatorSupport.py Wed Feb 03 20:54:14 2010 +0100 +++ b/EventAggregatorSupport.py Thu Feb 04 00:24:01 2010 +0100 @@ -500,7 +500,7 @@ title = self.page.getPageName() - if event_parent is not None and title.startswith(event_parent): + if event_parent and title.startswith(event_parent): title = title[len(event_parent.rstrip("/")) + 1:] return getPrettyTitle(title) diff -r 155ceab3c122 -r 3c3880a95e38 actions/EventAggregatorSummary.py --- a/actions/EventAggregatorSummary.py Wed Feb 03 20:54:14 2010 +0100 +++ b/actions/EventAggregatorSummary.py Thu Feb 04 00:24:01 2010 +0100 @@ -29,6 +29,7 @@ def get_form_html(self, buttons_html): _ = self._ request = self.request + form = request.form category_list = [] @@ -57,18 +58,20 @@ ] d = { - "buttons_html" : buttons_html, - "category_label" : _("Categories"), - "category_list" : "\n".join(category_list), - "month_list" : "\n".join(month_list), - "start_label" : _("Start year and month"), - "start_year_default" : "", - "end_label" : _("End year and month"), - "end_year_default" : "", - "descriptions_label" : _("Use descriptions from..."), - "descriptions_list" : "\n".join(descriptions_list), - "format_label" : _("Summary format"), - "format_list" : "\n".join(format_list), + "buttons_html" : buttons_html, + "category_label" : _("Categories"), + "category_list" : "\n".join(category_list), + "month_list" : "\n".join(month_list), + "start_label" : _("Start year and month"), + "start_year_default" : "", + "end_label" : _("End year and month"), + "end_year_default" : "", + "descriptions_label" : _("Use descriptions from..."), + "descriptions_list" : "\n".join(descriptions_list), + "format_label" : _("Summary format"), + "format_list" : "\n".join(format_list), + "parent_label" : _("Parent page"), + "parent_name" : form.get("parent", [""])[0], } return ''' @@ -116,6 +119,12 @@ + + + + + + %(buttons_html)s @@ -172,6 +181,7 @@ category_names = form.get("category", []) format = form.get("format", ["iCalendar"])[0] descriptions = form.get("descriptions", ["page"])[0] + parent = form.get("parent", [""])[0] # Otherwise, produce an iCalendar resource. @@ -225,7 +235,7 @@ # Get the summary details. - event_summary = event.getSummary() + event_summary = event.getSummary(parent) link = event_page.getPageURL(request) # Output the event details. @@ -281,7 +291,7 @@ # Get the summary details. - event_summary = event.getSummary() + event_summary = event.getSummary(parent) link = event_page.getPageURL(request) request.write('\r\n') diff -r 155ceab3c122 -r 3c3880a95e38 macros/EventAggregator.py --- a/macros/EventAggregator.py Wed Feb 03 20:54:14 2010 +0100 +++ b/macros/EventAggregator.py Thu Feb 04 00:24:01 2010 +0100 @@ -93,7 +93,9 @@ # Generate the links. - download_all_link = "action=EventAggregatorSummary&doit=1&%s" % self.category_name_parameters + download_all_link = "action=EventAggregatorSummary&doit=1&parent=%s&%s" % ( + self.parent_name or "", self.category_name_parameters + ) download_link = download_all_link + ("&%s&%s" % ( self.getMonthQueryString("start", self.calendar_start, prefix=0), self.getMonthQueryString("end", self.calendar_end, prefix=0)