Pages now work

Default Pages
Created & Updated Fields for every collection
This commit is contained in:
Simon Martens
2025-02-16 20:41:36 +01:00
parent 993e99f6dc
commit eb4bffdeec
37 changed files with 1276 additions and 10 deletions

View File

@@ -9,7 +9,7 @@ func BasePageCollection(pagename string) *core.Collection {
c := core.NewBaseCollection(GeneratePageTableName(pagename))
c.ListRule = dbmodels.PUBLIC_LIST_RULE
c.ViewRule = dbmodels.PUBLIC_VIEW_RULE
c.Fields = StandardPageFields()
c.Fields = append(c.Fields, StandardPageFields()...)
return c
}
@@ -19,6 +19,8 @@ func StandardPageFields() core.FieldsList {
EditorField(F_DESCRIPTION),
TextField(F_TAGS),
)
ret = append(ret, CreatedUpdatedFields()...)
return ret
}
@@ -63,3 +65,10 @@ func RequiredImageField(name string, multiselect bool) *core.FileField {
Thumbs: []string{"0x300", "0x500", "0x1000", "300x0", "500x0", "1000x0"},
}
}
func CreatedUpdatedFields() core.FieldsList {
return core.NewFieldsList(
&core.AutodateField{Name: dbmodels.CREATED_FIELD, OnCreate: true},
&core.AutodateField{Name: dbmodels.UPDATED_FIELD, OnCreate: true, OnUpdate: true},
)
}