1.1 --- a/macros/EventAggregator.py Sat Apr 04 01:32:45 2009 +0200
1.2 +++ b/macros/EventAggregator.py Sat Apr 04 02:57:47 2009 +0200
1.3 @@ -386,6 +386,16 @@
1.4
1.5 event_summary = EventAggregatorSupport.getEventSummary(event_page, event_details)
1.6
1.7 + # Try to work out if the summary will cause sizing issues.
1.8 +
1.9 + summary_parts = event_summary.split()
1.10 + largest_part = reduce(lambda x, y: max(x, len(y)), summary_parts, 0)
1.11 +
1.12 + if largest_part > 12:
1.13 + sizing = "font-size: smaller;"
1.14 + else:
1.15 + sizing = ""
1.16 +
1.17 # Generate a colour for the event.
1.18
1.19 bg = getColour(event_page.page_name)
1.20 @@ -411,12 +421,24 @@
1.21 else:
1.22 hide_text = 1
1.23
1.24 + output.append(fmt.div(on=1, css_class="event-summary-box"))
1.25 +
1.26 if not hide_text:
1.27 - output.append(fmt.div(on=1, css_class=(" ".join(css_classes)), style=style))
1.28 + output.append(fmt.div(on=1, css_class=(" ".join(css_classes)), style=style+" "+sizing))
1.29 output.append(linkToPage(request, event_page, event_summary))
1.30 + output.append(fmt.div(on=0))
1.31 +
1.32 + # Add a pop-up element for long summaries.
1.33 +
1.34 + if sizing:
1.35 + output.append(fmt.div(on=1, css_class="event-summary-popup", style=style+" font-size: larger;"))
1.36 + output.append(linkToPage(request, event_page, event_summary))
1.37 + output.append(fmt.div(on=0))
1.38 +
1.39 else:
1.40 - output.append(fmt.div(on=1, css_class=(" ".join(css_classes)), style=hidden_style))
1.41 + output.append(fmt.div(on=1, css_class=(" ".join(css_classes)), style=hidden_style+" "+sizing))
1.42 output.append(fmt.text(event_summary))
1.43 + output.append(fmt.div(on=0))
1.44
1.45 output.append(fmt.div(on=0))
1.46