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

Covnerted DCIM site add/edit/delete views to CBVs

This commit is contained in:
Jeremy Stretch
2016-05-03 16:26:33 -04:00
parent 9acd23e08a
commit d51992e98b
4 changed files with 28 additions and 75 deletions

View File

@@ -1,8 +1,8 @@
{% extends 'utilities/confirmation_form.html' %}
{% load form_helpers %}
{% block title %}Delete site {{ site }}?{% endblock %}
{% block title %}Delete site {{ obj }}?{% endblock %}
{% block message %}
<p>Are you sure you want to delete site {{ site }}?</p>
<p>Are you sure you want to delete site {{ obj }}?</p>
{% endblock %}

View File

@@ -1,11 +1,11 @@
{% extends '_base.html' %}
{% load form_helpers %}
{% block title %}{% if site %}Editing site {{ site }}{% else %}Add a site{% endif %}{% endblock %}
{% block title %}{% if obj %}Editing site {{ obj }}{% else %}Add a site{% endif %}{% endblock %}
{% block content %}
{% if site %}
<h1>Site {{ site }}</h1>
{% if obj %}
<h1>Site {{ obj }}</h1>
{% else %}
<h1>Add a Site</h1>
{% endif %}
@@ -48,9 +48,9 @@
</div>
<div class="row">
<div class="col-md-12 text-right">
{% if site %}
{% if obj %}
<button type="submit" name="_update" class="btn btn-primary">Update</button>
<a href="{% url 'dcim:site' slug=site.slug %}" class="btn btn-default">Cancel</a>
<a href="{% url 'dcim:site' slug=obj.slug %}" 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>