示例#1
0
文件: web.py 项目: zarr/qmsk-e2
 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
             ),
         ),
     )
示例#2
0
文件: web.py 项目: zarr/qmsk-e2
    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")
            ),
        )
示例#3
0
文件: web.py 项目: zarr/qmsk-e2
 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
             ),
         ),
     )
示例#4
0
文件: web.py 项目: zarr/qmsk-e2
    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
                ],
        )
示例#5
0
文件: web.py 项目: zarr/qmsk-e2
 def render_content(self):
     return html.div(
         html.div(id='destinations', class_='presets')(
             self.render_destination(destination) for destination in self.app.presets.destinations
         ),
     )
示例#6
0
文件: web.py 项目: zarr/qmsk-e2
 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'),
     )