1.1 --- a/css/event-aggregator.css Sun Mar 22 21:49:44 2009 +0100
1.2 +++ b/css/event-aggregator.css Sun Mar 22 22:04:47 2009 +0100
1.3 @@ -69,7 +69,7 @@
1.4
1.5 .event-day-empty {
1.6 background-color: #ffffff;
1.7 - padding-bottom: 2em;
1.8 + padding-bottom: 1em;
1.9 }
1.10
1.11 .event-day-busy {
2.1 --- a/macros/EventAggregator.py Sun Mar 22 21:49:44 2009 +0100
2.2 +++ b/macros/EventAggregator.py Sun Mar 22 22:04:47 2009 +0100
2.3 @@ -418,82 +418,105 @@
2.4
2.5 output.append(fmt.table_row(on=0))
2.6
2.7 - # Visit each set of scheduled events.
2.8 -
2.9 - for coverage, events in week_events:
2.10 + # Either generate empty days...
2.11
2.12 - # Output each set.
2.13 -
2.14 + if not week_events:
2.15 output.append(fmt.table_row(on=1))
2.16
2.17 - # Then, output day details.
2.18 -
2.19 for weekday in range(0, 7):
2.20 day = first_day + weekday
2.21 date = (year, month, day)
2.22
2.23 - # Skip out-of-month days.
2.24 + # Output out-of-month days.
2.25
2.26 if day < 1 or day > number_of_days:
2.27 output.append(fmt.table_cell(on=1, attrs={"class" : "event-day event-day-excluded"}))
2.28 output.append(fmt.table_cell(on=0))
2.29 - continue
2.30
2.31 - # Output the day.
2.32 + # Output empty days.
2.33
2.34 - if date in coverage:
2.35 - output.append(fmt.table_cell(on=1, attrs={"class" : "event-day event-day-busy"}))
2.36 else:
2.37 output.append(fmt.table_cell(on=1, attrs={"class" : "event-day event-day-empty"}))
2.38
2.39 - # Get event details for the current day.
2.40 + output.append(fmt.table_row(on=0))
2.41 +
2.42 + # Or visit each set of scheduled events...
2.43 +
2.44 + else:
2.45 + for coverage, events in week_events:
2.46 +
2.47 + # Output each set.
2.48 +
2.49 + output.append(fmt.table_row(on=1))
2.50
2.51 - for event_page, event_details in events:
2.52 - if not (event_details["start"] <= date <= event_details["end"]):
2.53 + # Then, output day details.
2.54 +
2.55 + for weekday in range(0, 7):
2.56 + day = first_day + weekday
2.57 + date = (year, month, day)
2.58 +
2.59 + # Skip out-of-month days.
2.60 +
2.61 + if day < 1 or day > number_of_days:
2.62 + output.append(fmt.table_cell(on=1, attrs={"class" : "event-day event-day-excluded"}))
2.63 + output.append(fmt.table_cell(on=0))
2.64 continue
2.65
2.66 - # Get a pretty version of the page name.
2.67 -
2.68 - pretty_pagename = getPrettyPageName(event_page)
2.69 + # Output the day.
2.70
2.71 - # Generate a colour for the event.
2.72 + if date in coverage:
2.73 + output.append(fmt.table_cell(on=1, attrs={"class" : "event-day event-day-busy"}))
2.74 + else:
2.75 + output.append(fmt.table_cell(on=1, attrs={"class" : "event-day event-day-empty"}))
2.76
2.77 - bg = getColour(event_page.page_name)
2.78 - fg = getBlackOrWhite(bg)
2.79 + # Get event details for the current day.
2.80
2.81 - css_classes = ["event-summary"]
2.82 + for event_page, event_details in events:
2.83 + if not (event_details["start"] <= date <= event_details["end"]):
2.84 + continue
2.85 +
2.86 + # Get a pretty version of the page name.
2.87
2.88 - if event_details["start"] == date:
2.89 - css_classes.append("event-starts")
2.90 - start_of_event = 1
2.91 - else:
2.92 - start_of_event = 0
2.93 + pretty_pagename = getPrettyPageName(event_page)
2.94 +
2.95 + # Generate a colour for the event.
2.96
2.97 - if event_details["end"] == date:
2.98 - css_classes.append("event-ends")
2.99 + bg = getColour(event_page.page_name)
2.100 + fg = getBlackOrWhite(bg)
2.101 +
2.102 + css_classes = ["event-summary"]
2.103
2.104 - # Output the event.
2.105 + if event_details["start"] == date:
2.106 + css_classes.append("event-starts")
2.107 + start_of_event = 1
2.108 + else:
2.109 + start_of_event = 0
2.110
2.111 - if name_usage == "daily" or start_of_event or weekday == 0 or day == 1:
2.112 - hide_text = 0
2.113 - else:
2.114 - hide_text = 1
2.115 + if event_details["end"] == date:
2.116 + css_classes.append("event-ends")
2.117 +
2.118 + # Output the event.
2.119
2.120 - output.append(fmt.div(on=1, css_class=(" ".join(css_classes)),
2.121 - style=("background-color: rgb(%d, %d, %d); color: rgb(%d, %d, %d);" % (bg + fg))))
2.122 + if name_usage == "daily" or start_of_event or weekday == 0 or day == 1:
2.123 + hide_text = 0
2.124 + else:
2.125 + hide_text = 1
2.126
2.127 - if not hide_text:
2.128 - output.append(event_page.link_to_raw(request, wikiutil.escape(pretty_pagename)))
2.129 + output.append(fmt.div(on=1, css_class=(" ".join(css_classes)),
2.130 + style=("background-color: rgb(%d, %d, %d); color: rgb(%d, %d, %d);" % (bg + fg))))
2.131
2.132 - output.append(fmt.div(on=0))
2.133 + if not hide_text:
2.134 + output.append(event_page.link_to_raw(request, wikiutil.escape(pretty_pagename)))
2.135 +
2.136 + output.append(fmt.div(on=0))
2.137
2.138 - # End of day.
2.139 + # End of day.
2.140
2.141 - output.append(fmt.table_cell(on=0))
2.142 + output.append(fmt.table_cell(on=0))
2.143
2.144 - # End of set.
2.145 + # End of set.
2.146
2.147 - output.append(fmt.table_row(on=0))
2.148 + output.append(fmt.table_row(on=0))
2.149
2.150 # Process the next week...
2.151