7 __docformat__ = "restructuredtext en" |
7 __docformat__ = "restructuredtext en" |
8 |
8 |
9 from logilab.mtconverter import html_escape |
9 from logilab.mtconverter import html_escape |
10 |
10 |
11 from cubicweb import Unauthorized |
11 from cubicweb import Unauthorized |
|
12 from cubicweb.common.selectors import implements |
12 from cubicweb.web.htmlwidgets import BoxWidget, BoxMenu, RawBoxItem |
13 from cubicweb.web.htmlwidgets import BoxWidget, BoxMenu, RawBoxItem |
|
14 from cubicweb.web.action import Action |
13 from cubicweb.web.box import UserRQLBoxTemplate |
15 from cubicweb.web.box import UserRQLBoxTemplate |
14 from cubicweb.web.views.baseviews import PrimaryView |
16 from cubicweb.web.views.baseviews import PrimaryView |
15 |
17 |
16 |
18 |
|
19 class FollowAction(Action): |
|
20 id = 'follow' |
|
21 __selectors__ = (implements('Bookmark'),) |
|
22 |
|
23 title = _('follow') |
|
24 category = 'mainactions' |
|
25 |
|
26 def url(self): |
|
27 return self.rset.get_entity(self.row or 0, self.col or 0).actual_url() |
|
28 |
|
29 |
17 class BookmarkPrimaryView(PrimaryView): |
30 class BookmarkPrimaryView(PrimaryView): |
18 accepts = ('Bookmark',) |
31 __selectors__ = (implements('Bookmark'),) |
19 |
32 |
20 def cell_call(self, row, col): |
33 def cell_call(self, row, col): |
21 """the primary view for bookmark entity""" |
34 """the primary view for bookmark entity""" |
22 entity = self.complete_entity(row, col) |
35 entity = self.complete_entity(row, col) |
23 self.w(u' ') |
36 self.w(u' ') |