1.1 --- a/macros/EventAggregator.py Mon May 02 00:30:37 2011 +0200
1.2 +++ b/macros/EventAggregator.py Wed May 04 00:56:24 2011 +0200
1.3 @@ -1179,8 +1179,14 @@
1.4 fmt = page.formatter
1.5 request = page.request
1.6
1.7 + # Sort the events by date.
1.8 +
1.9 + events.sort()
1.10 +
1.11 + # Write out a self-contained list of events.
1.12 +
1.13 output = []
1.14 - output.append(fmt.bullet_list(on=1, attr={"class" : "event-map-description-events"}))
1.15 + output.append(fmt.bullet_list(on=1, attr={"class" : "event-map-location-events"}))
1.16
1.17 for event in events:
1.18
1.19 @@ -1571,9 +1577,14 @@
1.20 output.append(fmt.image(map_image_url))
1.21 output.append(fmt.number_list(on=1))
1.22
1.23 + unpositioned_events = []
1.24 + event_locations = events_by_location.keys()
1.25 + event_locations.sort()
1.26 +
1.27 # Show the events in the map.
1.28
1.29 - for location, events in events_by_location.items():
1.30 + for location in event_locations:
1.31 + events = events_by_location[location]
1.32
1.33 # Look up the position of a location using the locations page.
1.34
1.35 @@ -1592,6 +1603,8 @@
1.36 longitude < map_bottom_left_longitude or \
1.37 latitude > map_top_right_latitude or \
1.38 longitude > map_top_right_longitude:
1.39 +
1.40 + unpositioned_events += events
1.41 continue
1.42
1.43 # Get the position and dimensions of the map marker.
1.44 @@ -1621,7 +1634,7 @@
1.45 marker_x, marker_y, map_x_scale, map_y_scale))
1.46 output.append(fmt.div(on=1, css_class="event-map-details"))
1.47 output.append(fmt.div(on=1, css_class="event-map-shadow"))
1.48 - output.append(fmt.div(on=1, css_class="event-map-description"))
1.49 + output.append(fmt.div(on=1, css_class="event-map-location"))
1.50
1.51 output.append(fmt.paragraph(on=1))
1.52 output.append(fmt.text(location))
1.53 @@ -1635,6 +1648,22 @@
1.54 output.append(fmt.div(on=0))
1.55 output.append(fmt.listitem(on=0))
1.56
1.57 + # Write unpositioned events.
1.58 +
1.59 + output.append(fmt.listitem(on=1, css_class="event-map-unpositioned"))
1.60 + output.append(fmt.div(on=1, css_class="event-map-details"))
1.61 + output.append(fmt.div(on=1, css_class="event-map-location"))
1.62 +
1.63 + output.append(fmt.paragraph(on=1))
1.64 + output.append(fmt.text(_("Events not shown on the map")))
1.65 + output.append(fmt.paragraph(on=0))
1.66 +
1.67 + output.append(view.writeMapEventSummaries(unpositioned_events))
1.68 +
1.69 + output.append(fmt.div(on=0))
1.70 + output.append(fmt.div(on=0))
1.71 + output.append(fmt.listitem(on=0))
1.72 +
1.73 # End of map view output.
1.74
1.75 output.append(fmt.number_list(on=0))