1.1 --- a/actions/EventAggregatorNewEvent.py Fri Oct 30 20:36:04 2009 +0100
1.2 +++ b/actions/EventAggregatorNewEvent.py Sat Oct 31 01:24:06 2009 +0100
1.3 @@ -82,7 +82,7 @@
1.4 "start_label" : _("Start date (day, month, year)"),
1.5 "start_day_default" : form.get("start-day", [""])[0],
1.6 "start_year_default" : form.get("start-year", [""])[0] or EventAggregatorSupport.getCurrentYear(),
1.7 - "end_label" : _("End date (day, month, year)"),
1.8 + "end_label" : _("End date (day, month, year) - if different"),
1.9 "end_day_default" : form.get("end-day", [""])[0],
1.10 "end_year_default" : form.get("end-year", [""])[0],
1.11 "title_label" : _("Event title/summary"),
1.12 @@ -91,6 +91,8 @@
1.13 "description_default" : form.get("description", [""])[0],
1.14 "template_label" : _("Event template"),
1.15 "template_default" : form.get("template", [""])[0] or template_default,
1.16 + "parent_label" : _("Parent page"),
1.17 + "parent_default" : form.get("parent", [""])[0],
1.18 }
1.19
1.20 return '''
1.21 @@ -142,6 +144,12 @@
1.22 </td>
1.23 </tr>
1.24 <tr>
1.25 + <td class="label"><label>%(parent_label)s</label></td>
1.26 + <td>
1.27 + <input name="parent" type="text" size="40" value="%(parent_default)s" />
1.28 + </td>
1.29 + </tr>
1.30 + <tr>
1.31 <td></td>
1.32 <td class="buttons">
1.33 %(buttons_html)s
1.34 @@ -193,6 +201,7 @@
1.35 try:
1.36 title = form["title"][0]
1.37 template = form["template"][0]
1.38 + parent = form["parent"][0]
1.39
1.40 start_day = self._get_input(form, "start-day", 0)
1.41 start_month = self._get_input(form, "start-month", 0)
1.42 @@ -222,6 +231,11 @@
1.43
1.44 body = page.get_raw_body()
1.45
1.46 + # Use any parent page information.
1.47 +
1.48 + if parent:
1.49 + title = "%s/%s" % (parent.rstrip("/"), title)
1.50 +
1.51 # Load the new page and replace the event details in the body.
1.52
1.53 new_page = PageEditor(request, title)