# HG changeset patch # User Katia Saurfelt # Date 1325694074 -3600 # Node ID e225e70239ed61833dbe161ab5caaeb22cea2bcc # Parent b9bb3372b85f92763aeb342c96cef6dff231a85b [views] calendar id in CalendarView must be unique (closes #2143864) diff -r b9bb3372b85f -r e225e70239ed web/views/calendar.py --- a/web/views/calendar.py Tue Jan 03 12:23:57 2012 +0100 +++ b/web/views/calendar.py Wed Jan 04 17:21:14 2012 +0100 @@ -26,7 +26,7 @@ from logilab.mtconverter import xml_escape from logilab.common.date import todatetime -from cubicweb.utils import json_dumps +from cubicweb.utils import json_dumps, make_uid from cubicweb.interfaces import ICalendarable from cubicweb.selectors import implements, adaptable from cubicweb.view import EntityView, EntityAdapter, implements_adapter_compat @@ -198,9 +198,10 @@ self._cw.demote_to_html() self._cw.add_css(('fullcalendar.css', 'cubicweb.calendar.css')) self._cw.add_js(('jquery.ui.js', 'fullcalendar.min.js', 'jquery.qtip.min.js')) + self.calendar_id = 'cal' + make_uid('uid') self.add_onload() # write calendar div to load jquery fullcalendar object - self.w(u'
') + self.w(u'
' % self.calendar_id) def add_onload(self): @@ -220,9 +221,9 @@ // allow to have html tags in event's title $element.find('span.fc-event-title').html($element.find('span.fc-event-title').text()); }; - $("#calendar").fullCalendar(options); + $("#%s").fullCalendar(options); """ #" - self._cw.add_onload(js % json_dumps(fullcalendar_options)) + self._cw.add_onload(js % (json_dumps(fullcalendar_options), self.calendar_id)) def get_events(self):