' % (group, status))
- for label, oid, form in sorted((self.req.__('%s_%s' % (group, o)), o, f)
- for o, f in objects.iteritems()):
- w(u'
')
- w(u'\n' % label)
+
+ # create selection
+ sorted_objects = sorted((self.req.__('%s_%s' % (group, o)), o, f)
+ for o, f in objects.iteritems())
+ for label, oid, form in sorted_objects:
+ w(u'''
')
+ w(u'%s' % (error and 'error' or '', error))
self.form_row_hiddens(w, entity, key)
- w(wdg.edit_render(entity))
- w(u'
\n')
- w(u'
%s
' % wdg.render_help(entity))
- return entity
+ w(wdg.edit_render(entity))
+ w(u''
+ % {'eid':entity.eid, 'value':wdg.current_display_value(entity)})
+ w(u'')
+ w(u'')
+ return entity
def form_row_hiddens(self, w, entity, key):
eid = entity.eid
@@ -481,13 +499,13 @@
w(u'' % (eid_param('pkey', eid), key))
w(u'' % (eid_param('edits-pkey', eid), ''))
-
+
class EpropertiesForm(SystemEpropertiesForm):
id = 'epropertiesform'
title = _('preferences')
- require_groups = ('users', 'managers') # we don't want guests to be able to come here
- __selectors__ = chainfirst(none_rset,
- chainall(one_line_rset, accept_rset)),
+ require_groups = ('users',) # we don't want guests to be able to come here
+ __selectors__ = chainfirst(none_rset,
+ chainall( match_user_group, one_line_rset, accept_rset)),
accepts = ('EUser',)
@classmethod
@@ -512,19 +530,27 @@
def eprops_rset(self):
return self.req.execute('Any P,K,V WHERE P is EProperty, P pkey K, P value V,'
'P for_user U, U eid %(x)s', {'x': self.user.eid})
+# def form_row(self, w, key, splitlabel):
+# print 'user'
+
+class ManagerEpropertiesForm(EpropertiesForm):
+ title = _('preferences')
+ require_groups = ('managers',)
+
def form_row_hiddens(self, w, entity, key):
- super(EpropertiesForm, self).form_row_hiddens(w, entity, key)
+ super(ManagerEpropertiesForm, self).form_row_hiddens(w, entity, key)
# if user is in the managers group and the property is being created,
# we have to set for_user explicitly
- if not entity.has_eid() and self.user.matching_groups('managers'):
+ if not entity.has_eid():
eid = entity.eid
w(u''
% (eid_param('edits-for_user', eid), INTERNAL_FIELD_VALUE))
w(u''
% (eid_param('for_user', eid), self.user.eid))
-
+# def form_row(self, w, key, splitlabel):
+# print 'manager'
class ProcessInformationView(StartupView):