@presentation.render_for(Board, 'columns')
def render_Board_columns(self, h, comp, *args):
    """Render viewport containing the columns"""
    update_if_version_mismatch = lambda renderer: comp.render(renderer, 'columns') if self.increase_version() else ''

    with h.div(id='viewport-wrapper'):
        with h.div(class_='clearfix', id='viewport'):

            # On cards drag and drop
            action = ajax.Update(action=self.update_card_position, render=update_if_version_mismatch)
            action = '%s;_a;%s=' % (h.add_sessionid_in_url(sep=';'), action._generate_replace(1, h))
            h.head.javascript(h.generate_id(), '''function _send_card_position(data) {
                nagare_getAndEval(%s + YAHOO.lang.JSON.stringify(data));
            }''' - ajax.py2js(action))

            # On columns drag and drop
            action = ajax.Update(action=self.update_column_position, render=update_if_version_mismatch)
            action = '%s;_a;%s=' % (h.add_sessionid_in_url(sep=';'), action._generate_replace(1, h))
            h.head.javascript(h.generate_id(), '''function _send_column_position(data) {
                nagare_getAndEval(%s + YAHOO.lang.JSON.stringify(data));
            }''' % ajax.py2js(action))

            # Create the reload_columns function used when we need to reload
            # the columns from javascript
            reload_board = h.a.action(ajax.Update()).get('onclick').replace('return', "")
            h.head.javascript(h.generate_id(), """function reload_columns(){%s}""" % reload_board)

            increase_version = h.a.action(ajax.Update(render=update_if_version_mismatch))
            h.head.javascript(h.generate_id(), """function increase_version() {%s}""" % increase_version.get('onclick'))

            # Render columns
            with h.div(id='lists'):
                h << h.div(' ', id='dnd-frame')
                for column in self.columns:
                    if column().is_archive and not self.show_archive:
                        continue
                    model = 0 if not security.has_permissions('edit', self) else column.model or 'dnd'
                    h << column.on_answer(self.handle_event, comp).render(h, model)

            # Call columns resize
            h << h.script("YAHOO.kansha.app.columnsResize();YAHOO.kansha.app.refreshCardsCounters();$(window).trigger('reload_search');")
    return h.root
dataset/ETHPy150Open Net-ng/kansha/kansha/board/view.py/render_Board_columns/operator `%` -> `-`