# HG changeset patch # User Paul Boddie # Date 1238806667 -7200 # Node ID cd3048c9a9ec06621e7b0ddd2d6c153e1891c464 # Parent be6bc84b47040a024c32e9dfe54b109ae7834931 Employed the fixed table layout algorithm. Added pop-up elements for events with long names. Introduced clipping for long names, along with a smaller font size. diff -r be6bc84b4704 -r cd3048c9a9ec css/event-aggregator.css --- a/css/event-aggregator.css Sat Apr 04 01:32:45 2009 +0200 +++ b/css/event-aggregator.css Sat Apr 04 02:57:47 2009 +0200 @@ -24,6 +24,7 @@ .event-month { width: 98%; border-bottom: 1px solid #dddddd; + table-layout: fixed; } .event-month-heading { @@ -107,12 +108,23 @@ background-color: #dddddd; } +.event-summary-box { + position: relative; +} + +.event-summary-box a:link, +.event-summary-box a:hover, +.event-summary-box a:visited { + color: inherit !important; +} + .event-summary { padding: 0.25em 0.5em 0.25em 0.5em; margin-bottom: 0.25em; min-height: 2em; margin-left: 0; margin-right: 0; + overflow: hidden; } .event-summary.event-starts { @@ -125,10 +137,18 @@ margin-right: 0.5em; } -.event-summary a:link, -.event-summary a:hover, -.event-summary a:visited { - color: inherit !important; +.event-summary-popup { + display: none; + overflow: show; + position: absolute; + left: 0; + top: 0; + z-index: 2; + padding: 0.25em; +} + +.event-summary-box:hover > .event-summary-popup { + display: block; } /* List/summary view. */ diff -r be6bc84b4704 -r cd3048c9a9ec macros/EventAggregator.py --- a/macros/EventAggregator.py Sat Apr 04 01:32:45 2009 +0200 +++ b/macros/EventAggregator.py Sat Apr 04 02:57:47 2009 +0200 @@ -386,6 +386,16 @@ event_summary = EventAggregatorSupport.getEventSummary(event_page, event_details) + # Try to work out if the summary will cause sizing issues. + + summary_parts = event_summary.split() + largest_part = reduce(lambda x, y: max(x, len(y)), summary_parts, 0) + + if largest_part > 12: + sizing = "font-size: smaller;" + else: + sizing = "" + # Generate a colour for the event. bg = getColour(event_page.page_name) @@ -411,12 +421,24 @@ else: hide_text = 1 + output.append(fmt.div(on=1, css_class="event-summary-box")) + if not hide_text: - output.append(fmt.div(on=1, css_class=(" ".join(css_classes)), style=style)) + output.append(fmt.div(on=1, css_class=(" ".join(css_classes)), style=style+" "+sizing)) output.append(linkToPage(request, event_page, event_summary)) + output.append(fmt.div(on=0)) + + # Add a pop-up element for long summaries. + + if sizing: + output.append(fmt.div(on=1, css_class="event-summary-popup", style=style+" font-size: larger;")) + output.append(linkToPage(request, event_page, event_summary)) + output.append(fmt.div(on=0)) + else: - output.append(fmt.div(on=1, css_class=(" ".join(css_classes)), style=hidden_style)) + output.append(fmt.div(on=1, css_class=(" ".join(css_classes)), style=hidden_style+" "+sizing)) output.append(fmt.text(event_summary)) + output.append(fmt.div(on=0)) output.append(fmt.div(on=0))