Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
protokollsystem
proto3
Commits
beb64bb1
Commit
beb64bb1
authored
Feb 17, 2018
by
marco
Browse files
Add Table.button for bottons in tables
parent
9ae236dc
Changes
1
Hide whitespace changes
Inline
Side-by-side
views/tables.py
View file @
beb64bb1
...
@@ -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
))
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment