fix events display in calendar (closes #2167866) stable
authorKatia Saurfelt <katia.saurfelt@logilab.fr>
Thu, 01 Mar 2012 15:00:58 +0100
branchstable
changeset 8290 d07dadd8f664
parent 8289 c17d855bd95b
child 8291 f559ab9602e7
fix events display in calendar (closes #2167866)
web/views/calendar.py
--- a/web/views/calendar.py	Thu Mar 01 14:32:42 2012 +0100
+++ b/web/views/calendar.py	Thu Mar 01 15:00:58 2012 +0100
@@ -197,6 +197,8 @@
         self.w(u'<div id="%s"></div>' % self.calendar_id)
 
     def add_onload(self):
+        fullcalendar_options = self.fullcalendar_options.copy()
+        fullcalendar_options['events'] = self.get_events()
         # i18n
         self._cw.add_js('fullcalendar.locale.js')
         # js callback to add a tooltip and to put html in event's title
@@ -211,8 +213,7 @@
         };
         $("#%s").fullCalendar(options);
         """ #"
-        self._cw.add_onload(js % (self._cw.lang, json_dumps(self.fullcalendar_options), self.calendar_id))
-
+        self._cw.add_onload(js % (self._cw.lang, json_dumps(fullcalendar_options), self.calendar_id))
 
     def get_events(self):
         events = []