1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Closes #13962: Add a copy-to-clipboard button to the key field of the API token creation form

This commit is contained in:
Jeremy Stretch
2023-10-13 16:39:19 -04:00
parent 7983c2590e
commit 51ef4fb920
6 changed files with 14 additions and 8 deletions

View File

@ -29,6 +29,14 @@
{{ label }}
</label>
</div>
{# Include a copy-to-clipboard button #}
{% elif 'data-clipboard' in field.field.widget.attrs %}
<div class="input-group">
{{ field }}
<button type="button" title="{% trans "Copy to clipboard" %}" class="btn btn-outline-dark border-input copy-content" data-clipboard-target="#{{ field.id_for_label }}">
<i class="mdi mdi-content-copy"></i>
</button>
</div>
{# Default field rendering #}
{% else %}
{{ field }}