1.1 --- a/htdocs/styles.css Thu Jan 29 22:55:29 2015 +0100
1.2 +++ b/htdocs/styles.css Thu Jan 29 23:31:18 2015 +0100
1.3 @@ -48,3 +48,31 @@
1.4 td.event a {
1.5 color: #009;
1.6 }
1.7 +
1.8 +input.newevent {
1.9 + display: none;
1.10 +}
1.11 +
1.12 +.container {
1.13 + position: relative;
1.14 +}
1.15 +
1.16 +.popup {
1.17 + display: none;
1.18 + position: absolute;
1.19 + top: 0;
1.20 + left: 0;
1.21 +}
1.22 +
1.23 +.container:hover .popup,
1.24 +.container:focus .popup {
1.25 + display: block;
1.26 + border: 1px solid #000;
1.27 + padding: 4px;
1.28 + background-color: #fff;
1.29 +}
1.30 +
1.31 +input.newevent:checked ~ .timepoint {
1.32 + background-color: #af8;
1.33 + text-decoration: underline;
1.34 +}
2.1 --- a/imip_manager.py Thu Jan 29 22:55:29 2015 +0100
2.2 +++ b/imip_manager.py Thu Jan 29 23:31:18 2015 +0100
2.3 @@ -490,8 +490,6 @@
2.4
2.5 self.page.div(id="participants")
2.6
2.7 - self.page.form(method="POST")
2.8 -
2.9 self.page.p("Participants for scheduling:")
2.10
2.11 for i, participant in enumerate(participants):
2.12 @@ -505,8 +503,6 @@
2.13 self.page.input(name="add-participant", type="submit", value="Add")
2.14 self.page.p.close()
2.15
2.16 - self.page.form.close()
2.17 -
2.18 self.page.div.close()
2.19
2.20 return participants
2.21 @@ -544,9 +540,19 @@
2.22 self.new_page(title="Calendar")
2.23 page = self.page
2.24
2.25 + # Form controls are used in various places on the calendar page.
2.26 +
2.27 + page.form(method="POST")
2.28 +
2.29 self.show_requests_on_page()
2.30 participants = self.show_participants_on_page()
2.31
2.32 + # Show a button for scheduling a new event.
2.33 +
2.34 + page.p()
2.35 + page.input(name="newevent", type="submit", value="New event", id="newevent")
2.36 + page.p.close()
2.37 +
2.38 freebusy = self.store.get_freebusy(self.user)
2.39
2.40 if not freebusy:
2.41 @@ -655,6 +661,10 @@
2.42 self.show_calendar_days(days, partitioned_groups, partitioned_group_types, group_columns)
2.43 page.table.close()
2.44
2.45 + # End the form region.
2.46 +
2.47 + page.form.close()
2.48 +
2.49 def show_calendar_participant_headings(self, group_types, group_sources, group_columns):
2.50
2.51 """
2.52 @@ -740,7 +750,8 @@
2.53
2.54 page.tr()
2.55 page.th(class_="timeslot")
2.56 - page.add(self.format_time(point, "long"))
2.57 + self._time_point(point)
2.58 + page.span(self.format_time(point, "long"), class_="timepoint")
2.59 page.th.close()
2.60
2.61 # Obtain slots for the time point from each group.
2.62 @@ -753,7 +764,9 @@
2.63 # the colspan is adjusted to be 1, not 0.
2.64
2.65 if not active:
2.66 - page.td("", class_="empty", colspan=max(columns, 1))
2.67 + page.td(class_="empty container", colspan=max(columns, 1))
2.68 + self._empty_slot(point)
2.69 + page.td.close()
2.70 continue
2.71
2.72 slots = slots.items()
2.73 @@ -806,17 +819,30 @@
2.74
2.75 page.td.close()
2.76 else:
2.77 - page.td("", class_="empty")
2.78 + page.td(class_="empty container")
2.79 + self._empty_slot(point)
2.80 + page.td.close()
2.81
2.82 # Pad with empty columns.
2.83
2.84 i = columns - len(active)
2.85 while i > 0:
2.86 i -= 1
2.87 - page.td("", class_="empty")
2.88 + page.td(class_="empty container")
2.89 + self._empty_slot(point)
2.90 + page.td.close()
2.91
2.92 page.tr.close()
2.93
2.94 + def _time_point(self, point):
2.95 + pointstr = format_datetime(point)
2.96 + self.page.input(name="start", type="radio", value=pointstr, id="start-%s" % pointstr, class_="newevent")
2.97 +
2.98 + def _empty_slot(self, point):
2.99 + page = self.page
2.100 + pointstr = format_datetime(point)
2.101 + page.label("Start a new event at this time", class_="newevent popup", for_="start-%s" % pointstr)
2.102 +
2.103 def select_action(self):
2.104
2.105 "Select the desired action and show the result."