1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Added 'add an IP address' button to Prefix view

This commit is contained in:
Jeremy Stretch
2016-06-09 16:33:24 -04:00
parent 4c66419af8
commit a3e64a9964
2 changed files with 7 additions and 1 deletions

View File

@ -413,7 +413,7 @@ class IPAddressEditView(PermissionRequiredMixin, ObjectEditView):
permission_required = 'ipam.change_ipaddress'
model = IPAddress
form_class = forms.IPAddressForm
fields_initial = ['ipaddress']
fields_initial = ['address', 'vrf']
template_name = 'ipam/ipaddress_edit.html'
cancel_url = 'ipam:ipaddress_list'

View File

@ -24,6 +24,12 @@
</div>
</div>
<div class="pull-right">
{% if perms.ipam.add_ipaddress %}
<a href="{% url 'ipam:ipaddress_add' %}?address={{ prefix.prefix }}{% if prefix.vrf %}&vrf={{ prefix.vrf.pk }}{% endif %}" class="btn btn-success">
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
Add an IP Address
</a>
{% endif %}
{% if perms.ipam.change_prefix %}
<a href="{% url 'ipam:prefix_edit' pk=prefix.pk %}" class="btn btn-warning">
<span class="glyphicon glyphicon-pencil" aria-hidden="true"></span>