author | Adrien Di Mascio <Adrien.DiMascio@logilab.fr> |
Thu, 19 Feb 2009 21:31:18 +0100 | |
branch | tls-sprint |
changeset 861 | 7985b5db2284 |
parent 822 | e3d8db01f3f5 |
child 984 | 536e421b082b |
permissions | -rw-r--r-- |
0 | 1 |
"""html view for workflow related entities |
2 |
||
3 |
:organization: Logilab |
|
795
63f4f81e19f1
restore appropriate in State's incontext view, moved it into wfentities
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
728
diff
changeset
|
4 |
:copyright: 2001-2009 LOGILAB S.A. (Paris, FRANCE), all rights reserved. |
0 | 5 |
:contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr |
6 |
""" |
|
7 |
__docformat__ = "restructuredtext en" |
|
8 |
||
822 | 9 |
from logilab.mtconverter import html_escape |
10 |
||
688
cddfbdee0eb3
remove all accepts = ('Foo',) declaration and use __selectors__ = implements('Foo') instead
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
11 |
from cubicweb.selectors import implements |
0 | 12 |
from cubicweb.common.view import EntityView |
13 |
||
14 |
class CellView(EntityView): |
|
15 |
id = 'cell' |
|
728
a95b284150d1
first pass to use __select__ instead of __selectors__
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
688
diff
changeset
|
16 |
__select__ = implements('TrInfo') |
688
cddfbdee0eb3
remove all accepts = ('Foo',) declaration and use __selectors__ = implements('Foo') instead
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
17 |
|
0 | 18 |
def cell_call(self, row, col, cellvid=None): |
19 |
entity = self.entity(row, col) |
|
20 |
self.w(entity.printable_value('comment')) |
|
795
63f4f81e19f1
restore appropriate in State's incontext view, moved it into wfentities
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
728
diff
changeset
|
21 |
|
63f4f81e19f1
restore appropriate in State's incontext view, moved it into wfentities
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
728
diff
changeset
|
22 |
|
63f4f81e19f1
restore appropriate in State's incontext view, moved it into wfentities
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
728
diff
changeset
|
23 |
class StateInContextView(EntityView): |
63f4f81e19f1
restore appropriate in State's incontext view, moved it into wfentities
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
728
diff
changeset
|
24 |
"""convenience trick, State's incontext view should not be clickable""" |
63f4f81e19f1
restore appropriate in State's incontext view, moved it into wfentities
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
728
diff
changeset
|
25 |
id = 'incontext' |
63f4f81e19f1
restore appropriate in State's incontext view, moved it into wfentities
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
728
diff
changeset
|
26 |
__select__ = implements('State') |
63f4f81e19f1
restore appropriate in State's incontext view, moved it into wfentities
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
728
diff
changeset
|
27 |
|
63f4f81e19f1
restore appropriate in State's incontext view, moved it into wfentities
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
728
diff
changeset
|
28 |
def cell_call(self, row, col): |
63f4f81e19f1
restore appropriate in State's incontext view, moved it into wfentities
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
728
diff
changeset
|
29 |
self.w(html_escape(self.view('textincontext', self.rset, |
63f4f81e19f1
restore appropriate in State's incontext view, moved it into wfentities
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
728
diff
changeset
|
30 |
row=row, col=col))) |
63f4f81e19f1
restore appropriate in State's incontext view, moved it into wfentities
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
728
diff
changeset
|
31 |