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

Converted DCIM DeviceType add/edit/delete views to CBVs

This commit is contained in:
Jeremy Stretch
2016-05-03 16:50:48 -04:00
parent da3a596d3f
commit e1479be3d0
5 changed files with 29 additions and 148 deletions

View File

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

View File

@@ -1,11 +1,11 @@
{% extends '_base.html' %}
{% load form_helpers %}
{% block title %}{% if devicetype %}Editing device type {{ devicetype }}{% else %}Add a Device Type{% endif %}{% endblock %}
{% block title %}{% if obj %}Editing device type {{ obj }}{% else %}Add a Device Type{% endif %}{% endblock %}
{% block content %}
{% if devicetype %}
<h1>{{ devicetype }}</h1>
{% if obj %}
<h1>{{ obj }}</h1>
{% else %}
<h1>Add a Device Type</h1>
{% endif %}
@@ -35,9 +35,9 @@
</div>
<div class="row">
<div class="col-md-6 col-md-offset-3 text-center">
{% if devicetype %}
{% if obj %}
<button type="submit" name="_update" class="btn btn-primary">Update</button>
<a href="{% url 'dcim:devicetype' pk=devicetype.pk %}" class="btn btn-default">Cancel</a>
<a href="{% url 'dcim:devicetype' 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>