web/views/basecomponents.py
branch3.5
changeset 3002 a9d7eaa07475
parent 2937 36b11249014e
parent 2996 866a2c135c33
child 3023 7864fee8b4ec
child 3037 45de36c7d47c
equal deleted inserted replaced
2993:2d06451013ac 3002:a9d7eaa07475
    72 class ApplHelp(component.Component):
    72 class ApplHelp(component.Component):
    73     """build the help button, usually displayed in the header"""
    73     """build the help button, usually displayed in the header"""
    74     id = 'help'
    74     id = 'help'
    75     property_defs = VISIBLE_PROP_DEF
    75     property_defs = VISIBLE_PROP_DEF
    76     def call(self):
    76     def call(self):
    77         self.w(u'<a href="%s" class="help" title="%s">&nbsp;</a>'
    77         self.w(u'<a href="%s" class="help" title="%s">&#160;</a>'
    78                % (self.build_url(_restpath='doc/main'),
    78                % (self.build_url(_restpath='doc/main'),
    79                   self.req._(u'help'),))
    79                   self.req._(u'help'),))
    80 
    80 
    81 
    81 
    82 class UserLink(component.Component):
    82 class UserLink(component.Component):
   108             self.anon_user_link()
   108             self.anon_user_link()
   109 
   109 
   110     def anon_user_link(self):
   110     def anon_user_link(self):
   111         if self.config['auth-mode'] == 'cookie':
   111         if self.config['auth-mode'] == 'cookie':
   112             self.w(self.req._('anonymous'))
   112             self.w(self.req._('anonymous'))
   113             self.w(u'''&nbsp;[<a class="logout" href="javascript: popupLoginBox();">%s</a>]'''
   113             self.w(u'''&#160;[<a class="logout" href="javascript: popupLoginBox();">%s</a>]'''
   114                    % (self.req._('i18n_login_popup')))
   114                    % (self.req._('i18n_login_popup')))
   115         else:
   115         else:
   116             self.w(self.req._('anonymous'))
   116             self.w(self.req._('anonymous'))
   117             self.w(u'&nbsp;[<a class="logout" href="%s">%s</a>]'
   117             self.w(u'&#160;[<a class="logout" href="%s">%s</a>]'
   118                    % (self.build_url('login'), self.req._('login')))
   118                    % (self.build_url('login'), self.req._('login')))
   119 
   119 
   120 
   120 
   121 class ApplicationMessage(component.Component):
   121 class ApplicationMessage(component.Component):
   122     """display messages given using the __message parameter into a special div
   122     """display messages given using the __message parameter into a special div
   210             url = self.build_url(rql=restrrql)
   210             url = self.build_url(rql=restrrql)
   211             html.insert(0, u'<span><a href="%s">%s</a></span>' % (
   211             html.insert(0, u'<span><a href="%s">%s</a></span>' % (
   212                     url, _('Any')))
   212                     url, _('Any')))
   213         else:
   213         else:
   214             html.insert(0, u'<span class="selected">%s</span>' % _('Any'))
   214             html.insert(0, u'<span class="selected">%s</span>' % _('Any'))
   215         self.w(u'&nbsp;|&nbsp;'.join(html))
   215         self.w(u'&#160;|&#160;'.join(html))
   216         self.w(u'</div>')
   216         self.w(u'</div>')
   217 
   217 
   218 class PdfViewComponent(component.Component):
   218 class PdfViewComponent(component.Component):
   219     id = 'pdfview'
   219     id = 'pdfview'
   220     __select__ = yes()
   220     __select__ = yes()