Exemple #1
0
    def test_grid(self):
        self.assertEqual(
            markup.grid('bar', 60, 'l'),
            '<div class="ym-g60 ym-gl">\nbar</div>\n'
            )

        self.assertEqual(
            markup.grid('foo', '25'),
            '<div class="ym-g25">\nfoo</div>\n'
            )
Exemple #2
0
    def render_html(self):
        html_left_col = markup.img(self.image.src)
        html_left_col += markup.p(self.image.desc, 'beschriftung')
        html_left_col = markup.grid(
                    markup.gbox(
                        markup.section(html_left_col, 'box lila')
                        )
                    , 50, 'l'
                    )
        html_infos = ''
        for info in self.infos:
            html_infos += info.render_html()

        html_right_col = markup.section(html_infos, 'box info')
        html_right_col = markup.grid( markup.gbox( html_right_col ), 50, 'r')
        return markup.grid_main(html_left_col + html_right_col)
Exemple #3
0
 def render_html(self):
     html = ''
     for i, size in enumerate(self.layout):
         inside = ''
         img = self.images[i]
         size = self.layout[i]
         side = 'l'
         if i == (len(self.layout)-1):
             side = 'r'
         inside += img.render_html()
         inside = markup.grid( markup.gbox( inside ), size,  side)
         html += inside
     return markup.grid_main( html )