equal
deleted
inserted
replaced
24 from logilab.mtconverter import xml_escape |
24 from logilab.mtconverter import xml_escape |
25 |
25 |
26 from logilab.common.decorators import cached |
26 from logilab.common.decorators import cached |
27 |
27 |
28 from cubicweb import UnknownProperty |
28 from cubicweb import UnknownProperty |
29 from cubicweb.selectors import (one_line_rset, none_rset, implements, |
29 from cubicweb.selectors import (one_line_rset, none_rset, is_instance, |
30 match_user_groups, objectify_selector, |
30 match_user_groups, objectify_selector, |
31 logged_user_in_rset) |
31 logged_user_in_rset) |
32 from cubicweb.view import StartupView |
32 from cubicweb.view import StartupView |
33 from cubicweb.web import uicfg, stdmsgs |
33 from cubicweb.web import uicfg, stdmsgs |
34 from cubicweb.web.form import FormViewMixIn |
34 from cubicweb.web.form import FormViewMixIn |
72 def css_class(someclass): |
72 def css_class(someclass): |
73 return someclass and 'class="%s"' % someclass or '' |
73 return someclass and 'class="%s"' % someclass or '' |
74 |
74 |
75 |
75 |
76 class CWPropertyPrimaryView(primary.PrimaryView): |
76 class CWPropertyPrimaryView(primary.PrimaryView): |
77 __select__ = implements('CWProperty') |
77 __select__ = is_instance('CWProperty') |
78 skip_none = False |
78 skip_none = False |
79 |
79 |
80 |
80 |
81 class SystemCWPropertiesForm(FormViewMixIn, StartupView): |
81 class SystemCWPropertiesForm(FormViewMixIn, StartupView): |
82 """site-wide properties edition form""" |
82 """site-wide properties edition form""" |
241 """user's preferences properties edition form""" |
241 """user's preferences properties edition form""" |
242 __regid__ = 'propertiesform' |
242 __regid__ = 'propertiesform' |
243 __select__ = ( |
243 __select__ = ( |
244 (none_rset() & match_user_groups('users','managers')) |
244 (none_rset() & match_user_groups('users','managers')) |
245 | (one_line_rset() & match_user_groups('users') & logged_user_in_rset()) |
245 | (one_line_rset() & match_user_groups('users') & logged_user_in_rset()) |
246 | (one_line_rset() & match_user_groups('managers') & implements('CWUser')) |
246 | (one_line_rset() & match_user_groups('managers') & is_instance('CWUser')) |
247 ) |
247 ) |
248 |
248 |
249 title = _('preferences') |
249 title = _('preferences') |
250 |
250 |
251 @property |
251 @property |
395 w(u'%s\n' % button.render(form)) |
395 w(u'%s\n' % button.render(form)) |
396 w(u'</div>') |
396 w(u'</div>') |
397 |
397 |
398 |
398 |
399 class CWPropertyIEditControlAdapter(editcontroller.IEditControlAdapter): |
399 class CWPropertyIEditControlAdapter(editcontroller.IEditControlAdapter): |
400 __select__ = implements('CWProperty') |
400 __select__ = is_instance('CWProperty') |
401 |
401 |
402 def after_deletion_path(self): |
402 def after_deletion_path(self): |
403 """return (path, parameters) which should be used as redirect |
403 """return (path, parameters) which should be used as redirect |
404 information when this entity is being deleted |
404 information when this entity is being deleted |
405 """ |
405 """ |