From 42a82fcc63017584d675f59f244b9e1d5a3b8d99 Mon Sep 17 00:00:00 2001 From: Julien BERNARD Date: Fri, 3 Sep 2021 10:51:35 -0400 Subject: [PATCH] Move some javascript in base template and allow erasing email inputs --- .../lgr_editor/templates/lgr_editor/_form_field.html | 7 +------ src/lgr_web/templates/_base.html | 4 ++++ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/lgr_advanced/lgr_editor/templates/lgr_editor/_form_field.html b/src/lgr_advanced/lgr_editor/templates/lgr_editor/_form_field.html index 9c61768c..4b5bc89e 100644 --- a/src/lgr_advanced/lgr_editor/templates/lgr_editor/_form_field.html +++ b/src/lgr_advanced/lgr_editor/templates/lgr_editor/_form_field.html @@ -3,7 +3,7 @@
{{ field|add_class:"form-control" }} - {% if field.field.widget.input_type == 'text' %} + {% if field.field.widget.input_type == 'text' or field.field.widget.input_type == 'email' %} {% endif %} {% if field.errors %} @@ -17,8 +17,3 @@ {% endif %}
- \ No newline at end of file diff --git a/src/lgr_web/templates/_base.html b/src/lgr_web/templates/_base.html index c3ae5c98..5fafa492 100644 --- a/src/lgr_web/templates/_base.html +++ b/src/lgr_web/templates/_base.html @@ -149,6 +149,10 @@ } return confirm(msg); } + + function cleanInput (input) { + input.closest('.col').find('input').val(''); + } {% block html_body_more %}{% endblock %}