

@presentation.render_for(UserCards)
def render(self, h, comp, *args):
    h.head.css_url('css/themes/home.css')
    h.head.css_url('css/themes/board.css')
    h.head.css_url(('css/themes/%s/home.css' % self.theme))
    h.head.css_url(('css/themes/%s/board.css' % self.theme))
    with h.div(class_='row', id_='lists'):
        for (i, (main_group, cards)) in enumerate(groupby(self.cards, key=self.KEYS[self.order_by[0]][1])):
            if ((i % 4) == 0):
                (h << h.br)
            subgroup = None
            sg_title = self.KEYS[self.order_by[1]][1]
            with h.div(class_='span-auto list'):
                with h.div(class_='list-header'):
                    with h.div(class_='list-title'):
                        with h.div(class_='title'):
                            if isinstance(main_group, tuple):
                                (title, id_) = main_group
                                with h.a.action(comp.answer, id_):
                                    (h << title)
                            else:
                                (h << (unicode(main_group) if main_group else i18n._('n.c.')))
                with h.div(class_='list-body'):
                    for card in cards:
                        if (subgroup != sg_title(card)):
                            subgroup = sg_title(card)
                            (h << h.h4(subgroup))
                        with h.div:
                            (h << {
                                'onclick': ("window.location.href='%s#id_%s'" % (self.data.column.board.url, self.id)),
                            })
                            (h << card.render(h, 'readonly'))
                (h << h.div(class_='list-footer hidden'))
    return h.root

dataset/ETHPy150Open Net-ng/kansha/kansha/user/user_cards.py render/original