From 880ae577bd2883e642bc06f272bf184be38730b0 Mon Sep 17 00:00:00 2001 From: sonny Date: Thu, 14 May 2020 21:08:38 +0200 Subject: [PATCH] Use seperate form dir --- src/newsreader/templates/form/errors.html | 3 +++ src/newsreader/templates/{ => form}/form.html | 12 ++++-------- src/newsreader/templates/form/title.html | 3 +++ 3 files changed, 10 insertions(+), 8 deletions(-) create mode 100644 src/newsreader/templates/form/errors.html rename src/newsreader/templates/{ => form}/form.html (76%) create mode 100644 src/newsreader/templates/form/title.html diff --git a/src/newsreader/templates/form/errors.html b/src/newsreader/templates/form/errors.html new file mode 100644 index 0000000..bf030ea --- /dev/null +++ b/src/newsreader/templates/form/errors.html @@ -0,0 +1,3 @@ +
+ {{ form.non_field_errors }} +
diff --git a/src/newsreader/templates/form.html b/src/newsreader/templates/form/form.html similarity index 76% rename from src/newsreader/templates/form.html rename to src/newsreader/templates/form/form.html index eb9ff03..5b8f2fa 100644 --- a/src/newsreader/templates/form.html +++ b/src/newsreader/templates/form/form.html @@ -4,20 +4,16 @@ {% csrf_token %} {% if form.non_field_errors %} -
- {{ form.non_field_errors }} -
+ {% include "form/errors.html" title=title %} {% endif %} {% if title %} -
-

{{ title }}

-
+ {% include "form/title.html" title=title %} {% endif %}
{% for field in form %} -
+
@@ -30,7 +26,7 @@
-
+
{% if cancel_url %} {% trans "Cancel" %} {% endif %} diff --git a/src/newsreader/templates/form/title.html b/src/newsreader/templates/form/title.html new file mode 100644 index 0000000..3adcb75 --- /dev/null +++ b/src/newsreader/templates/form/title.html @@ -0,0 +1,3 @@ +
+

{{ title }}

+