Exemplo n.º 1
0
class ToolbarLayout(component.Layout):
    # XXX include me in the doc
    __select__ = match_context('ctxtoolbar')

    def render(self, w):
        if self.init_rendering():
            self.cw_extra_kwargs['view'].render_body(w)
Exemplo n.º 2
0
class MainToolbar(component.Layout):
    __select__ = match_context('main-toolbar', )
    cssclass = 'section'

    def render(self, w):
        if self.init_rendering():
            view = self.cw_extra_kwargs['view']
            view.render_body(w)
Exemplo n.º 3
0
class SectionLayout(component.Layout):
    __select__ = match_context('navtop', 'navbottom',
                               'navcontenttop', 'navcontentbottom')
    cssclass = 'section'

    def render(self, w):
        if self.init_rendering():
            view = self.cw_extra_kwargs['view']
            w(u'<div class="%s %s" id="%s">' % (self.cssclass, view.cssclass,
                                                view.domid))
            with wrap_on_write(w, '<h4>') as wow:
                view.render_title(wow)
            view.render_body(w)
            w(u'</div>\n')
Exemplo n.º 4
0
class ContextualBoxLayout(component.Layout):
    __select__ = match_context('incontext', 'left', 'right') & contextual()
    # predefined class in cubicweb.css: contextualBox | contextFreeBox
    cssclass = 'contextualBox'

    def render(self, w):
        if self.init_rendering():
            view = self.cw_extra_kwargs['view']
            w(u'<div class="%s %s" id="%s">' % (self.cssclass, view.cssclass,
                                                view.domid))
            with wrap_on_write(w, u'<div class="boxTitle"><span>',
                               u'</span></div>') as wow:
                view.render_title(wow)
            w(u'<div class="boxBody">')
            view.render_body(w)
            # boxFooter div is a CSS place holder (for shadow for example)
            w(u'</div><div class="boxFooter"></div></div>\n')
Exemplo n.º 5
0
class ContextFreeBoxLayout(ContextualBoxLayout):
    __select__ = match_context('incontext', 'left', 'right') & ~contextual()
    cssclass = 'contextFreeBox'