def __init__(self, o, width=680, title=None, visible=True, closable=True): if not isinstance(o, component.Component): o = component.Component(o) # wrap into a component self.inner_comp = o self.width = width self.title = title self.visible = visible self.closable = closable self._id = generate_id('modalbox')
def __init__(self, property, height=150, max_chars=None, gallery_url=None, id=None): self.property = property self.height = height self.max_chars = max_chars self.gallery_url = gallery_url self.id = id or generate_id('rte')
def __init__(self, parent, idea): event_management._register_listener(parent, self) self.id = idea if is_integer(idea) else idea.id self.display_date = 'publication_date' self.comment_pager = component.Component(CommentPager(self)) self.comment_creator = component.Component( CommentCreator(self, self.id)) self.comment_creator.on_answer(lambda a: self.comments_updated()) self.wf_context = component.Component(IdeaWFContext(self.id)) event_management._register_listener(self, self.wf_context()) self.workflow_section = component.Component(WorkflowSection(self.id)) event_management._register_listener(self, self.workflow_section()) self.selected_tab = var.Var('') self.menu_items = [] if self.has_comments(): nb_comments = self.get_nb_comments() self.menu_items.append(( _N(u"Comment (%d)", u"Comments (%d)", nb_comments) % nb_comments, 'comments', None, '', None )) if self.has_challenge(): self.menu_items.append( (_(u"Challenge"), 'challenge', None, '', None)) if self.has_tags(): self.menu_items.append((_(u"Tags"), 'tags', None, '', None)) self.menu = component.Component(Menu(self.menu_items), model='tab_renderer') self.menu.on_answer(self.select_tab) self.select_default_tab() self._navigate_to_element = None self._comment_submit_id = generate_id('comment-submit') self.display_full_description = var.Var(False)
def __init__(self, parent, idea): event_management._register_listener(parent, self) self.id = idea if is_integer(idea) else idea.id self.display_date = 'publication_date' self.comment_pager = component.Component(CommentPager(self)) self.comment_creator = component.Component( CommentCreator(self, self.id)) self.comment_creator.on_answer(lambda a: self.comments_updated()) self.wf_context = component.Component(IdeaWFContext(self.id)) event_management._register_listener(self, self.wf_context()) self.workflow_section = component.Component(WorkflowSection(self.id)) event_management._register_listener(self, self.workflow_section()) self.selected_tab = var.Var('') self.menu_items = [] if self.has_comments(): nb_comments = self.get_nb_comments() self.menu_items.append( (_N(u"Comment (%d)", u"Comments (%d)", nb_comments) % nb_comments, 'comments', None, '', None)) if self.has_challenge(): self.menu_items.append( (_(u"Challenge"), 'challenge', None, '', None)) if self.has_tags(): self.menu_items.append((_(u"Tags"), 'tags', None, '', None)) self.menu = component.Component(Menu(self.menu_items), model='tab_renderer') self.menu.on_answer(self.select_tab) self.select_default_tab() self._navigate_to_element = None self._comment_submit_id = generate_id('comment-submit') self.display_full_description = var.Var(False)