mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-20 02:06:42 -06:00
Fixes: #5703 - Populate VRF and Tenant fields when adding IP address
This commit is contained in:
parent
a9b216d212
commit
18ab1144bb
@ -37,7 +37,7 @@ IPADDRESS_LINK = """
|
|||||||
{% if record.pk %}
|
{% if record.pk %}
|
||||||
<a href="{{ record.get_absolute_url }}">{{ record.address }}</a>
|
<a href="{{ record.get_absolute_url }}">{{ record.address }}</a>
|
||||||
{% elif perms.ipam.add_ipaddress %}
|
{% elif perms.ipam.add_ipaddress %}
|
||||||
<a href="{% url 'ipam:ipaddress_add' %}?address={{ record.1 }}{% if prefix.vrf %}&vrf={{ prefix.vrf.pk }}{% endif %}{% if prefix.tenant %}&tenant={{ prefix.tenant.pk }}{% endif %}" class="btn btn-xs btn-success">{% if record.0 <= 65536 %}{{ record.0 }}{% else %}Many{% endif %} IP{{ record.0|pluralize }} available</a>
|
<a href="{% url 'ipam:ipaddress_add' %}?address={{ record.1 }}{% if object.vrf %}&vrf={{ object.vrf.pk }}{% endif %}{% if object.tenant %}&tenant={{ object.tenant.pk }}{% endif %}" class="btn btn-xs btn-success">{% if record.0 <= 65536 %}{{ record.0 }}{% else %}Many{% endif %} IP{{ record.0|pluralize }} available</a>
|
||||||
{% else %}
|
{% else %}
|
||||||
{% if record.0 <= 65536 %}{{ record.0 }}{% else %}Many{% endif %} IP{{ record.0|pluralize }} available
|
{% if record.0 <= 65536 %}{{ record.0 }}{% else %}Many{% endif %} IP{{ record.0|pluralize }} available
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@ -50,8 +50,8 @@ IPADDRESS_ASSIGN_LINK = """
|
|||||||
VRF_LINK = """
|
VRF_LINK = """
|
||||||
{% if record.vrf %}
|
{% if record.vrf %}
|
||||||
<a href="{{ record.vrf.get_absolute_url }}">{{ record.vrf }}</a>
|
<a href="{{ record.vrf.get_absolute_url }}">{{ record.vrf }}</a>
|
||||||
{% elif prefix.vrf %}
|
{% elif object.vrf %}
|
||||||
{{ prefix.vrf }}
|
<a href="{{ object.vrf.get_absolute_url }}">{{ object.vrf }}</a>
|
||||||
{% else %}
|
{% else %}
|
||||||
Global
|
Global
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@ -114,6 +114,8 @@ TENANT_LINK = """
|
|||||||
<a href="{% url 'tenancy:tenant' slug=record.tenant.slug %}" title="{{ record.tenant.description }}">{{ record.tenant }}</a>
|
<a href="{% url 'tenancy:tenant' slug=record.tenant.slug %}" title="{{ record.tenant.description }}">{{ record.tenant }}</a>
|
||||||
{% elif record.vrf.tenant %}
|
{% elif record.vrf.tenant %}
|
||||||
<a href="{% url 'tenancy:tenant' slug=record.vrf.tenant.slug %}" title="{{ record.vrf.tenant.description }}">{{ record.vrf.tenant }}</a>*
|
<a href="{% url 'tenancy:tenant' slug=record.vrf.tenant.slug %}" title="{{ record.vrf.tenant.description }}">{{ record.vrf.tenant }}</a>*
|
||||||
|
{% elif object.tenant %}
|
||||||
|
<a href="{% url 'tenancy:tenant' slug=object.tenant.slug %}" title="{{ object.tenant.description }}">{{ object.tenant }}</a>
|
||||||
{% else %}
|
{% else %}
|
||||||
—
|
—
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
Loading…
Reference in New Issue
Block a user