1.1 --- a/css/event-aggregator.css Sat Apr 04 01:32:45 2009 +0200
1.2 +++ b/css/event-aggregator.css Sat Apr 04 02:57:47 2009 +0200
1.3 @@ -24,6 +24,7 @@
1.4 .event-month {
1.5 width: 98%;
1.6 border-bottom: 1px solid #dddddd;
1.7 + table-layout: fixed;
1.8 }
1.9
1.10 .event-month-heading {
1.11 @@ -107,12 +108,23 @@
1.12 background-color: #dddddd;
1.13 }
1.14
1.15 +.event-summary-box {
1.16 + position: relative;
1.17 +}
1.18 +
1.19 +.event-summary-box a:link,
1.20 +.event-summary-box a:hover,
1.21 +.event-summary-box a:visited {
1.22 + color: inherit !important;
1.23 +}
1.24 +
1.25 .event-summary {
1.26 padding: 0.25em 0.5em 0.25em 0.5em;
1.27 margin-bottom: 0.25em;
1.28 min-height: 2em;
1.29 margin-left: 0;
1.30 margin-right: 0;
1.31 + overflow: hidden;
1.32 }
1.33
1.34 .event-summary.event-starts {
1.35 @@ -125,10 +137,18 @@
1.36 margin-right: 0.5em;
1.37 }
1.38
1.39 -.event-summary a:link,
1.40 -.event-summary a:hover,
1.41 -.event-summary a:visited {
1.42 - color: inherit !important;
1.43 +.event-summary-popup {
1.44 + display: none;
1.45 + overflow: show;
1.46 + position: absolute;
1.47 + left: 0;
1.48 + top: 0;
1.49 + z-index: 2;
1.50 + padding: 0.25em;
1.51 +}
1.52 +
1.53 +.event-summary-box:hover > .event-summary-popup {
1.54 + display: block;
1.55 }
1.56
1.57 /* List/summary view. */
2.1 --- a/macros/EventAggregator.py Sat Apr 04 01:32:45 2009 +0200
2.2 +++ b/macros/EventAggregator.py Sat Apr 04 02:57:47 2009 +0200
2.3 @@ -386,6 +386,16 @@
2.4
2.5 event_summary = EventAggregatorSupport.getEventSummary(event_page, event_details)
2.6
2.7 + # Try to work out if the summary will cause sizing issues.
2.8 +
2.9 + summary_parts = event_summary.split()
2.10 + largest_part = reduce(lambda x, y: max(x, len(y)), summary_parts, 0)
2.11 +
2.12 + if largest_part > 12:
2.13 + sizing = "font-size: smaller;"
2.14 + else:
2.15 + sizing = ""
2.16 +
2.17 # Generate a colour for the event.
2.18
2.19 bg = getColour(event_page.page_name)
2.20 @@ -411,12 +421,24 @@
2.21 else:
2.22 hide_text = 1
2.23
2.24 + output.append(fmt.div(on=1, css_class="event-summary-box"))
2.25 +
2.26 if not hide_text:
2.27 - output.append(fmt.div(on=1, css_class=(" ".join(css_classes)), style=style))
2.28 + output.append(fmt.div(on=1, css_class=(" ".join(css_classes)), style=style+" "+sizing))
2.29 output.append(linkToPage(request, event_page, event_summary))
2.30 + output.append(fmt.div(on=0))
2.31 +
2.32 + # Add a pop-up element for long summaries.
2.33 +
2.34 + if sizing:
2.35 + output.append(fmt.div(on=1, css_class="event-summary-popup", style=style+" font-size: larger;"))
2.36 + output.append(linkToPage(request, event_page, event_summary))
2.37 + output.append(fmt.div(on=0))
2.38 +
2.39 else:
2.40 - output.append(fmt.div(on=1, css_class=(" ".join(css_classes)), style=hidden_style))
2.41 + output.append(fmt.div(on=1, css_class=(" ".join(css_classes)), style=hidden_style+" "+sizing))
2.42 output.append(fmt.text(event_summary))
2.43 + output.append(fmt.div(on=0))
2.44
2.45 output.append(fmt.div(on=0))
2.46