diff --git a/netbox/templates/circuits/circuit_list.html b/netbox/templates/circuits/circuit_list.html
index f05552f7d..81e09c32b 100644
--- a/netbox/templates/circuits/circuit_list.html
+++ b/netbox/templates/circuits/circuit_list.html
@@ -16,6 +16,7 @@
{% include 'inc/search_panel.html' %}
+ {% include 'inc/tags_panel.html' %}
{% endblock %}
diff --git a/netbox/templates/circuits/provider_list.html b/netbox/templates/circuits/provider_list.html
index cb7aab406..a0036f46c 100644
--- a/netbox/templates/circuits/provider_list.html
+++ b/netbox/templates/circuits/provider_list.html
@@ -16,6 +16,7 @@
{% include 'inc/search_panel.html' %}
+ {% include 'inc/tags_panel.html' %}
{% endblock %}
diff --git a/netbox/templates/dcim/device_list.html b/netbox/templates/dcim/device_list.html
index f96b27309..4bae11781 100644
--- a/netbox/templates/dcim/device_list.html
+++ b/netbox/templates/dcim/device_list.html
@@ -16,6 +16,7 @@
{% include 'inc/search_panel.html' %}
+ {% include 'inc/tags_panel.html' %}
{% endblock %}
diff --git a/netbox/templates/dcim/devicetype_list.html b/netbox/templates/dcim/devicetype_list.html
index 91745082a..eb901f5a0 100644
--- a/netbox/templates/dcim/devicetype_list.html
+++ b/netbox/templates/dcim/devicetype_list.html
@@ -16,6 +16,7 @@
{% include 'inc/search_panel.html' %}
+ {% include 'inc/tags_panel.html' %}
{% endblock %}
diff --git a/netbox/templates/dcim/rack_list.html b/netbox/templates/dcim/rack_list.html
index d5734ee2b..e61f4eadf 100644
--- a/netbox/templates/dcim/rack_list.html
+++ b/netbox/templates/dcim/rack_list.html
@@ -16,6 +16,7 @@
{% include 'inc/search_panel.html' %}
+ {% include 'inc/tags_panel.html' %}
{% endblock %}
diff --git a/netbox/templates/dcim/site_list.html b/netbox/templates/dcim/site_list.html
index 7baa76dad..50066186d 100644
--- a/netbox/templates/dcim/site_list.html
+++ b/netbox/templates/dcim/site_list.html
@@ -16,6 +16,7 @@
{% include 'inc/search_panel.html' %}
+ {% include 'inc/tags_panel.html' %}
{% endblock %}
diff --git a/netbox/templates/inc/tags_panel.html b/netbox/templates/inc/tags_panel.html
new file mode 100644
index 000000000..baeee72ac
--- /dev/null
+++ b/netbox/templates/inc/tags_panel.html
@@ -0,0 +1,13 @@
+{% load helpers %}
+
+
diff --git a/netbox/templates/ipam/aggregate_list.html b/netbox/templates/ipam/aggregate_list.html
index 73da9695d..33db74e5c 100644
--- a/netbox/templates/ipam/aggregate_list.html
+++ b/netbox/templates/ipam/aggregate_list.html
@@ -17,6 +17,7 @@
{% include 'inc/search_panel.html' %}
+ {% include 'inc/tags_panel.html' %}
Statistics
diff --git a/netbox/templates/ipam/ipaddress_list.html b/netbox/templates/ipam/ipaddress_list.html
index 5f8fdeb88..418b807bd 100644
--- a/netbox/templates/ipam/ipaddress_list.html
+++ b/netbox/templates/ipam/ipaddress_list.html
@@ -16,6 +16,7 @@
{% include 'inc/search_panel.html' %}
+ {% include 'inc/tags_panel.html' %}
{% endblock %}
diff --git a/netbox/templates/ipam/prefix_list.html b/netbox/templates/ipam/prefix_list.html
index d65904595..3ce9d4a9c 100644
--- a/netbox/templates/ipam/prefix_list.html
+++ b/netbox/templates/ipam/prefix_list.html
@@ -21,6 +21,7 @@
{% include 'inc/search_panel.html' %}
+ {% include 'inc/tags_panel.html' %}
{% endblock %}
diff --git a/netbox/templates/ipam/vlan_list.html b/netbox/templates/ipam/vlan_list.html
index 24e12595b..d734db8d2 100644
--- a/netbox/templates/ipam/vlan_list.html
+++ b/netbox/templates/ipam/vlan_list.html
@@ -16,6 +16,7 @@
{% include 'inc/search_panel.html' %}
+ {% include 'inc/tags_panel.html' %}
{% endblock %}
diff --git a/netbox/templates/ipam/vrf_list.html b/netbox/templates/ipam/vrf_list.html
index 23bd16495..670f0ee5d 100644
--- a/netbox/templates/ipam/vrf_list.html
+++ b/netbox/templates/ipam/vrf_list.html
@@ -16,6 +16,7 @@
{% include 'inc/search_panel.html' %}
+ {% include 'inc/tags_panel.html' %}
{% endblock %}
diff --git a/netbox/templates/secrets/secret_list.html b/netbox/templates/secrets/secret_list.html
index 6dd92cd89..0a70e1087 100644
--- a/netbox/templates/secrets/secret_list.html
+++ b/netbox/templates/secrets/secret_list.html
@@ -14,6 +14,7 @@
{% include 'inc/search_panel.html' %}
+ {% include 'inc/tags_panel.html' %}
{% endblock %}
diff --git a/netbox/templates/tenancy/tenant_list.html b/netbox/templates/tenancy/tenant_list.html
index e6fd61c37..176231507 100644
--- a/netbox/templates/tenancy/tenant_list.html
+++ b/netbox/templates/tenancy/tenant_list.html
@@ -16,6 +16,7 @@
{% include 'inc/search_panel.html' %}
+ {% include 'inc/tags_panel.html' %}
{% endblock %}
diff --git a/netbox/templates/virtualization/cluster_list.html b/netbox/templates/virtualization/cluster_list.html
index 08f62e6ba..84513dbb1 100644
--- a/netbox/templates/virtualization/cluster_list.html
+++ b/netbox/templates/virtualization/cluster_list.html
@@ -16,6 +16,7 @@
{% include 'inc/search_panel.html' %}
+ {% include 'inc/tags_panel.html' %}
{% endblock %}
diff --git a/netbox/templates/virtualization/virtualmachine_list.html b/netbox/templates/virtualization/virtualmachine_list.html
index 30ed76dae..bf2961fd8 100644
--- a/netbox/templates/virtualization/virtualmachine_list.html
+++ b/netbox/templates/virtualization/virtualmachine_list.html
@@ -16,6 +16,7 @@
{% include 'inc/search_panel.html' %}
+ {% include 'inc/tags_panel.html' %}
{% endblock %}
diff --git a/netbox/utilities/views.py b/netbox/utilities/views.py
index d060e53d7..769954fea 100644
--- a/netbox/utilities/views.py
+++ b/netbox/utilities/views.py
@@ -8,7 +8,7 @@ from django.contrib import messages
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import ValidationError
from django.db import transaction, IntegrityError
-from django.db.models import ProtectedError
+from django.db.models import Count, ProtectedError
from django.forms import CharField, Form, ModelMultipleChoiceField, MultipleHiddenInput, Textarea
from django.shortcuts import get_object_or_404, redirect, render
from django.template.exceptions import TemplateSyntaxError
@@ -119,6 +119,12 @@ class ObjectListView(View):
if 'pk' in table.base_columns and (permissions['change'] or permissions['delete']):
table.columns.show('pk')
+ # Construct queryset for tags list
+ if hasattr(model, 'tags'):
+ tags = model.tags.annotate(count=Count('taggit_taggeditem_items'))
+ else:
+ tags = None
+
# Apply the request context
paginate = {
'klass': EnhancedPaginator,
@@ -131,6 +137,7 @@ class ObjectListView(View):
'table': table,
'permissions': permissions,
'filter_form': self.filter_form(request.GET, label_suffix='') if self.filter_form else None,
+ 'tags': tags,
}
context.update(self.extra_context())