web/views/basecomponents.py
branchstable
changeset 6678 5726677f0ae7
parent 6669 e4532c6acf34
child 6800 3f3d576b87d9
equal deleted inserted replaced
6677:5f105a374ffe 6678:5726677f0ae7
    78     with user'action (preference, logout, etc...)
    78     with user'action (preference, logout, etc...)
    79     """
    79     """
    80     __abstract__ = True
    80     __abstract__ = True
    81     cw_property_defs = component.override_ctx(
    81     cw_property_defs = component.override_ctx(
    82         component.CtxComponent,
    82         component.CtxComponent,
    83         vocabulary=['header-left', 'header-center', 'header-right'])
    83         vocabulary=['header-left', 'header-right'])
    84     # don't want user to hide this component using an cwproperty
    84     # don't want user to hide this component using an cwproperty
    85     site_wide = True
    85     site_wide = True
    86     context = _('header-center')
    86     context = _('header-left')
    87 
    87 
    88 
    88 
    89 class ApplLogo(HeaderComponent):
    89 class ApplLogo(HeaderComponent):
    90     """build the instance logo, usually displayed in the header"""
    90     """build the instance logo, usually displayed in the header"""
    91     __regid__ = 'logo'
    91     __regid__ = 'logo'
    92     order = -1
    92     order = -1
    93     context = _('header-left')
       
    94 
    93 
    95     def render(self, w):
    94     def render(self, w):
    96         w(u'<a href="%s"><img id="logo" src="%s" alt="logo"/></a>'
    95         w(u'<a href="%s"><img id="logo" src="%s" alt="logo"/></a>'
    97           % (self._cw.base_url(), self._cw.uiprops['LOGO']))
    96           % (self._cw.base_url(), self._cw.uiprops['LOGO']))
    98 
    97 
    99 
    98 
   100 class ApplicationName(HeaderComponent):
    99 class ApplicationName(HeaderComponent):
   101     """display the instance name"""
   100     """display the instance name"""
   102     __regid__ = 'appliname'
   101     __regid__ = 'appliname'
   103     context = _('header-center')
       
   104 
   102 
   105     def render(self, w):
   103     def render(self, w):
   106         title = self._cw.property_value('ui.site-title')
   104         title = self._cw.property_value('ui.site-title')
   107         if title:
   105         if title:
   108             w(u'<span id="appliName"><a href="%s">%s</a></span>' % (
   106             w(u'<span id="appliName"><a href="%s">%s</a></span>' % (