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

Converted IPAM Prefix, IPAddress, VLAN add/edit/delete views to CBVs

This commit is contained in:
Jeremy Stretch
2016-05-09 13:10:37 -04:00
parent 60daaee204
commit 171f2c008f
8 changed files with 86 additions and 246 deletions

View File

@@ -1,10 +1,10 @@
{% extends '_base.html' %}
{% load form_helpers %}
{% block title %}{% if ipaddress %}Editing IP Address {{ ipaddress }}{% else %}Add an IP Address{% endif %}{% endblock %}
{% block title %}{% if obj %}Editing IP Address {{ obj }}{% else %}Add an IP Address{% endif %}{% endblock %}
{% block content %}
<h1>{% if ipaddress %}Editing IP Address {{ ipaddress }}{% else %}Add an IP Address{% endif %}</h1>
<h1>{% if obj %}Editing IP Address {{ obj }}{% else %}Add an IP Address{% endif %}</h1>
<form action="." method="post" class="form form-horizontal">
{% csrf_token %}
<div class="row">
@@ -22,13 +22,13 @@
<div class="panel-body">
{% render_field form.address %}
{% render_field form.vrf %}
{% if ipaddress %}
{% if obj %}
<div class="form-group">
<label class="col-md-3 control-label">Device</label>
<div class="col-md-9">
<p class="form-control-static">
{% if ipaddress.interface %}
<a href="{% url 'dcim:device' pk=ipaddress.interface.device.pk %}">{{ ipaddress.interface.device }}</a>
{% if obj.interface %}
<a href="{% url 'dcim:device' pk=obj.interface.device.pk %}">{{ obj.interface.device }}</a>
{% else %}
<span>None</span>
{% endif %}
@@ -38,7 +38,7 @@
<div class="form-group">
<label class="col-md-3 control-label">Interface</label>
<div class="col-md-9">
<p class="form-control-static">{{ ipaddress.interface }}</p>
<p class="form-control-static">{{ obj.interface }}</p>
</div>
</div>
{% endif %}
@@ -70,9 +70,9 @@
</div>
<div class="row">
<div class="col-md-12 text-right">
{% if ipaddress %}
{% if obj %}
<button type="submit" name="_update" class="btn btn-primary">Update</button>
<a href="{% url 'ipam:ipaddress' pk=ipaddress.pk %}" class="btn btn-default">Cancel</a>
<a href="{% url 'ipam:ipaddress' pk=obj.pk %}" class="btn btn-default">Cancel</a>
{% else %}
<button type="submit" name="_create" class="btn btn-primary">Create</button>
<button type="submit" name="_addanother" class="btn btn-primary">Create and Add Another</button>