From c811eb069d1d83c8735890199800eb3b2945db90 Mon Sep 17 00:00:00 2001
From: atownson <52260120+atownson@users.noreply.github.com>
Date: Thu, 18 Aug 2022 16:05:29 -0500
Subject: [PATCH] netbox-community#10055 - Add loop for NAT Outside
---
netbox/templates/dcim/device.html | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/netbox/templates/dcim/device.html b/netbox/templates/dcim/device.html
index 8286f2c61..217362311 100644
--- a/netbox/templates/dcim/device.html
+++ b/netbox/templates/dcim/device.html
@@ -179,8 +179,8 @@
{{ object.primary_ip4.address.ip }}
{% if object.primary_ip4.nat_inside %}
(NAT for {{ object.primary_ip4.nat_inside.address.ip|linkify }})
- {% elif object.primary_ip4.nat_outside %}
- (NAT: {{ object.primary_ip4.nat_outside.address.ip|linkify }})
+ {% elif object.primary_ip4.nat_outside.count > 0 %}
+ (NAT for {% for nat in object.primary_ip4.nat_outside.all %}{{ nat.address.ip }}{% if not forloop.last %}, {% endif %}{% endfor %})
{% endif %}
{% else %}
{{ ''|placeholder }}
@@ -194,8 +194,8 @@
{{ object.primary_ip6.address.ip }}
{% if object.primary_ip6.nat_inside %}
(NAT for {{ object.primary_ip6.nat_inside.address.ip|linkify }})
- {% elif object.primary_ip6.nat_outside %}
- (NAT: {{ object.primary_ip6.nat_outside.address.ip|linkify }})
+ {% elif object.primary_ip6.nat_outside.count > 0 %}
+ (NAT for {% for nat in object.primary_ip6.nat_outside.all %}{{ nat.address.ip }}{% if not forloop.last %}, {% endif %}{% endfor %})
{% endif %}
{% else %}
{{ ''|placeholder }}