This commit is contained in:
@@ -104,6 +104,11 @@ type threadPostCtx struct {
|
||||
Depth int
|
||||
}
|
||||
|
||||
type imagePickerCtx struct {
|
||||
ID string
|
||||
Images []store.PostImage
|
||||
}
|
||||
|
||||
func New(st store.Store, sessionStore scs.Store, templateFS fs.FS, staticFS fs.FS, cfg Config) (*Server, error) {
|
||||
if cfg.Blob == nil {
|
||||
cfg.Blob = blob.Disabled{}
|
||||
@@ -118,6 +123,12 @@ func New(st store.Store, sessionStore scs.Store, templateFS fs.FS, staticFS fs.F
|
||||
"postCtx": func(user *store.User, csrf string, root, post *store.Post, depth int) threadPostCtx {
|
||||
return threadPostCtx{User: user, CSRF: csrf, Root: root, Post: post, Depth: depth}
|
||||
},
|
||||
"imagePicker": func(id string, images []store.PostImage) imagePickerCtx {
|
||||
return imagePickerCtx{ID: id, Images: images}
|
||||
},
|
||||
"newImagePicker": func(id string) imagePickerCtx {
|
||||
return imagePickerCtx{ID: id}
|
||||
},
|
||||
"add": func(a, b int) int { return a + b },
|
||||
"rank": func(i int) int { return i + 1 },
|
||||
"isAdmin": func(u *store.User) bool { return u.Admin() },
|
||||
|
||||
Reference in New Issue
Block a user