From a5a8c48f3c15cb3c31cd5d2cfedd77a80cc48057 Mon Sep 17 00:00:00 2001 From: Ryan Irelan Date: Fri, 14 Jun 2024 15:28:37 -0500 Subject: [PATCH] Fixed Sprig errors - removed sprig script - updated success and error checking conditonals --- .../_components/forgot-password-form.twig | 36 +++++++++------- templates/_components/register-form.twig | 42 ++++++++++++++----- templates/_components/set-password-form.twig | 19 +++++---- templates/dashboard/index.twig | 2 +- templates/forgot-password.twig | 3 -- templates/register.twig | 3 -- templates/setpassword.twig | 3 -- 7 files changed, 65 insertions(+), 43 deletions(-) diff --git a/templates/_components/forgot-password-form.twig b/templates/_components/forgot-password-form.twig index 5a278b9..3f89620 100644 --- a/templates/_components/forgot-password-form.twig +++ b/templates/_components/forgot-password-form.twig @@ -7,36 +7,44 @@ Your Account Email Address
- +
- - {% if errors is defined %} -
-
-
- {{ forms.errorsList(errors) }} + {% if sprig.isError %} + {% if errors is defined %} +
+
+
+ {{ forms.errorsList(errors) }} +
-
- + {% endif %} {% endif %} - {% if success is defined and success %} + {% if sprig.isSuccess %}

- We just sent an email to your account email address. Use the link in the email to reset your password. + We just sent an email to your account email address. Use the link in the email to + reset your password.

diff --git a/templates/_components/register-form.twig b/templates/_components/register-form.twig index 97d3f82..a3ef66f 100644 --- a/templates/_components/register-form.twig +++ b/templates/_components/register-form.twig @@ -9,7 +9,9 @@ First Name
- +
{{ user ? forms.errorsList(user.getErrors('firstName')) }}
@@ -18,7 +20,9 @@ Last Name
- +
{{ user ? forms.errorsList(user.getErrors('lastName')) }}
@@ -27,7 +31,9 @@ Email
- +
{{ user ? forms.errorsList(user.getErrors('email')) }}
@@ -37,26 +43,42 @@ Password
- +
{{ user ? forms.errorsList(user.getErrors('password')) }}
- - {% if success is defined and success %} + {% if sprig.isSuccess %}

- We created your account! Please check your email to verify your email address before logging in. + We created your account! Please check your email to verify your email address before + logging in. +

+
+
+
+ {% elseif sprig.isError %} +
+
+
+

+ Oh, no! There was a problem creating your account.

diff --git a/templates/_components/set-password-form.twig b/templates/_components/set-password-form.twig index 77303e9..c7eca7c 100644 --- a/templates/_components/set-password-form.twig +++ b/templates/_components/set-password-form.twig @@ -29,6 +29,7 @@
Submit New Password + {% if sprig.isError %} {% if errors is defined %}
@@ -37,18 +38,18 @@
- {% endif %} - - {% if success is defined and success %} -
-
-
-

- Your password was reset and you're logged in! Access the dashboard to continue with your account.

-
+
+ {% endif %} + {% if sprig.isSuccess %} +
+
+

+ Your password was reset and you're logged in! Access + the dashboard to continue with your account.

+
{% endif %}
diff --git a/templates/dashboard/index.twig b/templates/dashboard/index.twig index 35ff791..87ac0af 100644 --- a/templates/dashboard/index.twig +++ b/templates/dashboard/index.twig @@ -6,7 +6,7 @@
- CraftQuest + CraftQuest