From 27312054eeedb260a20544e8dcfd1923b3364785 Mon Sep 17 00:00:00 2001 From: Your Name Date: Tue, 8 Oct 2024 18:35:47 -0400 Subject: [PATCH] full --- form.json | 2 +- main.go | 4 ++-- test.html | 10 +++++----- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/form.json b/form.json index 5a1544a..97cf394 100644 --- a/form.json +++ b/form.json @@ -1 +1 @@ -{"Elements":[{"Name":"email","Label":"Email Address","LabelClasses":"","InputClasses":"","Type":"text","Hint":"","Required":false,"Classes":"","Validator":"email","FailMessage":"Must be a valid email address","Value":"","Autocomplete":"off","Order":1,"OnClick":"","Choices":null},{"Name":"oldpassword","Label":"Old Password","LabelClasses":"","InputClasses":"","Type":"password","Hint":"","Required":false,"Classes":"","Validator":"","FailMessage":"Passsword Incorrect","Value":"","Autocomplete":"off","Order":2,"OnClick":"","Choices":null},{"Name":"newpassword","Label":"New Password","LabelClasses":"","InputClasses":"","Type":"password","Hint":"","Required":false,"Classes":"","Validator":"minlength=8;haslowercase;hasuppercase;hasdigit","FailMessage":"Password must be at least 8 characters long and contain at least one uppercase letter, one lowercase letter and one digit","Value":"","Autocomplete":"off","Order":3,"OnClick":"","Choices":null},{"Name":"confirmpassword","Label":"Confirm Password","LabelClasses":"","InputClasses":"","Type":"password","Hint":"","Required":false,"Classes":"","Validator":"mustmatch=newpassword","FailMessage":"Passwords do not match","Value":"","Autocomplete":"off","Order":4,"OnClick":"","Choices":null},{"Name":"","Label":"Change Password","LabelClasses":"","InputClasses":"flex w-full justify-center rounded-md bg-indigo-600 px-3 py-1.5 text-sm font-semibold leading-6 text-white shadow-sm hover:bg-indigo-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600","Type":"submit","Hint":"","Required":false,"Classes":"","Validator":"","FailMessage":"","Value":"","Autocomplete":"off","Order":5,"OnClick":"","Choices":null}],"Route":"/chpass/changepassword","Classes":"w-full px-1 py-2","LabelClasses":"block text-sm font-medium leading-6 text-gray-900","InputClasses":"block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-indigo-600 sm:text-sm sm:leading-6","ErrorClasses":"text-red-600 text-right font-bold text-xl","ContainerClasses":"w-full bg-gray-200 justify-center py-6 rounded-lg shadow-lg","Editable":true} \ No newline at end of file +{"Elements":[{"Name":"email","Label":"Email Address","LabelClasses":"","InputClasses":"","Type":"text","Hint":"","Required":false,"Classes":"","Validator":"email","FailMessage":"Must be a valid email address","Value":"","Autocomplete":"off","Order":1,"OnClick":"","Choices":null},{"Name":"oldpassword","Label":"Old Password","LabelClasses":"","InputClasses":"","Type":"password","Hint":"","Required":false,"Classes":"","Validator":"","FailMessage":"Passsword Incorrect","Value":"","Autocomplete":"off","Order":2,"OnClick":"","Choices":null},{"Name":"newpassword","Label":"New Password","LabelClasses":"","InputClasses":"","Type":"password","Hint":"","Required":false,"Classes":"","Validator":"minlength=8;haslowercase;hasuppercase;hasdigit","FailMessage":"Password must be at least 8 characters long and contain at least one uppercase letter, one lowercase letter and one digit","Value":"","Autocomplete":"off","Order":3,"OnClick":"","Choices":null},{"Name":"confirmpassword","Label":"Confirm Password","LabelClasses":"","InputClasses":"","Type":"password","Hint":"","Required":false,"Classes":"","Validator":"mustmatch=newpassword","FailMessage":"Passwords do not match","Value":"","Autocomplete":"off","Order":4,"OnClick":"","Choices":null},{"Name":"","Label":"Change Password","LabelClasses":"","InputClasses":"flex w-full justify-center rounded-md bg-indigo-600 px-3 py-1.5 text-sm font-semibold leading-6 text-white shadow-sm hover:bg-indigo-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600","Type":"submit","Hint":"","Required":false,"Classes":"","Validator":"","FailMessage":"","Value":"","Autocomplete":"off","Order":5,"OnClick":"","Choices":null}],"Route":"/chpass/changepassword","Classes":"w-full px-1 py-2","LabelClasses":"block text-sm font-medium leading-6 text-gray-900","InputClasses":"block rounded-md border-0 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-indigo-600 sm:text-sm sm:leading-6","ErrorClasses":"text-red-600 text-right font-bold text-xl","ContainerClasses":" bg-gray-200 justify-center py-6 rounded-lg shadow-lg","Editable":true} \ No newline at end of file diff --git a/main.go b/main.go index 9215efe..dca0f51 100644 --- a/main.go +++ b/main.go @@ -34,11 +34,11 @@ func mwLog(next http.Handler) http.Handler { func main() { - forms.GlobalStyles.ContainerClasses = "w-full bg-gray-200 justify-center py-6 rounded-lg shadow-lg" + forms.GlobalStyles.ContainerClasses = " bg-gray-200 justify-center py-6 rounded-lg shadow-lg" forms.GlobalStyles.ItemClasses = "w-full px-1 py-2" forms.GlobalStyles.ErrorClasses = "text-red-600 text-right font-bold text-xl" forms.GlobalStyles.LabelClasses = "block text-sm font-medium leading-6 text-gray-900" - forms.GlobalStyles.InputClasses = "block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-indigo-600 sm:text-sm sm:leading-6" + forms.GlobalStyles.InputClasses = "block rounded-md border-0 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-indigo-600 sm:text-sm sm:leading-6" f := forms.NewForm() e := forms.NewElement() e.Label = "Email Address" diff --git a/test.html b/test.html index c092624..43c2ead 100644 --- a/test.html +++ b/test.html @@ -4,18 +4,18 @@
-
+
-
+
Must be a valid email address
-
+
Passsword Incorrect
-
+
Password must be at least 8 characters long and contain at least one uppercase letter, one lowercase letter and one digit
-
+
Passwords do not match