From 69f0d266f41b04a0f0c59595640ace20efca2cdc Mon Sep 17 00:00:00 2001 From: Nils Rokita <0rokita@informatik.uni-hamburg.de> Date: Sun, 5 Jul 2020 13:41:56 +0200 Subject: [PATCH] fix comments from review --- README.md | 16 ++++++++++++++-- .../{form-haeder.html => form-header.html} | 0 .../templates/spectre-css/form.html | 2 +- .../spectre-css/render-multi-field-part.html | 2 +- django-spectre-css/templatetags/spectre_css.py | 6 +++--- .../templatetags/widget_tweaks_extras.py | 1 - 6 files changed, 19 insertions(+), 8 deletions(-) rename django-spectre-css/templates/spectre-css/{form-haeder.html => form-header.html} (100%) diff --git a/README.md b/README.md index 7ffe737..8c0ee6f 100644 --- a/README.md +++ b/README.md @@ -20,10 +20,22 @@ add it to your installed apps: 'django-spectre-css', ] -## Examples: -This module defines the following tags to make displaying Forms easier. +## Warning The help_text from models is marked as save in the template and therefore it is possible to have html e.g. links in the help_text. +This means that help_text of an ModelField should never be directly based on user input. + +## Examples: +This module defines the following tags to make displaying forms easier. + +- render the form header (csrf-token and non-field errors) for the form 'form': + + + {% load spectre_css %} +
- render a field user of the form 'form': diff --git a/django-spectre-css/templates/spectre-css/form-haeder.html b/django-spectre-css/templates/spectre-css/form-header.html similarity index 100% rename from django-spectre-css/templates/spectre-css/form-haeder.html rename to django-spectre-css/templates/spectre-css/form-header.html diff --git a/django-spectre-css/templates/spectre-css/form.html b/django-spectre-css/templates/spectre-css/form.html index 377fa04..582cbb3 100644 --- a/django-spectre-css/templates/spectre-css/form.html +++ b/django-spectre-css/templates/spectre-css/form.html @@ -1,6 +1,6 @@ {% load widget_tweaks %} -{% include 'spectre-css/form-haeder.html' %} +{% include 'spectre-css/form-header.html' %} {% for field in form.visible_fields %} {% include 'spectre-css/generic-field.html' with field=field %} diff --git a/django-spectre-css/templates/spectre-css/render-multi-field-part.html b/django-spectre-css/templates/spectre-css/render-multi-field-part.html index 7bd1e61..a28f57c 100644 --- a/django-spectre-css/templates/spectre-css/render-multi-field-part.html +++ b/django-spectre-css/templates/spectre-css/render-multi-field-part.html @@ -3,7 +3,7 @@ {% render_multi_field field index class+=additional_class class+=field_class id=field_id %} {% else %}