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