diff --git a/netbox/extras/templatetags/custom_links.py b/netbox/extras/templatetags/custom_links.py index 39017adfd..814acbbcb 100644 --- a/netbox/extras/templatetags/custom_links.py +++ b/netbox/extras/templatetags/custom_links.py @@ -10,14 +10,24 @@ from utilities.utils import render_jinja2 register = template.Library() -LINK_BUTTON = '{}\n' -GROUP_BUTTON = '
\n' \ - '\n' \ - '
\n' -GROUP_LINK = '
  • {}
  • \n' +LINK_BUTTON = '{}\n' + +GROUP_BUTTON = """ + +""" + +GROUP_LINK = '
  • {}
  • \n' @register.simple_tag(takes_context=True) @@ -60,7 +70,7 @@ def custom_links(context, obj): link_rendered, link_target, cl.button_class, text_rendered ) except Exception as e: - template_code += '' \ + template_code += '' \ ' {}\n'.format(e, cl.name) # Add grouped links to template @@ -79,7 +89,7 @@ def custom_links(context, obj): ) except Exception as e: links_rendered.append( - '
  • ' + '
  • ' ' {}
  • '.format(e, cl.name) ) diff --git a/netbox/templates/dcim/device/base.html b/netbox/templates/dcim/device/base.html index 4a20a63cc..5355d5059 100644 --- a/netbox/templates/dcim/device/base.html +++ b/netbox/templates/dcim/device/base.html @@ -2,7 +2,6 @@ {% load buttons %} {% load static %} {% load helpers %} -{% load custom_links %} {% load plugins %} {% block breadcrumbs %} diff --git a/netbox/templates/dcim/device_component.html b/netbox/templates/dcim/device_component.html index 2cc4abf35..998551838 100644 --- a/netbox/templates/dcim/device_component.html +++ b/netbox/templates/dcim/device_component.html @@ -1,7 +1,6 @@ {% extends 'generic/object.html' %} {% load helpers %} {% load perms %} -{% load custom_links %} {% load plugins %} {% block title %}{{ object.device }} / {{ object }}{% endblock %} diff --git a/netbox/templates/dcim/powerfeed.html b/netbox/templates/dcim/powerfeed.html index 70c94bf68..add2486ba 100644 --- a/netbox/templates/dcim/powerfeed.html +++ b/netbox/templates/dcim/powerfeed.html @@ -1,7 +1,6 @@ {% extends 'generic/object.html' %} {% load buttons %} {% load static %} -{% load custom_links %} {% load helpers %} {% load plugins %} diff --git a/netbox/templates/dcim/rackreservation.html b/netbox/templates/dcim/rackreservation.html index 076718fb4..83ce4be1a 100644 --- a/netbox/templates/dcim/rackreservation.html +++ b/netbox/templates/dcim/rackreservation.html @@ -1,6 +1,5 @@ {% extends 'generic/object.html' %} {% load buttons %} -{% load custom_links %} {% load helpers %} {% load static %} {% load plugins %} diff --git a/netbox/templates/dcim/virtualchassis.html b/netbox/templates/dcim/virtualchassis.html index 1f3dccc1d..3582a806c 100644 --- a/netbox/templates/dcim/virtualchassis.html +++ b/netbox/templates/dcim/virtualchassis.html @@ -1,6 +1,5 @@ {% extends 'generic/object.html' %} {% load buttons %} -{% load custom_links %} {% load helpers %} {% load plugins %} diff --git a/netbox/templates/generic/object.html b/netbox/templates/generic/object.html index 961e316f2..27a324339 100644 --- a/netbox/templates/generic/object.html +++ b/netbox/templates/generic/object.html @@ -18,9 +18,10 @@ {% endblock %} {% block controls %} -{% plugin_buttons object %}
    + {% custom_links object %} + {% plugin_buttons object %} {% block extra_controls %}{% endblock %} {% if request.user|can_add:object %} {% clone_button object %} @@ -71,6 +72,5 @@ {{ object|meta:"app_label" }}.{{ object|meta:"model_name" }}:{{ object.pk }}

    -{% block tab_buttons %}{% custom_links object %}{% endblock %} {% endblock %} {% block components %}{% endblock %} diff --git a/netbox/templates/ipam/aggregate.html b/netbox/templates/ipam/aggregate.html index 4663b8c4a..ad817f9cb 100644 --- a/netbox/templates/ipam/aggregate.html +++ b/netbox/templates/ipam/aggregate.html @@ -1,6 +1,5 @@ {% extends 'generic/object.html' %} {% load buttons %} -{% load custom_links %} {% load helpers %} {% load plugins %} diff --git a/netbox/templates/ipam/prefix/base.html b/netbox/templates/ipam/prefix/base.html index e7e474071..59dd25a7e 100644 --- a/netbox/templates/ipam/prefix/base.html +++ b/netbox/templates/ipam/prefix/base.html @@ -1,7 +1,6 @@ {% extends 'generic/object.html' %} {% load buttons %} {% load helpers %} -{% load custom_links %} {% block breadcrumbs %}