@presentation.render_for(Board, 'switch')
def render_Board_item(self, h, comp, *args):
    reload_search = ajax.Update(component_to_update='show_results',
                                render=lambda renderer: comp.render(renderer, 'search_results'))
    h << h.script(u'''$(window).on('reload_search', function() { %s; })''' % reload_search.generate_action(41, h))

    with h.div(id='switch_zone'):
        if self.model == 'columns':
            search_cb = ajax.Update(
                action=self.search,
                component_to_update='show_results',
                render=lambda renderer: comp.render(renderer, 'search_results')
            ).generate_action(1, h).replace('this', 'elt')
            oninput = 'debounce(this, function(elt) { %s; }, 500)' % search_cb
            with h.div(id_='show_results'):
                h << comp.render(h, 'num_matches')
            if self.card_matches:
                if None in self.card_matches:
                    klass = 'nomatches'
                else:
                    klass = 'highlight'
            else:
                klass = ''
            h << h.input(type='text', id_='search', placeholder=_(u'search'),
                         value=self.last_search,
                         oninput=oninput,
                         class_=klass)
            #h << h.a(h.i(class_='icon-search', title=_('search')), class_='btn unselected')
            h << h.SyncRenderer().a(h.i(class_='icon-calendar'), title=_('Calendar mode'), class_='btn unselected').action(self.switch_view)
            h << h.SyncRenderer().a(h.i(class_='icon-list'), title=_('Board mode'), class_='btn disabled')
        else:
            h << h.SyncRenderer().a(h.i(class_='icon-calendar'), title=_('Calendar mode'), class_='btn disabled')
            h << h.SyncRenderer().a(h.i(class_='icon-list'), title=_('Board mode'), class_='btn unselected').action(self.switch_view)

    return h.root
dataset/ETHPy150Open Net-ng/kansha/kansha/board/view.py/render_Board_item/original