diff --git a/netbox/templates/dcim/cable.html b/netbox/templates/dcim/cable.html index 0557286b6..bd0f27106 100644 --- a/netbox/templates/dcim/cable.html +++ b/netbox/templates/dcim/cable.html @@ -4,9 +4,6 @@ {% load perms %} {% load plugins %} -{# cable does not support the default clone control #} -{% block clone_button %}{% endblock clone_button %} - {% block content %}
diff --git a/netbox/templates/generic/object.html b/netbox/templates/generic/object.html index bc0237ccf..023726a30 100644 --- a/netbox/templates/generic/object.html +++ b/netbox/templates/generic/object.html @@ -60,23 +60,15 @@ Context: {# Extra buttons #} {% block extra_controls %}{% endblock %} - {% block clone_button %} {% if request.user|can_add:object %} {% clone_button object %} {% endif %} - {% endblock clone_button %} - - {% block edit_button %} {% if request.user|can_change:object %} {% edit_button object %} {% endif %} - {% endblock edit_button %} - - {% block delete_button %} {% if request.user|can_delete:object %} {% delete_button object %} {% endif %} - {% endblock delete_button %}
diff --git a/netbox/utilities/templates/buttons/clone.html b/netbox/utilities/templates/buttons/clone.html index 24e685c3d..ffd1e6a3d 100644 --- a/netbox/utilities/templates/buttons/clone.html +++ b/netbox/utilities/templates/buttons/clone.html @@ -1,3 +1,5 @@ +{% if url %}  Clone +{% endif %} \ No newline at end of file diff --git a/netbox/utilities/templatetags/buttons.py b/netbox/utilities/templatetags/buttons.py index bcdb099d8..dbd0240b9 100644 --- a/netbox/utilities/templatetags/buttons.py +++ b/netbox/utilities/templatetags/buttons.py @@ -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,