Converted IPAM VRF, Aggregate add/edit/delete views to CBVs

This commit is contained in:
Jeremy Stretch
2016-05-09 12:20:46 -04:00
parent 606255e1ab
commit 60daaee204
6 changed files with 62 additions and 157 deletions

View File

@@ -1,11 +1,11 @@
{% extends '_base.html' %}
{% load form_helpers %}
{% block title %}Editing aggregate {{ aggregate }}{% endblock %}
{% block title %}{% if obj %}Editing aggregate {{ obj }}{% else %}Add a new aggregate{% endif %}{% endblock %}
{% block content %}
{% if aggregate %}
<h1>{{ aggregate }}</h1>
{% if obj %}
<h1>{{ obj }}</h1>
{% else %}
<h1>Add an Aggregate</h1>
{% endif %}
@@ -32,9 +32,9 @@
</div>
<div class="form-group">
<div class="col-md-9 col-md-offset-3">
{% if aggregate %}
{% if obj %}
<button type="submit" name="_update" class="btn btn-primary">Update</button>
<a href="{% url 'ipam:aggregate' pk=aggregate.pk %}" class="btn btn-default">Cancel</a>
<a href="{% url 'ipam:aggregate' 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>