1.1 --- a/imip_manager.py Thu Jan 29 22:55:29 2015 +0100
1.2 +++ b/imip_manager.py Thu Jan 29 23:31:18 2015 +0100
1.3 @@ -490,8 +490,6 @@
1.4
1.5 self.page.div(id="participants")
1.6
1.7 - self.page.form(method="POST")
1.8 -
1.9 self.page.p("Participants for scheduling:")
1.10
1.11 for i, participant in enumerate(participants):
1.12 @@ -505,8 +503,6 @@
1.13 self.page.input(name="add-participant", type="submit", value="Add")
1.14 self.page.p.close()
1.15
1.16 - self.page.form.close()
1.17 -
1.18 self.page.div.close()
1.19
1.20 return participants
1.21 @@ -544,9 +540,19 @@
1.22 self.new_page(title="Calendar")
1.23 page = self.page
1.24
1.25 + # Form controls are used in various places on the calendar page.
1.26 +
1.27 + page.form(method="POST")
1.28 +
1.29 self.show_requests_on_page()
1.30 participants = self.show_participants_on_page()
1.31
1.32 + # Show a button for scheduling a new event.
1.33 +
1.34 + page.p()
1.35 + page.input(name="newevent", type="submit", value="New event", id="newevent")
1.36 + page.p.close()
1.37 +
1.38 freebusy = self.store.get_freebusy(self.user)
1.39
1.40 if not freebusy:
1.41 @@ -655,6 +661,10 @@
1.42 self.show_calendar_days(days, partitioned_groups, partitioned_group_types, group_columns)
1.43 page.table.close()
1.44
1.45 + # End the form region.
1.46 +
1.47 + page.form.close()
1.48 +
1.49 def show_calendar_participant_headings(self, group_types, group_sources, group_columns):
1.50
1.51 """
1.52 @@ -740,7 +750,8 @@
1.53
1.54 page.tr()
1.55 page.th(class_="timeslot")
1.56 - page.add(self.format_time(point, "long"))
1.57 + self._time_point(point)
1.58 + page.span(self.format_time(point, "long"), class_="timepoint")
1.59 page.th.close()
1.60
1.61 # Obtain slots for the time point from each group.
1.62 @@ -753,7 +764,9 @@
1.63 # the colspan is adjusted to be 1, not 0.
1.64
1.65 if not active:
1.66 - page.td("", class_="empty", colspan=max(columns, 1))
1.67 + page.td(class_="empty container", colspan=max(columns, 1))
1.68 + self._empty_slot(point)
1.69 + page.td.close()
1.70 continue
1.71
1.72 slots = slots.items()
1.73 @@ -806,17 +819,30 @@
1.74
1.75 page.td.close()
1.76 else:
1.77 - page.td("", class_="empty")
1.78 + page.td(class_="empty container")
1.79 + self._empty_slot(point)
1.80 + page.td.close()
1.81
1.82 # Pad with empty columns.
1.83
1.84 i = columns - len(active)
1.85 while i > 0:
1.86 i -= 1
1.87 - page.td("", class_="empty")
1.88 + page.td(class_="empty container")
1.89 + self._empty_slot(point)
1.90 + page.td.close()
1.91
1.92 page.tr.close()
1.93
1.94 + def _time_point(self, point):
1.95 + pointstr = format_datetime(point)
1.96 + self.page.input(name="start", type="radio", value=pointstr, id="start-%s" % pointstr, class_="newevent")
1.97 +
1.98 + def _empty_slot(self, point):
1.99 + page = self.page
1.100 + pointstr = format_datetime(point)
1.101 + page.label("Start a new event at this time", class_="newevent popup", for_="start-%s" % pointstr)
1.102 +
1.103 def select_action(self):
1.104
1.105 "Select the desired action and show the result."