From e70d035c8613b80b652591fd0989ee28ba147dc3 Mon Sep 17 00:00:00 2001 From: Philippe Loctaux Date: Mon, 1 May 2023 11:43:17 +0200 Subject: [PATCH] disable button and delay form submit: refactor in tera macro --- .../templates/pages/oauth/authorize.html.tera | 28 ++++++------------- crates/ezidam/templates/utils/form.html.tera | 20 +++++++++++++ 2 files changed, 28 insertions(+), 20 deletions(-) create mode 100644 crates/ezidam/templates/utils/form.html.tera diff --git a/crates/ezidam/templates/pages/oauth/authorize.html.tera b/crates/ezidam/templates/pages/oauth/authorize.html.tera index f9ac1df..7501c44 100644 --- a/crates/ezidam/templates/pages/oauth/authorize.html.tera +++ b/crates/ezidam/templates/pages/oauth/authorize.html.tera @@ -1,6 +1,7 @@ {% extends "base" %} {% import "utils/user" as user %} +{% import "utils/form" as form %} {% block page %} @@ -38,14 +39,16 @@ {% else %}
- - Login +
- +
-
@@ -72,22 +75,7 @@ - +{{ form::disable_button_delay_submit(form_id="authorize_form") }} {% endblock page %} diff --git a/crates/ezidam/templates/utils/form.html.tera b/crates/ezidam/templates/utils/form.html.tera new file mode 100644 index 0000000..81215f2 --- /dev/null +++ b/crates/ezidam/templates/utils/form.html.tera @@ -0,0 +1,20 @@ +{% macro disable_button_delay_submit(form_id) %} + +{% endmacro disable_button_delay_submit %}