equal
deleted
inserted
replaced
1 """html calendar views |
1 """html calendar views |
2 |
2 |
3 :organization: Logilab |
3 :organization: Logilab |
4 :copyright: 2001-2008 LOGILAB S.A. (Paris, FRANCE), all rights reserved. |
4 :copyright: 2001-2009 LOGILAB S.A. (Paris, FRANCE), all rights reserved. |
5 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr |
5 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr |
6 """ |
6 """ |
7 |
7 |
8 from logilab.mtconverter import html_escape |
8 from logilab.mtconverter import html_escape |
9 |
9 |
10 from cubicweb.interfaces import ITimetableViews |
10 from cubicweb.interfaces import ITimetableViews |
|
11 from cubicweb.selectors import implements |
11 from cubicweb.common.utils import date_range |
12 from cubicweb.common.utils import date_range |
12 from cubicweb.common.selectors import implement_interface |
|
13 from cubicweb.common.view import AnyRsetView |
13 from cubicweb.common.view import AnyRsetView |
14 |
14 |
15 |
15 |
16 class _TaskEntry(object): |
16 class _TaskEntry(object): |
17 def __init__(self, task, color, column): |
17 def __init__(self, task, color, column): |
23 MIN_COLS = 3 # minimum number of task columns for a single user |
23 MIN_COLS = 3 # minimum number of task columns for a single user |
24 |
24 |
25 class TimeTableView(AnyRsetView): |
25 class TimeTableView(AnyRsetView): |
26 id = 'timetable' |
26 id = 'timetable' |
27 title = _('timetable') |
27 title = _('timetable') |
28 __selectors__ = (implement_interface,) |
28 __selectors__ = implements(ITimetableViews) |
29 accepts_interfaces = (ITimetableViews,) |
|
30 need_navigation = False |
29 need_navigation = False |
31 |
30 |
32 def call(self, title=None): |
31 def call(self, title=None): |
33 """Dumps a timetable from a resultset composed of a note (anything |
32 """Dumps a timetable from a resultset composed of a note (anything |
34 with start/stop) and a user (anything)""" |
33 with start/stop) and a user (anything)""" |