mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Added template tag for tag links
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import datetime
|
||||
import pytz
|
||||
|
||||
from django import template
|
||||
from django.utils.safestring import mark_safe
|
||||
@@ -160,3 +159,14 @@ def utilization_graph(utilization, warning_threshold=75, danger_threshold=90):
|
||||
'warning_threshold': warning_threshold,
|
||||
'danger_threshold': danger_threshold,
|
||||
}
|
||||
|
||||
|
||||
@register.inclusion_tag('utilities/templatetags/tag.html')
|
||||
def tag(url_name, tag):
|
||||
"""
|
||||
Display a link to the given object list filtered by a specific Tag slug.
|
||||
"""
|
||||
return {
|
||||
'url_name': url_name,
|
||||
'tag': tag,
|
||||
}
|
||||
|
Reference in New Issue
Block a user