admin page updates

This commit is contained in:
2026-02-13 20:51:39 +11:00
parent f51053212e
commit 295e373f37
34 changed files with 1737 additions and 164 deletions

View File

@@ -21,10 +21,13 @@ type ValidationRule struct {
// Getter abstracts getting values from either form or query
type Getter interface {
Get(key string) string
GetList(key string) []string
AddCheck(check *ValidationRule)
String(key string) *StringField
Int(key string) *IntField
Time(key string, format *timefmt.Format) *TimeField
StringList(key string) *StringList
IntList(key string) *IntList
ValidateChecks() []*ValidationRule
Validate() bool
ValidateAndNotify(s *hws.Server, w http.ResponseWriter, r *http.Request) bool
@@ -32,14 +35,14 @@ type Getter interface {
getChecks() []*ValidationRule
}
type Field struct {
type FieldBase struct {
Key string
optional bool
getter Getter
}
func newField(key string, g Getter) Field {
return Field{
func newField(key string, g Getter) FieldBase {
return FieldBase{
Key: key,
getter: g,
}