1.1 --- a/EventAggregatorSupport/View.py Sun Mar 23 01:15:21 2014 +0100
1.2 +++ b/EventAggregatorSupport/View.py Sun Mar 23 01:33:55 2014 +0100
1.3 @@ -143,7 +143,9 @@
1.4 self.last = last
1.5 self.initDuration()
1.6
1.7 - if self.calendar_name:
1.8 + self.showing_everything = not self.calendar_start and not self.calendar_end
1.9 +
1.10 + if not self.showing_everything:
1.11
1.12 # Store the view parameters.
1.13
1.14 @@ -167,7 +169,7 @@
1.15
1.16 # Limit to the specified number of units.
1.17
1.18 - limit = int(getattr(request.cfg, "event_aggregator_max_duration", 20))
1.19 + limit = int(getattr(request.cfg, "event_aggregator_max_duration", 31))
1.20
1.21 if self.duration > limit:
1.22 if isinstance(self.first, Date):
1.23 @@ -191,7 +193,10 @@
1.24
1.25 "Return the 'argname' qualified using the calendar name."
1.26
1.27 - return getQualifiedParameterName(self.calendar_name, argname)
1.28 + if self.calendar_name:
1.29 + return getQualifiedParameterName(self.calendar_name, argname)
1.30 + else:
1.31 + return argname
1.32
1.33 def getDateQueryString(self, argname, date, prefix=1):
1.34
1.35 @@ -766,56 +771,53 @@
1.36 output = []
1.37 append = output.append
1.38
1.39 - if self.calendar_name:
1.40 - calendar_name = self.calendar_name
1.41 -
1.42 - # Links to the previous set of months and to a calendar shifted
1.43 - # back one month.
1.44 -
1.45 - previous_set_link = self.getNavigationLink(
1.46 - self.previous_set_start, self.previous_set_end
1.47 - )
1.48 - previous_link = self.getNavigationLink(
1.49 - self.previous_start, self.previous_end
1.50 - )
1.51 - previous_set_update_link = self.getUpdateLink(
1.52 - self.previous_set_start, self.previous_set_end
1.53 - )
1.54 - previous_update_link = self.getUpdateLink(
1.55 - self.previous_start, self.previous_end
1.56 - )
1.57 -
1.58 - # Links to the next set of months and to a calendar shifted
1.59 - # forward one month.
1.60 -
1.61 - next_set_link = self.getNavigationLink(
1.62 - self.next_set_start, self.next_set_end
1.63 - )
1.64 - next_link = self.getNavigationLink(
1.65 - self.next_start, self.next_end
1.66 - )
1.67 - next_set_update_link = self.getUpdateLink(
1.68 - self.next_set_start, self.next_set_end
1.69 - )
1.70 - next_update_link = self.getUpdateLink(
1.71 - self.next_start, self.next_end
1.72 - )
1.73 -
1.74 - append(fmt.div(on=1, css_class="event-calendar-navigation"))
1.75 -
1.76 - append(fmt.span(on=1, css_class="previous"))
1.77 - append(linkToPage(request, page, "<<", previous_set_link, onclick=previous_set_update_link, title=_("Previous set")))
1.78 - append(fmt.text(" "))
1.79 - append(linkToPage(request, page, "<", previous_link, onclick=previous_update_link, title=_("Previous")))
1.80 - append(fmt.span(on=0))
1.81 -
1.82 - append(fmt.span(on=1, css_class="next"))
1.83 - append(linkToPage(request, page, ">", next_link, onclick=next_update_link, title=_("Next")))
1.84 - append(fmt.text(" "))
1.85 - append(linkToPage(request, page, ">>", next_set_link, onclick=next_set_update_link, title=_("Next set")))
1.86 - append(fmt.span(on=0))
1.87 -
1.88 - append(fmt.div(on=0))
1.89 + # Links to the previous set of months and to a calendar shifted
1.90 + # back one month.
1.91 +
1.92 + previous_set_link = self.getNavigationLink(
1.93 + self.previous_set_start, self.previous_set_end
1.94 + )
1.95 + previous_link = self.getNavigationLink(
1.96 + self.previous_start, self.previous_end
1.97 + )
1.98 + previous_set_update_link = self.getUpdateLink(
1.99 + self.previous_set_start, self.previous_set_end
1.100 + )
1.101 + previous_update_link = self.getUpdateLink(
1.102 + self.previous_start, self.previous_end
1.103 + )
1.104 +
1.105 + # Links to the next set of months and to a calendar shifted
1.106 + # forward one month.
1.107 +
1.108 + next_set_link = self.getNavigationLink(
1.109 + self.next_set_start, self.next_set_end
1.110 + )
1.111 + next_link = self.getNavigationLink(
1.112 + self.next_start, self.next_end
1.113 + )
1.114 + next_set_update_link = self.getUpdateLink(
1.115 + self.next_set_start, self.next_set_end
1.116 + )
1.117 + next_update_link = self.getUpdateLink(
1.118 + self.next_start, self.next_end
1.119 + )
1.120 +
1.121 + append(fmt.div(on=1, css_class="event-calendar-navigation"))
1.122 +
1.123 + append(fmt.span(on=1, css_class="previous"))
1.124 + append(linkToPage(request, page, "<<", previous_set_link, onclick=previous_set_update_link, title=_("Previous set")))
1.125 + append(fmt.text(" "))
1.126 + append(linkToPage(request, page, "<", previous_link, onclick=previous_update_link, title=_("Previous")))
1.127 + append(fmt.span(on=0))
1.128 +
1.129 + append(fmt.span(on=1, css_class="next"))
1.130 + append(linkToPage(request, page, ">", next_link, onclick=next_update_link, title=_("Next")))
1.131 + append(fmt.text(" "))
1.132 + append(linkToPage(request, page, ">>", next_set_link, onclick=next_set_update_link, title=_("Next set")))
1.133 + append(fmt.span(on=0))
1.134 +
1.135 + append(fmt.div(on=0))
1.136
1.137 return "".join(output)
1.138
1.139 @@ -835,7 +837,7 @@
1.140 output = []
1.141 append = output.append
1.142
1.143 - if self.calendar_name:
1.144 + if not self.showing_everything:
1.145
1.146 # A link leading to this date being at the top of the calendar.
1.147
2.1 --- a/pages/HelpOnEventAggregator Sun Mar 23 01:15:21 2014 +0100
2.2 +++ b/pages/HelpOnEventAggregator Sun Mar 23 01:33:55 2014 +0100
2.3 @@ -261,15 +261,21 @@
2.4
2.5 === Navigation Controls ===
2.6
2.7 -The above examples have all provided fixed views of known events. However, a set of controls can be added to a calendar in order to let users navigate different time periods. This is done by providing a `calendar` parameter, indicating the name of the calendar, and by specifying a period of time:
2.8 +The above examples have all provided fixed views of known events. However, a set of controls can be added to a calendar in order to let users navigate different time periods. This is done by specifying a period of time:
2.9
2.10 {{{
2.11 ## Provide a navigable calendar.
2.12 <<EventAggregator(CategoryEvents,start=current,end=current,calendar=monthly)>>
2.13 }}}
2.14
2.15 +Here, an optional `calendar` parameter, indicating the name of the calendar, is used to distinguish between this calendar and any others that might be displayed on the same page. Without it, any navigation might cause other such calendars to change their positions, too.
2.16 +
2.17 Without any time period, the calendar would show all events, and there would be no real need to provide navigation, since there would be no events outside the displayed period to navigate to. It is possible to omit either the `start` or the `end` parameter and still provide navigation, however.
2.18
2.19 +=== Limits on Displayed Calendars ===
2.20 +
2.21 +So that the display of a calendar does not result in a very large Web page being produced, a limit is enforced on the number of months or days that a calendar will show at any one time. This limit is defined in the `event_aggregator_max_duration` configuration setting or is given a default of 31 (months in the calendar view, days in the day view).
2.22 +
2.23 === Showing Calendar Days ===
2.24
2.25 To view the individual days in a calendar, it is possible to hover over or select a day number and select the "View day" link. However, a calendar view can be set up using the macro as follows: