From 065e166ac1ab67226c17c55513458c52d76b77a0 Mon Sep 17 00:00:00 2001 From: Christopher Charbonneau Wells Date: Wed, 16 Aug 2017 09:43:34 -0400 Subject: [PATCH] Add a Child delete confirm template. --- core/templates/core/child_confirm_delete.html | 13 +++++++++++++ core/templates/core/child_form.html | 3 ++- core/views.py | 1 + 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 core/templates/core/child_confirm_delete.html diff --git a/core/templates/core/child_confirm_delete.html b/core/templates/core/child_confirm_delete.html new file mode 100644 index 00000000..f30ec3be --- /dev/null +++ b/core/templates/core/child_confirm_delete.html @@ -0,0 +1,13 @@ +{% extends 'core/base.html' %} +{% load widget_tweaks %} + +{% block title %}Delete a Child{% endblock %} + +{% block content %} +
+ {% csrf_token %} +

Are you sure you want to delete {{ object }}?

+ + Cancel +
+{% endblock %} \ No newline at end of file diff --git a/core/templates/core/child_form.html b/core/templates/core/child_form.html index 7eb1d8ee..6b8fe37d 100644 --- a/core/templates/core/child_form.html +++ b/core/templates/core/child_form.html @@ -11,7 +11,7 @@ {% block content %} {% if object %} -

Update {{ object.first_name }} {{ object.last_name }}

+

Update {{ object }}

{% else %}

Add a Child

{% endif %} @@ -34,5 +34,6 @@ {% endfor %} + Cancel {% endblock %} \ No newline at end of file diff --git a/core/views.py b/core/views.py index 567428cb..b556f03c 100644 --- a/core/views.py +++ b/core/views.py @@ -30,3 +30,4 @@ class ChildUpdate(UpdateView): class ChildDelete(DeleteView): model = Child + success_url = '/children'