web/views/management.py
branchtls-sprint
changeset 1641 2c80b09d8d86
parent 1569 99a19875ef1e
parent 1618 70c0c84e1c25
child 1806 e94b65445826
equal deleted inserted replaced
1640:65b60f177eb1 1641:2c80b09d8d86
     4 :organization: Logilab
     4 :organization: Logilab
     5 :copyright: 2001-2009 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
     5 :copyright: 2001-2009 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
     6 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
     6 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
     7 """
     7 """
     8 __docformat__ = "restructuredtext en"
     8 __docformat__ = "restructuredtext en"
       
     9 _ = unicode
     9 
    10 
    10 from logilab.mtconverter import html_escape
    11 from logilab.mtconverter import html_escape
    11 
    12 
    12 from cubicweb.selectors import yes, none_rset, match_user_groups
    13 from cubicweb.selectors import yes, none_rset, match_user_groups
    13 from cubicweb.view import AnyRsetView, StartupView, EntityView
    14 from cubicweb.view import AnyRsetView, StartupView, EntityView
    14 from cubicweb.common.uilib import html_traceback, rest_traceback
    15 from cubicweb.common.uilib import html_traceback, rest_traceback
    15 from cubicweb.web import formwidgets
    16 from cubicweb.web import formwidgets
    16 from cubicweb.web.form import FieldsForm, EntityFieldsForm
    17 from cubicweb.web.form import FieldsForm, EntityFieldsForm
    17 from cubicweb.web.formfields import guess_field
    18 from cubicweb.web.formfields import guess_field
    18 from cubicweb.web.formrenderers import HTableFormRenderer
    19 from cubicweb.web.formrenderers import HTableFormRenderer
    19 
       
    20 _ = unicode
       
    21 
    20 
    22 SUBMIT_MSGID = _('Submit bug report')
    21 SUBMIT_MSGID = _('Submit bug report')
    23 MAIL_SUBMIT_MSGID = _('Submit bug report by mail')
    22 MAIL_SUBMIT_MSGID = _('Submit bug report by mail')
    24 
    23 
    25 class SecurityViewMixIn(object):
    24 class SecurityViewMixIn(object):
    28         w = self.w
    27         w = self.w
    29         _ = self.req._
    28         _ = self.req._
    30         if not access_types:
    29         if not access_types:
    31             access_types = eschema.ACTIONS
    30             access_types = eschema.ACTIONS
    32         w(u'<table class="schemaInfo">')
    31         w(u'<table class="schemaInfo">')
    33         w(u'<tr><th>%s</th><th>%s</th><th>%s</th></tr>' % ( 
    32         w(u'<tr><th>%s</th><th>%s</th><th>%s</th></tr>' % (
    34             _("permission"), _('granted to groups'), _('rql expressions')))
    33             _("permission"), _('granted to groups'), _('rql expressions')))
    35         for access_type in access_types:
    34         for access_type in access_types:
    36             w(u'<tr>')
    35             w(u'<tr>')
    37             w(u'<td>%s</td>' % _('%s_perm' % access_type))
    36             w(u'<td>%s</td>' % _('%s_perm' % access_type))
    38             groups = eschema.get_groups(access_type)
    37             groups = eschema.get_groups(access_type)
   269     binfo += u'\n\n:CubicWeb version: %s\n'  % (eversion,)
   268     binfo += u'\n\n:CubicWeb version: %s\n'  % (eversion,)
   270     for pkg, pkgversion in cubes:
   269     for pkg, pkgversion in cubes:
   271         binfo += u":Package %s version: %s\n" % (pkg, pkgversion)
   270         binfo += u":Package %s version: %s\n" % (pkg, pkgversion)
   272     binfo += '\n'
   271     binfo += '\n'
   273     return binfo
   272     return binfo
   274 
       
   275 
   273 
   276 class ProcessInformationView(StartupView):
   274 class ProcessInformationView(StartupView):
   277     id = 'info'
   275     id = 'info'
   278     __select__ = none_rset() & match_user_groups('managers')
   276     __select__ = none_rset() & match_user_groups('managers')
   279 
   277