Commit beb64bb1 authored by marco's avatar marco
Browse files

Add Table.button for bottons in tables

parent 9ae236dc
......@@ -25,6 +25,18 @@ class Table:
confirmation = " onclick=\"return confirm('{}');\"".format(confirm)
return Markup("<a href=\"{}\"{}>{}</a>".format(target, confirmation, text))
@staticmethod
def button(target, icon, style, confirm=None):
confirmation = ""
if confirm:
confirmation = " onclick=\"return confirm('{}');\"".format(confirm)
return Markup(
'''<div class="btn-group btn-group-xs">
<a href="{target}" class="btn btn-{style}" {confirmation}>
<span class="glyphicon glyphicon-{icon}"></span>
</a>
</div>'''.format(target=target, style=style, confirmation=confirmation, icon=icon))
@staticmethod
def mail(target):
return Markup("<a href=\"mailto:{}\">{}</a>".format(target, target))
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment