From d6c609d1078a252b51aa5471b9f6d8ee968495a6 Mon Sep 17 00:00:00 2001 From: Commander1024 Date: Mon, 28 Sep 2020 21:54:09 +0200 Subject: [PATCH 1/3] Added submit/cancel partial. Cancel redirects to referror or home. --- .../lostplaces/templates/partials/form/submit.html | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 django_lostplaces/lostplaces/templates/partials/form/submit.html diff --git a/django_lostplaces/lostplaces/templates/partials/form/submit.html b/django_lostplaces/lostplaces/templates/partials/form/submit.html new file mode 100644 index 0000000..42d006f --- /dev/null +++ b/django_lostplaces/lostplaces/templates/partials/form/submit.html @@ -0,0 +1,8 @@ +
+ +
+
+ + + +
From aa3922da508fa5a606d724da2c925a2a848cc214 Mon Sep 17 00:00:00 2001 From: Commander1024 Date: Mon, 28 Sep 2020 22:10:07 +0200 Subject: [PATCH 2/3] Added custom button text variable. --- .../lostplaces/templates/partials/form/submit.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/django_lostplaces/lostplaces/templates/partials/form/submit.html b/django_lostplaces/lostplaces/templates/partials/form/submit.html index 42d006f..a012fc7 100644 --- a/django_lostplaces/lostplaces/templates/partials/form/submit.html +++ b/django_lostplaces/lostplaces/templates/partials/form/submit.html @@ -1,8 +1,8 @@
- +
From 702ebd9137c6af98654f4cbb5611d80b277f19cc Mon Sep 17 00:00:00 2001 From: Commander1024 Date: Mon, 28 Sep 2020 22:12:39 +0200 Subject: [PATCH 3/3] Implanted submit/cancel partial into templates. --- .../templates/photo_album/photo_album_create.html | 9 +-------- .../lostplaces/templates/place/place_create.html | 9 +-------- .../lostplaces/templates/place/place_delete.html | 9 +-------- .../lostplaces/templates/place/place_update.html | 9 +-------- .../templates/place_image/place_image_create.html | 9 +-------- 5 files changed, 5 insertions(+), 40 deletions(-) diff --git a/django_lostplaces/lostplaces/templates/photo_album/photo_album_create.html b/django_lostplaces/lostplaces/templates/photo_album/photo_album_create.html index 883c980..52cdb7b 100644 --- a/django_lostplaces/lostplaces/templates/photo_album/photo_album_create.html +++ b/django_lostplaces/lostplaces/templates/photo_album/photo_album_create.html @@ -27,14 +27,7 @@
-
- -
- + {% include 'partials/form/submit.html' with referrer=request.META.HTTP_REFERER %}
diff --git a/django_lostplaces/lostplaces/templates/place/place_create.html b/django_lostplaces/lostplaces/templates/place/place_create.html index d085629..381bc9d 100644 --- a/django_lostplaces/lostplaces/templates/place/place_create.html +++ b/django_lostplaces/lostplaces/templates/place/place_create.html @@ -39,14 +39,7 @@
-
- -
- + {% include 'partials/form/submit.html' with referrer=request.META.HTTP_REFERER action='Create' %}
diff --git a/django_lostplaces/lostplaces/templates/place/place_delete.html b/django_lostplaces/lostplaces/templates/place/place_delete.html index f23895f..2b644a7 100644 --- a/django_lostplaces/lostplaces/templates/place/place_delete.html +++ b/django_lostplaces/lostplaces/templates/place/place_delete.html @@ -16,14 +16,7 @@
-
- -
- + {% include 'partials/form/submit.html' with referer=request.META.HTTP_REFERER action='Delete' %}
diff --git a/django_lostplaces/lostplaces/templates/place/place_update.html b/django_lostplaces/lostplaces/templates/place/place_update.html index 5d274f6..150dbfd 100644 --- a/django_lostplaces/lostplaces/templates/place/place_update.html +++ b/django_lostplaces/lostplaces/templates/place/place_update.html @@ -39,14 +39,7 @@
-
- -
- + {% include 'partials/form/submit.html' with referrer=request.META.HTTP_REFERER action='Update' %}
diff --git a/django_lostplaces/lostplaces/templates/place_image/place_image_create.html b/django_lostplaces/lostplaces/templates/place_image/place_image_create.html index 1b5c3e9..4213cbd 100644 --- a/django_lostplaces/lostplaces/templates/place_image/place_image_create.html +++ b/django_lostplaces/lostplaces/templates/place_image/place_image_create.html @@ -13,14 +13,7 @@
-
- -
- + {% include 'partials/form/submit.html' with referrer=request.META.HTTP_REFERER %}