mirror of
https://github.com/Theodor-Springmann-Stiftung/musenalm.git
synced 2025-10-29 17:25:32 +00:00
Pages now work
Default Pages Created & Updated Fields for every collection
This commit is contained in:
@@ -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},
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user