

@presentation.render_for(BoardProfile)
def render_BoardProfile(self, h, comp, *args):
    'Render the board profile form'
    if security.has_permissions('manage', self.board):
        with h.div(class_='panel-section'):
            (h << h.div(_('Card Visibility'), class_='panel-section-title'))
            (h << h.p(_('Choose whether the board is private or public.')))
            with h.form:
                with h.div(class_='btn-group'):
                    active = ('active btn-primary' if (self.board.visibility == BOARD_PRIVATE) else '')
                    (h << h.button(_('Private'), class_=('btn %s' % active)).action((lambda : self.board.set_visibility(BOARD_PRIVATE))))
                    active = ('active btn-primary' if (self.board.visibility == BOARD_PUBLIC) else '')
                    (h << h.button(_('Public'), class_=('btn %s' % active)).action((lambda : self.board.set_visibility(BOARD_PUBLIC))))
        with h.div(class_='panel-section'):
            (h << h.div(_('Comments'), class_='panel-section-title'))
            (h << h.p(_('Commenting allows members to make short messages on cards. You can enable or disable this feature.')))
            with h.form:
                with h.div(class_='btn-group'):
                    active = ('active btn-primary' if (self.board.comments_allowed == COMMENTS_OFF) else '')
                    (h << h.button(_('Disabled'), class_=('btn %s' % active)).action((lambda : self.allow_comments(COMMENTS_OFF))))
                    active = ('active btn-primary' if (self.board.comments_allowed == COMMENTS_MEMBERS) else '')
                    (h << h.button(_('Members'), class_=('btn %s' % active)).action((lambda : self.allow_comments(COMMENTS_MEMBERS))))
                    kw = ({
                        
                    } if (self.board.visibility == BOARD_PUBLIC) else {
                        'disabled': 'disabled',
                    })
                    active = ('active btn-primary' if (self.board.comments_allowed == COMMENTS_PUBLIC) else '')
                    (h << h.button(_('Public'), class_=('btn %s' % active), **kw).action((lambda : self.allow_comments(COMMENTS_PUBLIC))))
        with h.div(class_='panel-section'):
            (h << h.div(_('Votes'), class_='panel-section-title'))
            (h << h.p(_('Allow votes')))
            with h.form:
                with h.div(class_='btn-group'):
                    active = ('active btn-primary' if (self.board.votes_allowed == VOTES_OFF) else '')
                    (h << h.button(_('Disabled'), class_=('btn %s' % active)).action((lambda : self.allow_votes(VOTES_OFF))))
                    active = ('active btn-primary' if (self.board.votes_allowed == VOTES_MEMBERS) else '')
                    (h << h.button(_('Members'), class_=('btn %s' % active)).action((lambda : self.allow_votes(VOTES_MEMBERS))))
                    kw = ({
                        
                    } if (self.board.visibility == BOARD_PUBLIC) else {
                        'disabled': 'disabled',
                    })
                    active = ('active btn-primary' if (self.board.votes_allowed == VOTES_PUBLIC) else '')
                    (h << h.button(_('Public'), class_=('btn %s' % active), **kw).action((lambda : self.allow_votes(VOTES_PUBLIC))))
        with h.div(class_='panel-section'):
            (h << h.div(_('Archive'), class_='panel-section-title'))
            (h << h.p(_('View archive column')))
            with h.form:
                with h.div(class_='btn-group'):
                    if self._changed():
                        (h << h.script('reload_columns();'))
                        self._changed(False)
                    active = ('active btn-primary' if self.board.show_archive else '')
                    (h << h.button(_('Show'), class_=('btn %s' % active)).action((lambda : self.set_archive(1))))
                    active = ('active btn-primary' if (not self.board.show_archive) else '')
                    (h << h.button(_('Hide'), class_=('btn %s' % active)).action((lambda : self.set_archive(0))))
    with h.div(class_='panel-section'):
        (h << h.div(_('Notifications'), class_='panel-section-title'))
        (h << h.p(_('You will be notified by email of changes made in this board to cards')))
        with h.form:
            with h.div(class_='btn-group'):
                active = ('active btn-primary' if (self.notifications_allowed == notifications.NOTIFY_OFF) else '')
                (h << h.button(_('None'), class_=('btn %s' % active)).action(self.allow_notifications, notifications.NOTIFY_OFF))
                active = ('active btn-primary' if (self.notifications_allowed == notifications.NOTIFY_MINE) else '')
                (h << h.button(_('Affected to me'), class_=('btn %s' % active)).action(self.allow_notifications, notifications.NOTIFY_MINE))
                active = ('active btn-primary' if (self.notifications_allowed == notifications.NOTIFY_ALL) else '')
                (h << h.button(_('All'), class_=('btn %s' % active)).action(self.allow_notifications, notifications.NOTIFY_ALL))
    return h.root

dataset/ETHPy150Open Net-ng/kansha/kansha/board/view.py render_BoardProfile/original