mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
adds optional classes parameter #14390
This commit is contained in:
committed by
Jeremy Stretch
parent
9d09916f6e
commit
b21ed6a334
@ -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>
|
||||
|
@ -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 '',
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user