1
0
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:
Abhimanyu Saharan
2023-11-30 22:00:26 +05:30
committed by Jeremy Stretch
parent 9d09916f6e
commit b21ed6a334
2 changed files with 4 additions and 3 deletions

View File

@ -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> <i class="mdi mdi-content-copy"></i>
</a> </a>

View File

@ -87,13 +87,14 @@ def checkmark(value, show_false=True, true='Yes', false='No'):
@register.inclusion_tag('builtins/copy_content.html') @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. Display a copy button to copy the content of a field.
""" """
return { return {
'target': f'#{prefix or ""}{target}', 'target': f'#{prefix or ""}{target}',
'color': f'btn-{color}' 'color': f'btn-{color}',
'classes': classes or '',
} }