def getKnownSignaturesTable(self, signatures): result = [ T.table(class_='table table-bordered')[ T.thead[ T.tr[ T.th['Key'], T.th['Group'], T.th['Type'], T.th['Name'], T.th[''], ] ], T.tbody[ forEach(signatures, lambda key, group, sigType, name: [ T.tr[ T.td[key], T.td[group], T.td[sigType], T.td[name], T.td[ C.when(sigType in ['Data Site', 'Relic Site'])[ T.a(href='#', class_='lootModalToggle', **{'data-key': key})[ 'Loot' ] ] ] ] ]) ] ] ] return result
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