Add a Child delete confirm template.

This commit is contained in:
Christopher Charbonneau Wells 2017-08-16 09:43:34 -04:00
parent 54f8513fcc
commit 065e166ac1
3 changed files with 16 additions and 1 deletions

View File

@ -0,0 +1,13 @@
{% extends 'core/base.html' %}
{% load widget_tweaks %}
{% block title %}Delete a Child{% endblock %}
{% block content %}
<form role="form" method="post">
{% csrf_token %}
<h1>Are you sure you want to delete <span class="text-info">{{ object }}</span>?</h1>
<input type="submit" value="Delete" class="btn btn-danger" />
<a href="{% url 'child-list' %}" class="btn btn-default">Cancel</a>
</form>
{% endblock %}

View File

@ -11,7 +11,7 @@
{% block content %}
{% if object %}
<h1>Update <span class="text-info">{{ object.first_name }} {{ object.last_name }}</span></h1>
<h1>Update <span class="text-info">{{ object }}</span></h1>
{% else %}
<h1>Add a Child</h1>
{% endif %}
@ -34,5 +34,6 @@
</div>
{% endfor %}
<button type="submit" class="btn btn-primary">Submit</button>
<a href="{% url 'child-list' %}" class="btn btn-default">Cancel</a>
</form>
{% endblock %}

View File

@ -30,3 +30,4 @@ class ChildUpdate(UpdateView):
class ChildDelete(DeleteView):
model = Child
success_url = '/children'