web/views/management.py
branchtls-sprint
changeset 635 305da8d6aa2d
parent 631 99f5852f8604
child 688 cddfbdee0eb3
equal deleted inserted replaced
634:0badd061ce0f 635:305da8d6aa2d
     1 """management and error screens
     1 """management and error screens
     2 
     2 
     3 
     3 
     4 :organization: Logilab
     4 :organization: Logilab
     5 :copyright: 2001-2008 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 
     9 
    10 from logilab.mtconverter import html_escape
    10 from logilab.mtconverter import html_escape
    11 
    11 
    12 from logilab.common.decorators import cached
    12 from logilab.common.decorators import cached
    13 
    13 
       
    14 from cubicweb.selectors import (yes, one_line_rset, none_rset,
       
    15                                 match_user_groups, chainfirst, chainall)
    14 from cubicweb.common.utils import UStringIO
    16 from cubicweb.common.utils import UStringIO
    15 from cubicweb.common.view import AnyRsetView, StartupView, EntityView
    17 from cubicweb.common.view import AnyRsetView, StartupView, EntityView
    16 from cubicweb.common.uilib import html_traceback, rest_traceback
    18 from cubicweb.common.uilib import html_traceback, rest_traceback
    17 from cubicweb.common.selectors import (yes, one_line_rset, match_user_groups,
       
    18                                        accept_rset, none_rset,
       
    19                                        chainfirst, chainall)
       
    20 from cubicweb.web import INTERNAL_FIELD_VALUE, eid_param, stdmsgs
    19 from cubicweb.web import INTERNAL_FIELD_VALUE, eid_param, stdmsgs
    21 from cubicweb.web.widgets import StaticComboBoxWidget
    20 from cubicweb.web.widgets import StaticComboBoxWidget
    22 from cubicweb.web.form import FormMixIn
    21 from cubicweb.web.form import FormMixIn
    23 
    22 
    24 _ = unicode
    23 _ = unicode
   292 
   291 
   293 def css_class(someclass):
   292 def css_class(someclass):
   294     return someclass and 'class="%s"' % someclass or ''
   293     return someclass and 'class="%s"' % someclass or ''
   295 
   294 
   296 class SystemEPropertiesForm(FormMixIn, StartupView):
   295 class SystemEPropertiesForm(FormMixIn, StartupView):
       
   296     id = 'systemepropertiesform'
       
   297     __selectors__ = (none_rset, match_user_groups('managers'),)
       
   298 
       
   299     title = _('site configuration')
   297     controller = 'edit'
   300     controller = 'edit'
   298     id = 'systemepropertiesform'
       
   299     title = _('site configuration')
       
   300     require_groups = ('managers',)
       
   301     category = 'startupview'
   301     category = 'startupview'
   302 
   302 
   303     def linkable(self):
   303     def linkable(self):
   304         return True
   304         return True
   305 
   305 
   505 
   505 
   506 
   506 
   507 
   507 
   508 class ProcessInformationView(StartupView):
   508 class ProcessInformationView(StartupView):
   509     id = 'info'
   509     id = 'info'
       
   510     __selectors__ = (none_rset, match_user_groups('managers'),)
       
   511     
   510     title = _('server information')
   512     title = _('server information')
   511     require_groups = ('managers',)
       
   512 
   513 
   513     def call(self, **kwargs):
   514     def call(self, **kwargs):
   514         """display server information"""
   515         """display server information"""
   515         vcconf = self.config.vc_config()
   516         vcconf = self.config.vc_config()
   516         req = self.req
   517         req = self.req