Skip to content

Commit 674ddf7

Browse files
committed
adds optional classes parameter #14390
1 parent 9d09916 commit 674ddf7

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
<a class="btn btn-sm {{ color }} copy-content" data-clipboard-target="{{ target }}" title="Copy to clipboard">
1+
<a class="btn btn-sm {{ color }} copy-content {{ classes }}" data-clipboard-target="{{ target }}" title="Copy to clipboard">
22
<i class="mdi mdi-content-copy"></i>
33
</a>

netbox/utilities/templatetags/builtins/tags.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,14 @@ def checkmark(value, show_false=True, true='Yes', false='No'):
8787

8888

8989
@register.inclusion_tag('builtins/copy_content.html')
90-
def copy_content(target, prefix=None, color='primary'):
90+
def copy_content(target, prefix=None, color='primary', classes=None):
9191
"""
9292
Display a copy button to copy the content of a field.
9393
"""
9494
return {
9595
'target': f'#{prefix or ""}{target}',
96-
'color': f'btn-{color}'
96+
'color': f'btn-{color}',
97+
'classes': classes or '',
9798
}
9899

99100

0 commit comments

Comments
 (0)