def embed(self): return tag.table ( class_ = "alert-embed alert-" + self.priority, onclick="window.location = '" + self.path + "';" ) [ tag.tr [ ([ tag.td ( class_ = "alert-image", rowspan = 2 ) [ tag.Text(self.children[0].embed(), escape=False) ] ] if self.children and hasattr(self.children[0], 'embed') else [ tag.td ( class_ = "alert-image", rowspan = 2 ) [ tag.Text(' ', escape=False) ] ]) + [ tag.th [ self.title ], ]], tag.tr [ tag.td [ self.description ] ] ]
def template(self): return tag.table ( **self.args ) [ [( tag.tr [ tag.th [ self.label(child.name, for_=child)() ], tag.td [ child(self.data) ] ] ) for child in self.children] ]