This commit is contained in:
Your Name 2024-10-08 18:36:46 -04:00
parent 27312054ee
commit 9872d69495
4 changed files with 10 additions and 14 deletions

View File

@ -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 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}
{"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":"px-1 py-2","LabelClasses":"text-sm font-medium leading-6 text-gray-900","InputClasses":"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}

View File

@ -35,10 +35,10 @@ func mwLog(next http.Handler) http.Handler {
func main() {
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.ItemClasses = "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 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.LabelClasses = "text-sm font-medium leading-6 text-gray-900"
forms.GlobalStyles.InputClasses = "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"

View File

@ -722,10 +722,6 @@ select {
right: 0.75rem;
}
.block {
display: block;
}
.inline {
display: inline;
}

View File

@ -2,23 +2,23 @@
<link href="style.css" rel="stylesheet" />
</head>
<body class="h-full">
<form class='w-full px-1 py-2' action='/chpass/changepassword' method='post' enctype='multipart/form-data'>
<form class='px-1 py-2' action='/chpass/changepassword' method='post' enctype='multipart/form-data'>
<div class='display-none text-red-600 text-right font-bold text-xl'></div>
<div class=' bg-gray-200 justify-center py-6 rounded-lg shadow-lg'>
<!-- element order 1 forms.element{Name:"email", Label:"Email Address", LabelClasses:"", InputClasses:"", Type:"text", Hint:"", Required:false, Classes:"", Validator:"email", vreg:(*regexp.Regexp)(nil), valid:false, FailMessage:"Must be a valid email address", Value:"", Autocomplete:"off", Order:1, OnClick:"", Choices:[]forms.choice(nil)}-->
<div class='w-full px-1 py-2'><label for='email'class='block text-sm font-medium leading-6 text-gray-900'>Email Address</label><input type='text' autocomplete='off' name='email' class='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' value=''></div>
<div class='px-1 py-2'><label for='email'class='text-sm font-medium leading-6 text-gray-900'>Email Address</label><input type='text' autocomplete='off' name='email' class='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' value=''></div>
<div class='text-red-600 text-right font-bold text-xl' for='email' ><span class='error'>Must be a valid email address</span></div>
<!-- element order 2 forms.element{Name:"oldpassword", Label:"Old Password", LabelClasses:"", InputClasses:"", Type:"password", Hint:"", Required:false, Classes:"", Validator:"", vreg:(*regexp.Regexp)(nil), valid:false, FailMessage:"Passsword Incorrect", Value:"", Autocomplete:"off", Order:2, OnClick:"", Choices:[]forms.choice(nil)}-->
<div class='relative w-full px-1 py-2'><label for='oldpassword' class='block text-sm font-medium leading-6 text-gray-900'>Old Password</label><input id='input-oldpassword' autocomplete='off' type='password' name='oldpassword' class='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' value=''><button class='absolute inline right-3' type="button" onClick='togglePassword("input-oldpassword")'><svg class="svg-icon" style="width: 1.6em; height: 1.6em;vertical-align: middle;fill: currentColor;overflow: hidden;" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M1024 512c0 96-211.2 307.2-512 307.2-294.4 0-512-204.8-512-307.2s217.6-307.2 512-307.2c300.8 0 512 204.8 512 307.2l0 0zM512 262.4c-134.4 0-243.2 108.8-243.2 249.6s108.8 249.6 249.6 249.6c134.4 0 249.6-115.2 249.6-249.6-6.4-140.8-121.6-249.6-256-249.6l0 0zM512 352c-89.6 0-160 70.4-160 160s70.4 160 160 160c89.6 0 160-70.4 160-160s-70.4-160-160-160l0 0z" /></svg></div>
<div class='relative px-1 py-2'><label for='oldpassword' class='text-sm font-medium leading-6 text-gray-900'>Old Password</label><input id='input-oldpassword' autocomplete='off' type='password' name='oldpassword' class='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' value=''><button class='absolute inline right-3' type="button" onClick='togglePassword("input-oldpassword")'><svg class="svg-icon" style="width: 1.6em; height: 1.6em;vertical-align: middle;fill: currentColor;overflow: hidden;" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M1024 512c0 96-211.2 307.2-512 307.2-294.4 0-512-204.8-512-307.2s217.6-307.2 512-307.2c300.8 0 512 204.8 512 307.2l0 0zM512 262.4c-134.4 0-243.2 108.8-243.2 249.6s108.8 249.6 249.6 249.6c134.4 0 249.6-115.2 249.6-249.6-6.4-140.8-121.6-249.6-256-249.6l0 0zM512 352c-89.6 0-160 70.4-160 160s70.4 160 160 160c89.6 0 160-70.4 160-160s-70.4-160-160-160l0 0z" /></svg></div>
<div class='text-red-600 text-right font-bold text-xl' for='oldpassword' ><span class='error'>Passsword Incorrect</span></div>
<!-- element order 3 forms.element{Name:"newpassword", Label:"New Password", LabelClasses:"", InputClasses:"", Type:"password", Hint:"", Required:false, Classes:"", Validator:"minlength=8;haslowercase;hasuppercase;hasdigit", vreg:(*regexp.Regexp)(nil), valid:false, 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:[]forms.choice(nil)}-->
<div class='relative w-full px-1 py-2'><label for='newpassword' class='block text-sm font-medium leading-6 text-gray-900'>New Password</label><input id='input-newpassword' autocomplete='off' type='password' name='newpassword' class='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' value=''><button class='absolute inline right-3' type="button" onClick='togglePassword("input-newpassword")'><svg class="svg-icon" style="width: 1.6em; height: 1.6em;vertical-align: middle;fill: currentColor;overflow: hidden;" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M1024 512c0 96-211.2 307.2-512 307.2-294.4 0-512-204.8-512-307.2s217.6-307.2 512-307.2c300.8 0 512 204.8 512 307.2l0 0zM512 262.4c-134.4 0-243.2 108.8-243.2 249.6s108.8 249.6 249.6 249.6c134.4 0 249.6-115.2 249.6-249.6-6.4-140.8-121.6-249.6-256-249.6l0 0zM512 352c-89.6 0-160 70.4-160 160s70.4 160 160 160c89.6 0 160-70.4 160-160s-70.4-160-160-160l0 0z" /></svg></div>
<div class='relative px-1 py-2'><label for='newpassword' class='text-sm font-medium leading-6 text-gray-900'>New Password</label><input id='input-newpassword' autocomplete='off' type='password' name='newpassword' class='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' value=''><button class='absolute inline right-3' type="button" onClick='togglePassword("input-newpassword")'><svg class="svg-icon" style="width: 1.6em; height: 1.6em;vertical-align: middle;fill: currentColor;overflow: hidden;" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M1024 512c0 96-211.2 307.2-512 307.2-294.4 0-512-204.8-512-307.2s217.6-307.2 512-307.2c300.8 0 512 204.8 512 307.2l0 0zM512 262.4c-134.4 0-243.2 108.8-243.2 249.6s108.8 249.6 249.6 249.6c134.4 0 249.6-115.2 249.6-249.6-6.4-140.8-121.6-249.6-256-249.6l0 0zM512 352c-89.6 0-160 70.4-160 160s70.4 160 160 160c89.6 0 160-70.4 160-160s-70.4-160-160-160l0 0z" /></svg></div>
<div class='text-red-600 text-right font-bold text-xl' for='newpassword' ><span class='error'>Password must be at least 8 characters long and contain at least one uppercase letter, one lowercase letter and one digit</span></div>
<!-- element order 4 forms.element{Name:"confirmpassword", Label:"Confirm Password", LabelClasses:"", InputClasses:"", Type:"password", Hint:"", Required:false, Classes:"", Validator:"mustmatch=newpassword", vreg:(*regexp.Regexp)(nil), valid:false, FailMessage:"Passwords do not match", Value:"", Autocomplete:"off", Order:4, OnClick:"", Choices:[]forms.choice(nil)}-->
<div class='relative w-full px-1 py-2'><label for='confirmpassword' class='block text-sm font-medium leading-6 text-gray-900'>Confirm Password</label><input id='input-confirmpassword' autocomplete='off' type='password' name='confirmpassword' class='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' value=''><button class='absolute inline right-3' type="button" onClick='togglePassword("input-confirmpassword")'><svg class="svg-icon" style="width: 1.6em; height: 1.6em;vertical-align: middle;fill: currentColor;overflow: hidden;" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M1024 512c0 96-211.2 307.2-512 307.2-294.4 0-512-204.8-512-307.2s217.6-307.2 512-307.2c300.8 0 512 204.8 512 307.2l0 0zM512 262.4c-134.4 0-243.2 108.8-243.2 249.6s108.8 249.6 249.6 249.6c134.4 0 249.6-115.2 249.6-249.6-6.4-140.8-121.6-249.6-256-249.6l0 0zM512 352c-89.6 0-160 70.4-160 160s70.4 160 160 160c89.6 0 160-70.4 160-160s-70.4-160-160-160l0 0z" /></svg></div>
<div class='relative px-1 py-2'><label for='confirmpassword' class='text-sm font-medium leading-6 text-gray-900'>Confirm Password</label><input id='input-confirmpassword' autocomplete='off' type='password' name='confirmpassword' class='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' value=''><button class='absolute inline right-3' type="button" onClick='togglePassword("input-confirmpassword")'><svg class="svg-icon" style="width: 1.6em; height: 1.6em;vertical-align: middle;fill: currentColor;overflow: hidden;" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M1024 512c0 96-211.2 307.2-512 307.2-294.4 0-512-204.8-512-307.2s217.6-307.2 512-307.2c300.8 0 512 204.8 512 307.2l0 0zM512 262.4c-134.4 0-243.2 108.8-243.2 249.6s108.8 249.6 249.6 249.6c134.4 0 249.6-115.2 249.6-249.6-6.4-140.8-121.6-249.6-256-249.6l0 0zM512 352c-89.6 0-160 70.4-160 160s70.4 160 160 160c89.6 0 160-70.4 160-160s-70.4-160-160-160l0 0z" /></svg></div>
<div class='text-red-600 text-right font-bold text-xl' for='confirmpassword' ><span class='error'>Passwords do not match</span></div>
<!-- element order 5 forms.element{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:"", vreg:(*regexp.Regexp)(nil), valid:false, FailMessage:"", Value:"", Autocomplete:"off", Order:5, OnClick:"", Choices:[]forms.choice(nil)}-->
<div class='w-full px-1 py-2'><button type='submit' class='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'><span class='block text-sm font-medium leading-6 text-gray-900'>Change Password</span></button></div>
<div class='px-1 py-2'><button type='submit' class='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'><span class='text-sm font-medium leading-6 text-gray-900'>Change Password</span></button></div>
<div class='text-red-600 text-right font-bold text-xl' for=''><span class='error'>Invalid entry.</span></div>
</div></form>
<script>function togglePassword(f) { var a=document.getElementById(f); if (a.type=="password") a.type="text"; else a.type="password"; }</script>