Skip to content

Commit

Permalink
adds optional classes parameter #14390
Browse files Browse the repository at this point in the history
  • Loading branch information
abhi1693 authored and jeremystretch committed Dec 5, 2023
1 parent 9d09916 commit b21ed6a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion netbox/utilities/templates/builtins/copy_content.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<a class="btn btn-sm {{ color }} copy-content" data-clipboard-target="{{ target }}" title="Copy to clipboard">
<a class="btn btn-sm {{ color }} copy-content {{ classes }}" data-clipboard-target="{{ target }}" title="Copy to clipboard">
<i class="mdi mdi-content-copy"></i>
</a>
5 changes: 3 additions & 2 deletions netbox/utilities/templatetags/builtins/tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,14 @@ def checkmark(value, show_false=True, true='Yes', false='No'):


@register.inclusion_tag('builtins/copy_content.html')
def copy_content(target, prefix=None, color='primary'):
def copy_content(target, prefix=None, color='primary', classes=None):
"""
Display a copy button to copy the content of a field.
"""
return {
'target': f'#{prefix or ""}{target}',
'color': f'btn-{color}'
'color': f'btn-{color}',
'classes': classes or '',
}


Expand Down

0 comments on commit b21ed6a

Please sign in to comment.