web/views/bookmark.py
branchstable
changeset 3718 ae49707df724
parent 3247 a6243d9585ba
child 3720 5376aaadd16b
child 4212 ab6573088b4a
equal deleted inserted replaced
3717:a0cb4ed395f4 3718:ae49707df724
     8 __docformat__ = "restructuredtext en"
     8 __docformat__ = "restructuredtext en"
     9 
     9 
    10 from logilab.mtconverter import xml_escape
    10 from logilab.mtconverter import xml_escape
    11 
    11 
    12 from cubicweb import Unauthorized
    12 from cubicweb import Unauthorized
    13 from cubicweb.selectors import implements
    13 from cubicweb.selectors import implements, one_line_rset
    14 from cubicweb.web.htmlwidgets import BoxWidget, BoxMenu, RawBoxItem
    14 from cubicweb.web.htmlwidgets import BoxWidget, BoxMenu, RawBoxItem
    15 from cubicweb.web import action, box, uicfg
    15 from cubicweb.web import action, box, uicfg
    16 from cubicweb.web.views import primary
    16 from cubicweb.web.views import primary
    17 
    17 
    18 _abaa = uicfg.actionbox_appearsin_addmenu
    18 _abaa = uicfg.actionbox_appearsin_addmenu
    19 _abaa.tag_subject_of(('*', 'bookmarked_by', '*'), False)
    19 _abaa.tag_subject_of(('*', 'bookmarked_by', '*'), False)
    20 _abaa.tag_object_of(('*', 'bookmarked_by', '*'), False)
    20 _abaa.tag_object_of(('*', 'bookmarked_by', '*'), False)
    21 
    21 
    22 class FollowAction(action.Action):
    22 class FollowAction(action.Action):
    23     id = 'follow'
    23     id = 'follow'
    24     __select__ = implements('Bookmark')
    24     __select__ = one_line_rset() & implements('Bookmark')
    25 
    25 
    26     title = _('follow')
    26     title = _('follow')
    27     category = 'mainactions'
    27     category = 'mainactions'
    28 
    28 
    29     def url(self):
    29     def url(self):