web/views/calendar.py
branchstable
changeset 8295 302dcb3c6858
parent 8290 d07dadd8f664
child 8307 8be58694f416
equal deleted inserted replaced
8294:73c9f22064b3 8295:302dcb3c6858
   188         }
   188         }
   189 
   189 
   190     def call(self):
   190     def call(self):
   191         self._cw.demote_to_html()
   191         self._cw.demote_to_html()
   192         self._cw.add_css(('fullcalendar.css', 'cubicweb.calendar.css'))
   192         self._cw.add_css(('fullcalendar.css', 'cubicweb.calendar.css'))
   193         self._cw.add_js(('jquery.ui.js', 'fullcalendar.min.js', 'jquery.qtip.min.js'))
   193         self._cw.add_js(('jquery.ui.js', 'fullcalendar.min.js', 'jquery.qtip.min.js', 'fullcalendar.locale.js'))
   194         self.calendar_id = 'cal' + make_uid('uid')
   194         self.calendar_id = 'cal' + make_uid('uid')
   195         self.add_onload()
   195         self.add_onload()
   196         # write calendar div to load jquery fullcalendar object
   196         # write calendar div to load jquery fullcalendar object
   197         self.w(u'<div id="%s"></div>' % self.calendar_id)
   197         self.w(u'<div id="%s"></div>' % self.calendar_id)
   198 
   198 
   199     def add_onload(self):
   199     def add_onload(self):
   200         fullcalendar_options = self.fullcalendar_options.copy()
   200         fullcalendar_options = self.fullcalendar_options.copy()
   201         fullcalendar_options['events'] = self.get_events()
   201         fullcalendar_options['events'] = self.get_events()
   202         # i18n
   202         # i18n
   203         self._cw.add_js('fullcalendar.locale.js')
       
   204         # js callback to add a tooltip and to put html in event's title
   203         # js callback to add a tooltip and to put html in event's title
   205         js = """
   204         js = """
   206         var options = $.fullCalendar.regional('%s', %s);
   205         var options = $.fullCalendar.regional('%s', %s);
   207         options.eventRender = function(event, $element) {
   206         options.eventRender = function(event, $element) {
   208           // add a tooltip for each event
   207           // add a tooltip for each event