web/views/basecomponents.py
branchstable
changeset 1968 d3de0f44b57b
parent 1937 fc702ea02b25
child 1977 606923dff11b
equal deleted inserted replaced
1967:28eed65ce1e6 1968:d3de0f44b57b
    18 from cubicweb.web import component
    18 from cubicweb.web import component
    19 from cubicweb.web.htmlwidgets import (MenuWidget, PopupBoxMenu, BoxSeparator,
    19 from cubicweb.web.htmlwidgets import (MenuWidget, PopupBoxMenu, BoxSeparator,
    20                                       BoxLink)
    20                                       BoxLink)
    21 
    21 
    22 VISIBLE_PROP_DEF = {
    22 VISIBLE_PROP_DEF = {
    23     _('visible'):  dict(type='Boolean', default=False,
    23     _('visible'):  dict(type='Boolean', default=True,
    24                         help=_('display the component or not')),
    24                         help=_('display the component or not')),
    25     }
    25     }
    26 
    26 
    27 class RQLInputForm(component.Component):
    27 class RQLInputForm(component.Component):
    28     """build the rql input form, usually displayed in the header"""
    28     """build the rql input form, usually displayed in the header"""
   123     """display application's messages given using the __message parameter
   123     """display application's messages given using the __message parameter
   124     into a special div section
   124     into a special div section
   125     """
   125     """
   126     __select__ = yes()
   126     __select__ = yes()
   127     id = 'applmessages'
   127     id = 'applmessages'
   128     property_defs = VISIBLE_PROP_DEF
   128     # don't want user to hide this component using an cwproperty
   129     # don't want user to hide this component using an cwproperty
   129     property_defs = {}
   130     site_wide = True
       
   131 
   130 
   132     def call(self):
   131     def call(self):
   133         msgs = [msg for msg in (self.req.get_shared_data('sources_error', pop=True),
   132         msgs = [msg for msg in (self.req.get_shared_data('sources_error', pop=True),
   134                                 self.req.message) if msg]
   133                                 self.req.message) if msg]
   135         self.w(u'<div id="appMsg" onclick="%s" class="%s">\n' %
   134         self.w(u'<div id="appMsg" onclick="%s" class="%s">\n' %