def render_content(self): return html.form(action='', method='POST')( html.div( html.div(id='tools')( html.button(type='submit', name='cut', value='cut', id='cut')("Cut"), html.button(type='submit', name='autotrans', value='autotrans', id='autotrans')("Auto Trans"), ), html.div(id='presets', class_='presets')( self.render_preset_group(group) for group in self.app.presets.groups ), ), )
def render(self): status = [] for msg in self.render_status(): status.append(html.p(msg)) return html.div(class_='container-fluid', id='container')( self.render_header(), self.render_content(), html.div(id='status')( status or html.p("Ready") ), )
def render_header(self): return html.div(id='header', class_='navbar')( html.div(class_='navbar-header')( html.a(href=self.url(Index), class_='navbar-brand')(self.TITLE), ), html.div(class_='narbar-collapse')( html.ul(class_='nav navbar-nav')( html.li(class_=('active' if isinstance(self, page) else None))( html.a(href=self.url(page))(page.PAGE_TITLE) ) for page in HTML_PAGES ), ), )
def render_preset_group (self, group): if not group.presets: return return html.div(class_='preset-group')( html.h3(group.title) if group.title else None, [ self.render_preset(preset) for preset in group.presets ], )
def render_content(self): return html.div( html.div(id='destinations', class_='presets')( self.render_destination(destination) for destination in self.app.presets.destinations ), )
def render_destination(self, destination): return html.div(class_='destination')( html.h3(destination.title), self.render_destination_preset(destination.program, 'program'), self.render_destination_preset(destination.preview, 'preview'), )