@presentation.render_for(BoardDescription)
def render_BoardDescription(self, h, comp, *args):
    """Render description component in edit mode"""
    h << h.h2(_(u'Edit board description'))
    with h.form(class_='description-form'):
        txt_id, btn_id = h.generate_id(), h.generate_id()
        h << h.label(_(u'Description'), for_=txt_id)
        h << h.textarea(self.description(), id_=txt_id).action(self.description)
        with h.div(class_='buttons'):
            h << h.button(_('Save'), class_='btn btn-primary', id=btn_id).action(self.commit, comp)
            h << ' '
            h << h.a(_('Cancel'), class_='btn').action(self.cancel, comp)

        h.head.javascript(
            h.generate_id(),
            'YAHOO.kansha.app.addCtrlEnterHandler(%s, %s)' % (
                ajax.py2js(txt_id), ajax.py2js(btn_id)
            )
        )

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