diff --git a/netbox/extras/views.py b/netbox/extras/views.py index 10bf2f6c810..b23dc02302d 100644 --- a/netbox/extras/views.py +++ b/netbox/extras/views.py @@ -276,6 +276,21 @@ class ConfigContextView(generic.ObjectView): queryset = ConfigContext.objects.all() def get_extra_context(self, request, instance): + # Gather assigned objects for parsing in the template + assigned_objects = ( + ('Regions', instance.regions.all), + ('Site Groups', instance.site_groups.all), + ('Sites', instance.sites.all), + ('Device Types', instance.device_types.all), + ('Roles', instance.roles.all), + ('Platforms', instance.platforms.all), + ('Cluster Groups', instance.cluster_groups.all), + ('Clusters', instance.clusters.all), + ('Tenant Groups', instance.tenant_groups.all), + ('Tenants', instance.tenants.all), + ('Tags', instance.tags.all), + ) + # Determine user's preferred output format if request.GET.get('format') in ['json', 'yaml']: format = request.GET.get('format') @@ -287,6 +302,7 @@ def get_extra_context(self, request, instance): format = 'json' return { + 'assigned_objects': assigned_objects, 'format': format, } diff --git a/netbox/templates/circuits/circuit.html b/netbox/templates/circuits/circuit.html index ec1369e1b25..7b22c5d65ab 100644 --- a/netbox/templates/circuits/circuit.html +++ b/netbox/templates/circuits/circuit.html @@ -66,18 +66,7 @@
Regions | -
- {% if object.regions.all %}
-
|
- ||
---|---|---|---|
Sites | -
- {% if object.sites.all %}
-
|
- ||
Roles | -
- {% if object.roles.all %}
-
|
- ||
Platforms | -
- {% if object.platforms.all %}
-
|
- ||
Cluster Groups | -
- {% if object.cluster_groups.all %}
-
|
- ||
Clusters | -
- {% if object.clusters.all %}
-
|
- ||
Tenant Groups | -
- {% if object.tenant_groups.all %}
-
|
- ||
Tenants | -
- {% if object.tenants.all %}
-
|
- ||
Tags | -
- {% if object.tags.all %}
-
|
+ {{ title }} | +
+
|