1.1 --- a/actions/EventAggregatorSummary.py Sun Apr 05 00:08:07 2009 +0200
1.2 +++ b/actions/EventAggregatorSummary.py Sun May 17 17:33:11 2009 +0200
1.3 @@ -45,7 +45,15 @@
1.4 month_label = _(EventAggregatorSupport.getMonthLabel(month))
1.5 month_list.append('<option value="%02d">%s</option>' % (month, month_label))
1.6
1.7 - year_label = []
1.8 + descriptions_list = [
1.9 + '<option value="%s">%s</option>' % ("page", _("page")),
1.10 + '<option value="%s">%s</option>' % ("comment", _("comment"))
1.11 + ]
1.12 +
1.13 + format_list = [
1.14 + '<option value="%s">%s</option>' % ("iCalendar", _("iCalendar")),
1.15 + '<option value="%s">%s</option>' % ("RSS", _("RSS 2.0"))
1.16 + ]
1.17
1.18 d = {
1.19 "buttons_html" : buttons_html,
1.20 @@ -56,6 +64,10 @@
1.21 "start_year_default" : "",
1.22 "end_label" : _("End year and month"),
1.23 "end_year_default" : "",
1.24 + "descriptions_label" : _("Use descriptions from..."),
1.25 + "descriptions_list" : "\n".join(descriptions_list),
1.26 + "format_label" : _("Summary format"),
1.27 + "format_list" : "\n".join(format_list),
1.28 }
1.29
1.30 return '''
1.31 @@ -87,6 +99,22 @@
1.32 </td>
1.33 </tr>
1.34 <tr>
1.35 + <td class="label"><label>%(descriptions_label)s</label></td>
1.36 + <td class="content">
1.37 + <select name="descriptions">
1.38 + %(descriptions_list)s
1.39 + </select>
1.40 + </td>
1.41 + </tr>
1.42 + <tr>
1.43 + <td class="label"><label>%(format_label)s</label></td>
1.44 + <td class="content">
1.45 + <select name="format">
1.46 + %(format_list)s
1.47 + </select>
1.48 + </td>
1.49 + </tr>
1.50 + <tr>
1.51 <td></td>
1.52 <td class="buttons">
1.53 %(buttons_html)s
1.54 @@ -140,6 +168,7 @@
1.55
1.56 category_names = request.form.get("category", [])
1.57 format = request.form.get("format", ["iCalendar"])[0]
1.58 + descriptions = request.form.get("descriptions", ["page"])[0]
1.59
1.60 # Otherwise, produce an iCalendar resource.
1.61
1.62 @@ -239,7 +268,16 @@
1.63 request.write('<item>\r\n')
1.64 request.write('<title>%s</title>\r\n' % wikiutil.escape(event_summary))
1.65 request.write('<link>%s</link>\r\n' % link)
1.66 - request.write('<description>%s</description>\r\n' % wikiutil.escape(event_details["last-comment"]))
1.67 +
1.68 + # Write a description according to the preferred source of
1.69 + # descriptions.
1.70 +
1.71 + if descriptions == "page":
1.72 + description = event_details.get("description", "")
1.73 + else:
1.74 + description = event_details["last-comment"]
1.75 +
1.76 + request.write('<description>%s</description>\r\n' % wikiutil.escape(description))
1.77
1.78 for topic in event_details.get("topics") or event_details.get("categories") or []:
1.79 request.write('<category>%s</category>\r\n' % topic)