1.1 --- a/imipweb/calendar.py Sun Oct 18 23:32:32 2015 +0200
1.2 +++ b/imipweb/calendar.py Sun Oct 18 23:58:02 2015 +0200
1.3 @@ -169,7 +169,7 @@
1.4 # Redirect to the object (or the first of the objects), where instead of
1.5 # attendee controls, there will be organiser controls.
1.6
1.7 - self.redirect(self.link_to(uid))
1.8 + self.redirect(self.link_to(uid, args=self.get_time_navigation_args()))
1.9 return True
1.10
1.11 # Page fragment methods.
1.12 @@ -307,6 +307,18 @@
1.13 view_end = self.get_date_arg(args, end_name)
1.14 return view_start, view_end
1.15
1.16 + def get_time_navigation_args(self):
1.17 +
1.18 + "Return a dictionary containing start and/or end navigation details."
1.19 +
1.20 + view_start, view_end = self.get_time_navigation()
1.21 + link_args = {}
1.22 + if view_start:
1.23 + link_args["start"] = format_datetime(view_start)
1.24 + if view_end:
1.25 + link_args["end"] = format_datetime(view_end)
1.26 + return link_args
1.27 +
1.28 # Full page output methods.
1.29
1.30 def show(self):
1.31 @@ -711,6 +723,10 @@
1.32
1.33 tzid = self.get_tzid()
1.34
1.35 + # Get view information for links.
1.36 +
1.37 + link_args = self.get_time_navigation_args()
1.38 +
1.39 # Produce a row for each interval.
1.40
1.41 intervals = list(intervals)
1.42 @@ -833,11 +849,12 @@
1.43 # which counter-proposals exist).
1.44
1.45 elif group_type == "request" and self._have_request(p.uid, p.recurrenceid, "COUNTER", True):
1.46 - page.a(p.summary, href=self.link_to(p.uid, p.recurrenceid,
1.47 - {"counter" : self._period_identifier(p)}))
1.48 + d = {"counter" : self._period_identifier(p)}
1.49 + d.update(link_args)
1.50 + page.a(p.summary, href=self.link_to(p.uid, p.recurrenceid, d))
1.51
1.52 else:
1.53 - page.a(p.summary, href=self.link_to(p.uid, p.recurrenceid))
1.54 + page.a(p.summary, href=self.link_to(p.uid, p.recurrenceid, link_args))
1.55
1.56 page.td.close()
1.57 else:
2.1 --- a/imipweb/event.py Sun Oct 18 23:32:32 2015 +0200
2.2 +++ b/imipweb/event.py Sun Oct 18 23:58:02 2015 +0200
2.3 @@ -755,6 +755,14 @@
2.4 def __init__(self, resource=None, messenger=None):
2.5 ResourceClientForObject.__init__(self, resource, messenger or Messenger())
2.6
2.7 + def link_to(self, uid=None, recurrenceid=None):
2.8 + args = self.env.get_query()
2.9 + d = {}
2.10 + for name in ("start", "end"):
2.11 + if args.get(name):
2.12 + d[name] = args[name][0]
2.13 + return ResourceClientForObject.link_to(self, uid, recurrenceid, d)
2.14 +
2.15 # Request logic methods.
2.16
2.17 def is_initial_load(self):
2.18 @@ -794,7 +802,7 @@
2.19 # If ignoring the object, return to the calendar.
2.20
2.21 if ignore:
2.22 - self.redirect(self.env.get_path())
2.23 + self.redirect(self.link_to())
2.24 return None
2.25
2.26 # Update the object.
2.27 @@ -946,7 +954,7 @@
2.28 # Upon handling an action, redirect to the main page.
2.29
2.30 if handled:
2.31 - self.redirect(self.env.get_path())
2.32 + self.redirect(self.link_to())
2.33
2.34 return None
2.35