1.1 --- a/macros/EventAggregator.py Sat Jul 23 15:59:27 2011 +0200
1.2 +++ b/macros/EventAggregator.py Sat Jul 23 19:00:04 2011 +0200
1.3 @@ -24,8 +24,8 @@
1.4
1.5 def __init__(self, page, calendar_name, raw_calendar_start, raw_calendar_end,
1.6 original_calendar_start, original_calendar_end, calendar_start, calendar_end,
1.7 - first, last, category_names, template_name, parent_name, mode, resolution,
1.8 - name_usage, map_name):
1.9 + first, last, category_names, remote_sources, template_name, parent_name, mode,
1.10 + resolution, name_usage, map_name):
1.11
1.12 """
1.13 Initialise the view with the current 'page', a 'calendar_name' (which
1.14 @@ -38,8 +38,9 @@
1.15 navigation in the user interface), along with the 'first' and 'last'
1.16 months of event coverage.
1.17
1.18 - The additional 'category_names', 'template_name', 'parent_name' and
1.19 - 'mode' parameters are used to configure the links employed by the view.
1.20 + The additional 'category_names', 'remote_sources', 'template_name',
1.21 + 'parent_name' and 'mode' parameters are used to configure the links
1.22 + employed by the view.
1.23
1.24 The 'resolution' affects the view for certain modes and is also used to
1.25 parameterise links.
1.26 @@ -67,6 +68,7 @@
1.27 self.map_name = map_name
1.28
1.29 self.category_name_parameters = "&".join([("category=%s" % name) for name in category_names])
1.30 + self.remote_source_parameters = "&".join([("source=%s" % source) for source in remote_sources])
1.31
1.32 # Calculate the duration in terms of the highest common unit of time.
1.33
1.34 @@ -250,10 +252,11 @@
1.35
1.36 # Generate the links.
1.37
1.38 - download_dialogue_link = "action=EventAggregatorSummary&parent=%s&resolution=%s&%s" % (
1.39 + download_dialogue_link = "action=EventAggregatorSummary&parent=%s&resolution=%s&%s&%s" % (
1.40 self.parent_name or "",
1.41 self.resolution,
1.42 - self.category_name_parameters
1.43 + self.category_name_parameters,
1.44 + self.remote_source_parameters
1.45 )
1.46 download_all_link = download_dialogue_link + "&doit=1"
1.47 download_link = download_all_link + ("&%s&%s" % (
1.48 @@ -603,7 +606,6 @@
1.49
1.50 output = []
1.51
1.52 - event_page = event.getPage()
1.53 event_details = event.getDetails()
1.54 event_summary = event.getSummary(self.parent_name)
1.55
1.56 @@ -619,7 +621,7 @@
1.57 if is_ambiguous:
1.58 output.append(fmt.icon("/!\\"))
1.59
1.60 - output.append(event_page.linkToPage(request, event_summary))
1.61 + output.append(event.linkToEvent(request, event_summary))
1.62 output.append(fmt.div(on=0))
1.63
1.64 # Add a pop-up element for long summaries.
1.65 @@ -629,7 +631,7 @@
1.66 if is_ambiguous:
1.67 output.append(fmt.icon("/!\\"))
1.68
1.69 - output.append(event_page.linkToPage(request, event_summary))
1.70 + output.append(event.linkToEvent(request, event_summary))
1.71 output.append(fmt.div(on=0))
1.72
1.73 output.append(fmt.div(on=0))
1.74 @@ -782,7 +784,6 @@
1.75 # Get event details for the current day.
1.76
1.77 for event in events:
1.78 - event_page = event.getPage()
1.79 event_details = event.getDetails()
1.80
1.81 if date not in event:
1.82 @@ -1221,7 +1222,6 @@
1.83
1.84 # Get the event details.
1.85
1.86 - event_page = event.getPage()
1.87 event_summary = event.getSummary(self.parent_name)
1.88 start, end = event.as_limits()
1.89 event_period = self._getCalendarPeriod(
1.90 @@ -1233,7 +1233,7 @@
1.91
1.92 # Link to the page using the summary.
1.93
1.94 - output.append(event_page.linkToPage(request, event_summary))
1.95 + output.append(event.linkToEvent(request, event_summary))
1.96
1.97 # Add the event period.
1.98
1.99 @@ -1413,8 +1413,8 @@
1.100
1.101 view = View(page, calendar_name, raw_calendar_start, raw_calendar_end,
1.102 original_calendar_start, original_calendar_end, calendar_start, calendar_end,
1.103 - first, last, category_names, template_name, parent_name, mode, resolution,
1.104 - name_usage, map_name)
1.105 + first, last, category_names, remote_sources, template_name, parent_name,
1.106 + mode, resolution, name_usage, map_name)
1.107
1.108 # Make a calendar.
1.109
1.110 @@ -1496,7 +1496,7 @@
1.111 # Link to the page using the summary.
1.112
1.113 output.append(fmt.table_cell(on=1, attrs=attrs))
1.114 - output.append(event_page.linkToPage(request, event_summary))
1.115 + output.append(event.linkToEvent(request, event_summary))
1.116 output.append(fmt.table_cell(on=0))
1.117
1.118 output.append(fmt.table_row(on=0))
1.119 @@ -1770,7 +1770,7 @@
1.120 # Link to the page using the summary.
1.121
1.122 output.append(fmt.paragraph(on=1))
1.123 - output.append(event_page.linkToPage(request, event_summary))
1.124 + output.append(event.linkToEvent(request, event_summary))
1.125 output.append(fmt.paragraph(on=0))
1.126
1.127 # Start and end dates.