add checkbox reading to dialog & login

This commit is contained in:
2025-09-27 23:11:51 -06:00
parent 9427535eb5
commit 56792596bb
2 changed files with 11 additions and 1 deletions
+3 -1
View File
@@ -83,7 +83,9 @@ func Login(ctxt ui.AmContext) (string, any, error) {
return dlg.RenderError(ctxt, uerr.Error()) return dlg.RenderError(ctxt, uerr.Error())
} }
ctxt.ReplaceUser(user) ctxt.ReplaceUser(user)
// TODO: cookie set if required if dlg.Field("saveme").IsChecked() {
// TODO: cookie set
}
// TODO: bounce to E-mail verify if we can do so // TODO: bounce to E-mail verify if we can do so
return "redirect", target, nil return "redirect", target, nil
} }
+8
View File
@@ -87,6 +87,14 @@ func (fld *DialogItem) DateValues() []int {
return rc return rc
} }
// IsChecked returns true if a dialog checkbox is checked.
func (fld *DialogItem) IsChecked() bool {
if fld.Type == "checkbox" {
return len(fld.Value) > 0
}
return false
}
/* Field returns a pointer to a dialog's field, given its name. /* Field returns a pointer to a dialog's field, given its name.
* Parameters: * Parameters:
* name - The name of the field to find. * name - The name of the field to find.