web/views/bookmark.py
changeset 4306 01e5efc0d823
parent 4252 6c4f109c2b03
child 4309 bdac9e9e76cd
equal deleted inserted replaced
4305:3d731478d9a8 4306:01e5efc0d823
    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, one_line_rset
    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, formwidgets as fw
    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 
       
    22 _afs = uicfg.autoform_section
       
    23 _afs.tag_object_of(('*', 'bookmarked_by', 'CWUser'), 'main', 'metadata')
       
    24 _afs.tag_attribute(('Bookmark', 'path'), 'main', 'attributes')
       
    25 _afs.tag_attribute(('Bookmark', 'path'), 'muledit', 'attributes')
       
    26 
       
    27 _affk = uicfg.autoform_field_kwargs
       
    28 _affk.tag_attribute(('Bookmark', 'path'), {'widget': fw.URLUnescapedInput})
       
    29 
    21 
    30 
    22 class FollowAction(action.Action):
    31 class FollowAction(action.Action):
    23     __regid__ = 'follow'
    32     __regid__ = 'follow'
    24     __select__ = one_line_rset() & implements('Bookmark')
    33     __select__ = one_line_rset() & implements('Bookmark')
    25 
    34