# HG changeset patch # User Paul Boddie # Date 1304463384 -7200 # Node ID ab46ecc2cebbdca10fa918862d20573cc4f9e7f2 # Parent fd5d97bf07c8ccdc910e2c759d5c2c419d58775e Added the display of unpositioned events in the map view. Ordered events by date for each location, and ordered the locations alphabetically for the print view. diff -r fd5d97bf07c8 -r ab46ecc2cebb css/event-aggregator-print.css --- a/css/event-aggregator-print.css Mon May 02 00:30:37 2011 +0200 +++ b/css/event-aggregator-print.css Wed May 04 00:56:24 2011 +0200 @@ -78,6 +78,10 @@ list-style-position: inside; } +.event-map-container > ol > li.event-map-unpositioned { + list-style-type: none; /* unpositioned events do not refer to a marker */ +} + .event-map-container > ol > li:before { vertical-align: top; } @@ -100,6 +104,7 @@ vertical-align: top; } +.event-map-unpositioned .event-map-details, div.event-map-label .event-map-details { position: static !important; display: block; @@ -112,7 +117,7 @@ visibility: hidden; } -.event-map-description { +.event-map-location { visibility: visible; background-color: transparent; } diff -r fd5d97bf07c8 -r ab46ecc2cebb css/event-aggregator.css --- a/css/event-aggregator.css Mon May 02 00:30:37 2011 +0200 +++ b/css/event-aggregator.css Wed May 04 00:56:24 2011 +0200 @@ -439,7 +439,7 @@ background-color: #555; } -.event-map-description { +.event-map-shadow .event-map-location { position: relative; top: -8px; left: -8px; @@ -447,18 +447,18 @@ background-color: #fff; } -.event-map-description p { +.event-map-location p { font-weight: bold; font-size: larger; text-align: center; } -ul.event-map-description-events { +ul.event-map-location-events { list-style-type: none; padding: 0.25em; } -ul.event-map-description-events li { +ul.event-map-location-events li { text-align: left; padding: 0.25em 0 0.25em 0; } diff -r fd5d97bf07c8 -r ab46ecc2cebb macros/EventAggregator.py --- a/macros/EventAggregator.py Mon May 02 00:30:37 2011 +0200 +++ b/macros/EventAggregator.py Wed May 04 00:56:24 2011 +0200 @@ -1179,8 +1179,14 @@ fmt = page.formatter request = page.request + # Sort the events by date. + + events.sort() + + # Write out a self-contained list of events. + output = [] - output.append(fmt.bullet_list(on=1, attr={"class" : "event-map-description-events"})) + output.append(fmt.bullet_list(on=1, attr={"class" : "event-map-location-events"})) for event in events: @@ -1571,9 +1577,14 @@ output.append(fmt.image(map_image_url)) output.append(fmt.number_list(on=1)) + unpositioned_events = [] + event_locations = events_by_location.keys() + event_locations.sort() + # Show the events in the map. - for location, events in events_by_location.items(): + for location in event_locations: + events = events_by_location[location] # Look up the position of a location using the locations page. @@ -1592,6 +1603,8 @@ longitude < map_bottom_left_longitude or \ latitude > map_top_right_latitude or \ longitude > map_top_right_longitude: + + unpositioned_events += events continue # Get the position and dimensions of the map marker. @@ -1621,7 +1634,7 @@ marker_x, marker_y, map_x_scale, map_y_scale)) output.append(fmt.div(on=1, css_class="event-map-details")) output.append(fmt.div(on=1, css_class="event-map-shadow")) - output.append(fmt.div(on=1, css_class="event-map-description")) + output.append(fmt.div(on=1, css_class="event-map-location")) output.append(fmt.paragraph(on=1)) output.append(fmt.text(location)) @@ -1635,6 +1648,22 @@ output.append(fmt.div(on=0)) output.append(fmt.listitem(on=0)) + # Write unpositioned events. + + output.append(fmt.listitem(on=1, css_class="event-map-unpositioned")) + output.append(fmt.div(on=1, css_class="event-map-details")) + output.append(fmt.div(on=1, css_class="event-map-location")) + + output.append(fmt.paragraph(on=1)) + output.append(fmt.text(_("Events not shown on the map"))) + output.append(fmt.paragraph(on=0)) + + output.append(view.writeMapEventSummaries(unpositioned_events)) + + output.append(fmt.div(on=0)) + output.append(fmt.div(on=0)) + output.append(fmt.listitem(on=0)) + # End of map view output. output.append(fmt.number_list(on=0))