def renderRegisterForm(self, form): html = HtmlLayout(isLogged=False) formView = FormRenderer() formView.addButton('Create account') formView.setRenderPanel() content = ( T.div(class_="row")[ T.div(class_="col-sm-4")[ T.h2['Register form'], ], T.div(class_="col-sm-4 text-right")[ T.h2[T.a(href=self.getUrl('index'))['Back']] ] ], T.div(class_="row")[ T.div(class_="col-sm-8")[ formView.render(form) ] ] ) html.setContent(content) return html
def renderLoginForm(self, form, count): formView = FormRenderer() formView.addButton('Login') formView.setRenderPanel() content = [ T.div(class_="row")[ T.div(class_="col-sm-4")[ T.h2['Login form '], ], T.div(class_="col-sm-4 text-right")[ T.h2[T.a(href=self.getUrl('register'))['Register account']] ] ], T.div(class_="row")[ T.div(class_="col-sm-8")[ formView.render(form) ] ], ] layout = HtmlLayout(isLogged=False) layout.setContent(content) return layout
def renderForm(self, form): html = HtmlLayout() formView = FormRenderer() formView.addButton('Add key') html.setContent(['new key form...', formView.render(form)]) return html
def renderApiKeys(self, keys): content = ( T.h2['API Keys'], T.p[ T.a(href=self.getUrl('profile/newKey'))[ T.button(class_='btn btn-primary')['Add key'] ], ], T.div(class_='panel panel-default')[ T.div(class_='panel-heading')['Added keys'], T.table(class_='table')[ T.thead[ T.tr[ T.th['Key ID'], T.th['Expires'], T.th['Characters'], T.th() ] ], T.tbody[ forEach(keys, lambda keyId, expires, characters: ( T.tr[ T.td[keyId], T.td[expires], T.td[ [ T.div[char] for char in characters ] ], T.td[ T.a(class_='glyphicon glyphicon-info-sign withTooltip', title='Detailed info', href='#', **{'data-placement': 'top', 'data-toggle': 'tooltip'}), ' ', T.a(class_='glyphicon glyphicon-trash withTooltip text-danger', title='Delete key', href='#', **{'data-placement': 'top', 'data-toggle': 'tooltip'}), ] ] )), ] ] ] ) html = HtmlLayout() html.setContent(content) return html
def renderProfile(self): html = HtmlLayout() html.setContent(T.h2['LOLOLOL LAYOUT']) return html
def doGet(self, request): layout = HtmlLayout() layout.setContent('Skills plans') return layout
def doGet(self, request): layout = HtmlLayout() layout.setContent('Skills list, etc') return layout