Пример #1
0
    def render(self, attrs={}):
        final_attrs = {
            'class': ['navbar', 'navbar-fixed-top'],
        }
        final_attrs = AttrDict(final_attrs, mergers=['class'])
        final_attrs.update(attrs)
        html = [
            u'<div%s>'%unicode(final_attrs),
            u'<div class="navbar-inner">',
            u'<div class="container">',
        ]

        if self.brand:
            html.extend([
                u'<a class="brand" href="/">%s</a>'%unicode(self.brand),
            ])

        for name in self.navs.iterkeys():
            html.append(self[name].render())

        html.extend([
            u'</div>',
            u'</div>',
            u'</div>',
        ])
        return mark_safe(u'\n'.join(html))
Пример #2
0
 def trigger_as_submit(self, attrs={}):
     final_attrs = AttrDict(
         {
             "type": "submit",
             "class": "dialogs-%s" % self._type,
             "name": self.name,
             # 'target': self.name,
             "value": self.trigger_name,
         },
         mergers=("class",),
     )
     final_attrs.update(attrs)
     # final_attrs.merge(merge_attrs)
     return mark_safe(u'<input%s"></input>' % unicode(final_attrs))
Пример #3
0
    def render(self, attrs={}):
        final_attrs = {
            'class': ['nav'],
        }
        final_attrs = AttrDict(final_attrs, mergers=['class'])
        final_attrs.update(attrs)
        final_attrs.update({
            'class': 'pull-left' if (self.nav.align == 'left') else 'pull-right'
        })
        html = [
            u'<ul%s>'%unicode(final_attrs),
        ]

        for name in self.nav.entries.iterkeys():
            html.append(self[name].render())

        html.append(u'</ul>')
        return mark_safe(u'\n'.join(html))