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 Panel(content, heading=None): return T.div(class_="panel panel-default")[ C.when(heading is not None)[ T.div(class_='panel-heading')[ T.h3(class_='panel-title')[ heading ] ] ], T.div(class_="panel-body")[ content ] ]
def renderStandardField(self, field): additionalClasses = set() feedbackIcon = None if field.flags.required: feedbackIcon = 'glyphicon-asterisk' if field.errors: additionalClasses.add('has-error') feedbackIcon = 'glyphicon-remove' if feedbackIcon is not None: additionalClasses.add('has-feedback') classes = ' %s' % ' '.join(additionalClasses) return ( T.div(class_="form-group%s" % classes)[ T.label(class_="col-sm-3 control-label")[field.label], T.div(class_="col-sm-9")[ field(class_='form-control'), C.when(feedbackIcon)[ T.span(class_='glyphicon form-control-feedback %s' % feedbackIcon), ], C.when(field.errors)[ T.span(class_='help-block')[ T.ul[ [T.li[err] for err in field.errors] ] ] ] ], ], )
def Modal(id, content, heading=None, footer=None): result = [] result.append(T.div(class_='modal fade', id=id, tabindex='-1', role='dialog')[ T.div(class_='modal-dialog')[ T.div(class_='modal-content')[ T.div(class_='modal-header')[ T.button(type='button', class_='close', **{'data-dismiss': 'modal'})[ T.span[entities.times], T.span(class_='sr-only')['Close'] ], T.h4(class_='modal-title')[heading] ], T.div(class_='modal-body')[ content ], C.when(footer is not None)[ T.div(class_='modal-footer')[footer] ] ] ] ]) return result