From ab8e92b36463e2592469cdd137b09ce43c75c33f Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Thu, 6 Jul 2023 16:00:30 +0200 Subject: 💄 wizards: validate forms with CTRL+ENTER MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../templates/ishtar/wizard/wizard_person_orga.html | 2 +- changelog/en/changelog_2022-06-15.md | 4 ++++ changelog/fr/changelog_2023-01-25.md | 4 ++++ ishtar_common/templates/ishtar/wizard/confirm_wizard.html | 11 ++++++++++- ishtar_common/templates/ishtar/wizard/default_wizard.html | 5 +++++ ishtar_common/templates/ishtar/wizard/relations_wizard.html | 2 +- ishtar_common/templates/ishtar/wizard/towns_wizard.html | 2 +- 7 files changed, 26 insertions(+), 4 deletions(-) diff --git a/archaeological_files/templates/ishtar/wizard/wizard_person_orga.html b/archaeological_files/templates/ishtar/wizard/wizard_person_orga.html index 36f1aa4f8..39b4a7762 100644 --- a/archaeological_files/templates/ishtar/wizard/wizard_person_orga.html +++ b/archaeological_files/templates/ishtar/wizard/wizard_person_orga.html @@ -17,7 +17,7 @@ $(function() { update_form(); }); -
{% csrf_token %} +{% csrf_token %}
{% if wizard.form.media %}{{ wizard.form.media }}{% endif %} {{ wizard.management_form }} diff --git a/changelog/en/changelog_2022-06-15.md b/changelog/en/changelog_2022-06-15.md index 257529eb7..678dfd1d8 100644 --- a/changelog/en/changelog_2022-06-15.md +++ b/changelog/en/changelog_2022-06-15.md @@ -1,8 +1,12 @@ v4.0.53 - 2999-12-31 -------------------- +### Features/improvements ### +- wizards: validate forms with CTRL+ENTER + ### Bug fixes ### - wizards: fix autofocus of first field +- do not overload when no complete_id is available v4.0.52 - 2023-07-06 -------------------- diff --git a/changelog/fr/changelog_2023-01-25.md b/changelog/fr/changelog_2023-01-25.md index 80aeb3df0..3bf424d58 100644 --- a/changelog/fr/changelog_2023-01-25.md +++ b/changelog/fr/changelog_2023-01-25.md @@ -1,8 +1,12 @@ v4.0.53 - 2999-12-31 -------------------- +### Fonctionnalités/améliorations ### +- `wizards` : validation des formulaires avec CTRL+ENTER + ### Corrections de dysfonctionnements ### - correction de l'autofocus du premier champ +- ne pas surcharger les identifiants complets quand ils sont vides v4.0.52 - 2023-07-06 -------------------- diff --git a/ishtar_common/templates/ishtar/wizard/confirm_wizard.html b/ishtar_common/templates/ishtar/wizard/confirm_wizard.html index e4fd739f6..1f0d0e4d9 100644 --- a/ishtar_common/templates/ishtar/wizard/confirm_wizard.html +++ b/ishtar_common/templates/ishtar/wizard/confirm_wizard.html @@ -5,7 +5,7 @@ {% include "ishtar/blocks/wizard_breadcrumb.html" %} -{% csrf_token %} +{% csrf_token %}
{% block "warning_informations" %}{% endblock %} {% block "warning_message" %} @@ -62,4 +62,13 @@
+ {% endblock %} diff --git a/ishtar_common/templates/ishtar/wizard/default_wizard.html b/ishtar_common/templates/ishtar/wizard/default_wizard.html index 405c52965..fcc020816 100644 --- a/ishtar_common/templates/ishtar/wizard/default_wizard.html +++ b/ishtar_common/templates/ishtar/wizard/default_wizard.html @@ -66,6 +66,11 @@ $(document).ready(function(){ {% block "js_extra_ready" %} {% endblock %} if ($("[autofocus]").length > 0) autofocus_field = "#" + $($("[autofocus]")[0]).attr('id'); + $(".wizard-form").keydown(function(e){ + if (e.ctrlKey && e.keyCode == 13) { + $("#submit_form").click(); + } + }); }); {% endlocalize %} {% endblock %} diff --git a/ishtar_common/templates/ishtar/wizard/relations_wizard.html b/ishtar_common/templates/ishtar/wizard/relations_wizard.html index c22b58f3d..df61502e2 100644 --- a/ishtar_common/templates/ishtar/wizard/relations_wizard.html +++ b/ishtar_common/templates/ishtar/wizard/relations_wizard.html @@ -4,7 +4,7 @@ {{wizard.form.media}} {% endblock %} {% block wizard_form %} -
{% csrf_token %} +{% csrf_token %}
{{ wizard.form.media }} {{ wizard.management_form }} diff --git a/ishtar_common/templates/ishtar/wizard/towns_wizard.html b/ishtar_common/templates/ishtar/wizard/towns_wizard.html index 889108f32..022fcdb4f 100644 --- a/ishtar_common/templates/ishtar/wizard/towns_wizard.html +++ b/ishtar_common/templates/ishtar/wizard/towns_wizard.html @@ -5,7 +5,7 @@ {{wizard.form.media}} {% endblock %} {% block wizard_form %} -{% csrf_token %} +{% csrf_token %}
{% if TOWNS %} {% if wizard.form.forms %} -- cgit v1.2.3