diff --git a/README.md b/README.md index 3712e53..ece891f 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,8 @@ systemctl restart netbox | netbox version | plugin version | | -------------- | ----------------------------- | -| >= 3.7.0 | >= v1.0.0 | +| >= 4.0.0 | >= v1.1.0 | +| <= 4.0.0 | = v1.0.0 | ### Update diff --git a/netbox_reorder_rack/__init__.py b/netbox_reorder_rack/__init__.py index a19fed8..cd1b956 100644 --- a/netbox_reorder_rack/__init__.py +++ b/netbox_reorder_rack/__init__.py @@ -1,11 +1,11 @@ -from extras.plugins import PluginConfig +from netbox.plugins import PluginConfig class NetboxReorderRackConfig(PluginConfig): name = "netbox_reorder_rack" verbose_name = "NetBox Reorder Rack" description = "NetBox plugin to reorder rack layouts." - version = "1.0.0" + version = "1.1.0" base_url = "reorder" diff --git a/netbox_reorder_rack/templates/netbox_reorder_rack/inc/rack_elevation.html b/netbox_reorder_rack/templates/netbox_reorder_rack/inc/rack_elevation.html index f377332..ab9e880 100644 --- a/netbox_reorder_rack/templates/netbox_reorder_rack/inc/rack_elevation.html +++ b/netbox_reorder_rack/templates/netbox_reorder_rack/inc/rack_elevation.html @@ -16,13 +16,13 @@ {% if device.device.face == face %}
- {{device.device.name}} + {{ device.device | device_name }}
{% else %}
- {{device.device.name}} + {{ device.device.name }}
{% endif %} diff --git a/netbox_reorder_rack/templates/netbox_reorder_rack/rack.html b/netbox_reorder_rack/templates/netbox_reorder_rack/rack.html index 023d9a0..726949b 100644 --- a/netbox_reorder_rack/templates/netbox_reorder_rack/rack.html +++ b/netbox_reorder_rack/templates/netbox_reorder_rack/rack.html @@ -45,7 +45,7 @@ {% block subtitle %}
- Created {{ object.created|annotated_date }} + Created {{ object.created|isodatetime }} · Updated {{ object.last_updated|timesince }} ago
diff --git a/netbox_reorder_rack/templatetags/rack.py b/netbox_reorder_rack/templatetags/rack.py index b034d46..a29d8c9 100644 --- a/netbox_reorder_rack/templatetags/rack.py +++ b/netbox_reorder_rack/templatetags/rack.py @@ -1,5 +1,6 @@ +from dcim.svg.racks import get_device_name from django import template -from utilities.utils import foreground_color +from utilities.html import foreground_color register = template.Library() @@ -40,3 +41,8 @@ def mul(value, mul_value): @register.filter() def text_color(value): return foreground_color(value) + + +@register.filter() +def device_name(device): + return get_device_name(device) diff --git a/setup.py b/setup.py index f816e62..592d6c8 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ setup( name="netbox_reorder_rack", - version="1.0.0", + version="1.1.0", author="Alex Gittings", author_email="agitting96@gmail.com", description="NetBox plugin to reorder rack layouts.",