Skip to content

Commit 6dbe0a9

Browse files
committed
Move copy button to the right
1 parent 7df6196 commit 6dbe0a9

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

app/grandchallenge/core/templatetags/copy_button.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def copy_button(value, link=None):
1111
button = format_html(
1212
"<button "
1313
'type="button" '
14-
'class="btn btn-link text-dark p-0 m-0 mr-1 copy-btn shadow-none" '
14+
'class="btn btn-link text-dark p-0 mt-0 mb-1 mx-1 copy-btn shadow-none" '
1515
'data-copy="{value}" '
1616
'data-placement="left" '
1717
'title="Copy to clipboard">'
@@ -23,10 +23,13 @@ def copy_button(value, link=None):
2323
shortened = str(value).split("-", 1)[0]
2424

2525
if link:
26-
return button + format_html(
27-
'<a href="{link}">{display_value}</a>',
28-
link=link,
29-
display_value=shortened,
26+
return (
27+
format_html(
28+
'<a href="{link}">{display_value}</a>',
29+
link=link,
30+
display_value=shortened,
31+
)
32+
+ button
3033
)
3134
else:
32-
return button + format_html("{display_value}", display_value=shortened)
35+
return format_html("{display_value}", display_value=shortened) + button

0 commit comments

Comments
 (0)