From 2e857818dabad667d8ee99db64b12d1c1a89c921 Mon Sep 17 00:00:00 2001 From: sonny Date: Sat, 23 May 2020 12:04:07 +0200 Subject: [PATCH] Add help-text/label components --- .../accounts/templates/accounts/components/login-form.html | 2 +- src/newsreader/templates/components/form/form.html | 6 ++---- src/newsreader/templates/components/form/help-text.html | 1 + src/newsreader/templates/components/form/label.html | 3 +++ 4 files changed, 7 insertions(+), 5 deletions(-) create mode 100644 src/newsreader/templates/components/form/help-text.html create mode 100644 src/newsreader/templates/components/form/label.html diff --git a/src/newsreader/accounts/templates/accounts/components/login-form.html b/src/newsreader/accounts/templates/accounts/components/login-form.html index d09974a..87dceb9 100644 --- a/src/newsreader/accounts/templates/accounts/components/login-form.html +++ b/src/newsreader/accounts/templates/accounts/components/login-form.html @@ -10,7 +10,7 @@
- I forgot my password + {% trans "I forgot my password" %}
diff --git a/src/newsreader/templates/components/form/form.html b/src/newsreader/templates/components/form/form.html index 3c729ae..d854eb1 100644 --- a/src/newsreader/templates/components/form/form.html +++ b/src/newsreader/templates/components/form/form.html @@ -22,13 +22,11 @@ {% for field in form.visible_fields %}
- + {% include "components/form/label.html" %} {{ field.errors }} {{ field }} - {{ field.help_text }} + {% include "components/form/help-text.html" %}
{% endfor %} diff --git a/src/newsreader/templates/components/form/help-text.html b/src/newsreader/templates/components/form/help-text.html new file mode 100644 index 0000000..eb02d82 --- /dev/null +++ b/src/newsreader/templates/components/form/help-text.html @@ -0,0 +1 @@ +{{ field.help_text }} diff --git a/src/newsreader/templates/components/form/label.html b/src/newsreader/templates/components/form/label.html new file mode 100644 index 0000000..4058b29 --- /dev/null +++ b/src/newsreader/templates/components/form/label.html @@ -0,0 +1,3 @@ +