Skip to content
Snippets Groups Projects
Commit beb64bb1 authored by marco's avatar marco
Browse files

Add Table.button for bottons in tables

parent 9ae236dc
No related branches found
No related tags found
1 merge request!10Resolve "Protokolle Übersichtseite umbauen"
...@@ -25,6 +25,18 @@ class Table: ...@@ -25,6 +25,18 @@ class Table:
confirmation = " onclick=\"return confirm('{}');\"".format(confirm) confirmation = " onclick=\"return confirm('{}');\"".format(confirm)
return Markup("<a href=\"{}\"{}>{}</a>".format(target, confirmation, text)) 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 @staticmethod
def mail(target): def mail(target):
return Markup("<a href=\"mailto:{}\">{}</a>".format(target, target)) return Markup("<a href=\"mailto:{}\">{}</a>".format(target, target))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment