mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-17 20:46:30 -06:00
Flip the order of tag and URL name for the tag template tag
This commit is contained in:
parent
9eb9715e05
commit
edf53d4516
@ -127,7 +127,7 @@
|
||||
<td>Tags</td>
|
||||
<td>
|
||||
{% for tag in circuit.tags.all %}
|
||||
{% tag 'circuits:circuit_list' tag %}
|
||||
{% tag tag 'circuits:circuit_list' %}
|
||||
{% empty %}
|
||||
<span class="text-muted">N/A</span>
|
||||
{% endfor %}
|
||||
|
@ -119,7 +119,7 @@
|
||||
<td>Tags</td>
|
||||
<td>
|
||||
{% for tag in provider.tags.all %}
|
||||
{% tag 'circuits:provider_list' tag %}
|
||||
{% tag tag 'circuits:provider_list' %}
|
||||
{% empty %}
|
||||
<span class="text-muted">N/A</span>
|
||||
{% endfor %}
|
||||
|
@ -173,7 +173,7 @@
|
||||
<td>Tags</td>
|
||||
<td>
|
||||
{% for tag in device.tags.all %}
|
||||
{% tag 'dcim:device_list' tag %}
|
||||
{% tag tag 'dcim:device_list' %}
|
||||
{% empty %}
|
||||
<span class="text-muted">N/A</span>
|
||||
{% endfor %}
|
||||
|
@ -89,7 +89,7 @@
|
||||
<td>Tags</td>
|
||||
<td>
|
||||
{% for tag in devicetype.tags.all %}
|
||||
{% tag 'dcim:devicetype_list' tag %}
|
||||
{% tag tag 'dcim:devicetype_list' %}
|
||||
{% empty %}
|
||||
<span class="text-muted">N/A</span>
|
||||
{% endfor %}
|
||||
|
@ -129,7 +129,7 @@
|
||||
<td>Tags</td>
|
||||
<td>
|
||||
{% for tag in rack.tags.all %}
|
||||
{% tag 'dcim:rack_list' tag %}
|
||||
{% tag tag 'dcim:rack_list' %}
|
||||
{% empty %}
|
||||
<span class="text-muted">N/A</span>
|
||||
{% endfor %}
|
||||
|
@ -149,7 +149,7 @@
|
||||
<td>Tags</td>
|
||||
<td>
|
||||
{% for tag in site.tags.all %}
|
||||
{% tag 'dcim:site_list' tag %}
|
||||
{% tag tag 'dcim:site_list' %}
|
||||
{% empty %}
|
||||
<span class="text-muted">N/A</span>
|
||||
{% endfor %}
|
||||
|
@ -97,7 +97,7 @@
|
||||
<td>Tags</td>
|
||||
<td>
|
||||
{% for tag in aggregate.tags.all %}
|
||||
{% tag 'ipam:aggregate_list' tag %}
|
||||
{% tag tag 'ipam:aggregate_list' %}
|
||||
{% empty %}
|
||||
<span class="text-muted">N/A</span>
|
||||
{% endfor %}
|
||||
|
@ -149,7 +149,7 @@
|
||||
<td>Tags</td>
|
||||
<td>
|
||||
{% for tag in ipaddress.tags.all %}
|
||||
{% tag 'ipam:ipaddress_list' tag %}
|
||||
{% tag tag 'ipam:ipaddress_list' %}
|
||||
{% empty %}
|
||||
<span class="text-muted">N/A</span>
|
||||
{% endfor %}
|
||||
|
@ -189,7 +189,7 @@
|
||||
<td>Tags</td>
|
||||
<td>
|
||||
{% for tag in prefix.tags.all %}
|
||||
{% tag 'ipam:prefix_list' tag %}
|
||||
{% tag tag 'ipam:prefix_list' %}
|
||||
{% empty %}
|
||||
<span class="text-muted">N/A</span>
|
||||
{% endfor %}
|
||||
|
@ -141,7 +141,7 @@
|
||||
<td>Tags</td>
|
||||
<td>
|
||||
{% for tag in vlan.tags.all %}
|
||||
{% tag 'ipam:vlan_list' tag %}
|
||||
{% tag tag 'ipam:vlan_list' %}
|
||||
{% empty %}
|
||||
<span class="text-muted">N/A</span>
|
||||
{% endfor %}
|
||||
|
@ -94,7 +94,7 @@
|
||||
<td>Tags</td>
|
||||
<td>
|
||||
{% for tag in vrf.tags.all %}
|
||||
{% tag 'ipam:vrf_list' tag %}
|
||||
{% tag tag 'ipam:vrf_list' %}
|
||||
{% empty %}
|
||||
<span class="text-muted">N/A</span>
|
||||
{% endfor %}
|
||||
|
@ -71,7 +71,7 @@
|
||||
<td>Tags</td>
|
||||
<td>
|
||||
{% for tag in secret.tags.all %}
|
||||
{% tag 'secrets:secret_list' tag %}
|
||||
{% tag tag 'secrets:secret_list' %}
|
||||
{% empty %}
|
||||
<span class="text-muted">N/A</span>
|
||||
{% endfor %}
|
||||
|
@ -83,7 +83,7 @@
|
||||
<td>Tags</td>
|
||||
<td>
|
||||
{% for tag in tenant.tags.all %}
|
||||
{% tag 'tenancy:tenant_list' tag %}
|
||||
{% tag tag 'tenancy:tenant_list' %}
|
||||
{% empty %}
|
||||
<span class="text-muted">N/A</span>
|
||||
{% endfor %}
|
||||
|
@ -1 +1,5 @@
|
||||
<a href="{% url url_name %}?tag={{ tag.slug }}"><span class="label label-default">{{ tag }}</span></a>
|
||||
{% if url_name %}
|
||||
<a href="{% url url_name %}?tag={{ tag.slug }}"><span class="label label-default">{{ tag }}</span></a>
|
||||
{% else %}
|
||||
<span class="label label-default">{{ tag }}</span>
|
||||
{% endif %}
|
||||
|
@ -91,7 +91,7 @@
|
||||
<td>Tags</td>
|
||||
<td>
|
||||
{% for tag in cluster.tags.all %}
|
||||
{% tag 'virtualization:cluster_list' tag %}
|
||||
{% tag tag 'virtualization:cluster_list' %}
|
||||
{% empty %}
|
||||
<span class="text-muted">N/A</span>
|
||||
{% endfor %}
|
||||
|
@ -139,7 +139,7 @@
|
||||
<td>Tags</td>
|
||||
<td>
|
||||
{% for tag in virtualmachine.tags.all %}
|
||||
{% tag 'virtualization:virtualmachine_list' tag %}
|
||||
{% tag tag 'virtualization:virtualmachine_list' %}
|
||||
{% empty %}
|
||||
<span class="text-muted">N/A</span>
|
||||
{% endfor %}
|
||||
|
@ -171,11 +171,11 @@ def utilization_graph(utilization, warning_threshold=75, danger_threshold=90):
|
||||
|
||||
|
||||
@register.inclusion_tag('utilities/templatetags/tag.html')
|
||||
def tag(url_name, tag):
|
||||
def tag(tag, url_name=None):
|
||||
"""
|
||||
Display a link to the given object list filtered by a specific Tag slug.
|
||||
Display a tag, optionally linked to a filtered list of objects.
|
||||
"""
|
||||
return {
|
||||
'url_name': url_name,
|
||||
'tag': tag,
|
||||
'url_name': url_name,
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user