From 15a74f1f314fa035de857accabd0c0bf30b1004a Mon Sep 17 00:00:00 2001 From: Commander1024 Date: Thu, 6 Aug 2020 22:29:03 +0200 Subject: [PATCH] Added basic checkbox form and delete template. --- lostplaces/lostplaces_app/forms.py | 6 ++---- .../lostplaces_app/templates/delete_place.html | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+), 4 deletions(-) create mode 100644 lostplaces/lostplaces_app/templates/delete_place.html diff --git a/lostplaces/lostplaces_app/forms.py b/lostplaces/lostplaces_app/forms.py index 8650e92..9f7130c 100644 --- a/lostplaces/lostplaces_app/forms.py +++ b/lostplaces/lostplaces_app/forms.py @@ -49,7 +49,5 @@ class PlaceImageCreateForm(forms.ModelForm): self.fields['filename'].required = False -class PlaceDeleteForm(forms.ModelForm): - class Meta: - model = Place - fields = ['name'] +class PlaceDeleteForm(forms.Form): + confirm_check = forms.CheckboxInput() diff --git a/lostplaces/lostplaces_app/templates/delete_place.html b/lostplaces/lostplaces_app/templates/delete_place.html new file mode 100644 index 0000000..af9e948 --- /dev/null +++ b/lostplaces/lostplaces_app/templates/delete_place.html @@ -0,0 +1,18 @@ +{% extends 'global.html'%} +{% load static %} + +{% block title %}Lost Place Deletion{% endblock %} + +{% block maincontent %} +
+
+ Delete place + {% csrf_token %} +

Are you sure you want to delete {{place.name}}?

+ {{ form.as_p }} +
+ +
+
+
+{% endblock maincontent %} \ No newline at end of file