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

12117 remove clone from cable (#12130)

* 12117 remove clone from cable

* 12117 remove clone button if no params

* Update clone.html

* Update clone.html

* Update clone.html

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
This commit is contained in:
Arthur Hanson
2023-04-03 12:27:13 -07:00
committed by GitHub
parent 2883fa14de
commit bca00cd97a
2 changed files with 7 additions and 3 deletions

View File

@ -1,3 +1,5 @@
<a href="{{ url }}" class="btn btn-sm btn-success" role="button">
<i class="mdi mdi-content-copy" aria-hidden="true"></i>&nbsp;Clone
</a>
{% if url %}
<a href="{{ url }}" class="btn btn-sm btn-success" role="button">
<i class="mdi mdi-content-copy" aria-hidden="true"></i> Clone
</a>
{% endif %}

View File

@ -20,6 +20,8 @@ def clone_button(instance):
param_string = prepare_cloned_fields(instance).urlencode()
if param_string:
url = f'{url}?{param_string}'
else:
url = None
return {
'url': url,