Skip to content

Commit

Permalink
fix(lifecycle): update lifecycle functions
Browse files Browse the repository at this point in the history
  • Loading branch information
rande committed Oct 31, 2023
1 parent 28ff5e3 commit 59255e4
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 10 deletions.
6 changes: 5 additions & 1 deletion core/form/form_app.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,13 @@ import (

func Configure(l *goapp.Lifecycle, conf *config.Config) {

l.Prepare(func(app *goapp.App) error {
l.Register(func(app *goapp.App) error {
app.Get("gonode.embeds").(*embed.Embeds).Add("form", GetEmbedFS())

return nil
})

l.Prepare(func(app *goapp.App) error {
pongo := app.Get("gonode.pongo").(*pongo2.TemplateSet)

pongo.Globals["form_field"] = createPongoField(pongo)
Expand Down
2 changes: 1 addition & 1 deletion modules/blog/blog_app.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func Configure(l *goapp.Lifecycle, conf *config.Config) {
return nil
})

l.Prepare(func(app *goapp.App) error {
l.Register(func(app *goapp.App) error {
app.Get("gonode.embeds").(*embed.Embeds).Add("blog", GetEmbedFS())

return nil
Expand Down
2 changes: 1 addition & 1 deletion modules/bootstrap/bootstrap_app.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (

func Configure(l *goapp.Lifecycle, conf *config.Config) {

l.Prepare(func(app *goapp.App) error {
l.Register(func(app *goapp.App) error {
app.Get("gonode.embeds").(*embed.Embeds).Add("bootstrap", GetEmbedFS())

return nil
Expand Down
4 changes: 2 additions & 2 deletions modules/dashboard/dashboard_app.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ import (

func Configure(l *goapp.Lifecycle, conf *config.Config) {

l.Prepare(func(app *goapp.App) error {
l.Register(func(app *goapp.App) error {
app.Get("gonode.embeds").(*embed.Embeds).Add("dashboard", GetEmbedFS())

return nil
})

l.Prepare(func(app *goapp.App) error {
l.Config(func(app *goapp.App) error {

r := app.Get("gonode.router").(*router.Router)

Expand Down
2 changes: 1 addition & 1 deletion modules/feed/feed_app.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func Configure(l *goapp.Lifecycle, conf *config.Config) {
return nil
})

l.Prepare(func(app *goapp.App) error {
l.Register(func(app *goapp.App) error {
app.Get("gonode.embeds").(*embed.Embeds).Add("feed", GetEmbedFS())

return nil
Expand Down
2 changes: 1 addition & 1 deletion modules/prism/prism_app.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ func Configure(l *goapp.Lifecycle, conf *config.Config) {
return nil
})

l.Prepare(func(app *goapp.App) error {
l.Register(func(app *goapp.App) error {
app.Get("gonode.embeds").(*embed.Embeds).Add("prism", GetEmbedFS())

return nil
Expand Down
2 changes: 1 addition & 1 deletion modules/search/search_app.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func Configure(l *goapp.Lifecycle, conf *config.Config) {
return nil
})

l.Prepare(func(app *goapp.App) error {
l.Register(func(app *goapp.App) error {
app.Get("gonode.embeds").(*embed.Embeds).Add("search", GetEmbedFS())

return nil
Expand Down
2 changes: 1 addition & 1 deletion modules/setup/setup_app.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ func Configure(l *goapp.Lifecycle, conf *config.Config) {
return nil
})

l.Prepare(func(app *goapp.App) error {
l.Register(func(app *goapp.App) error {
app.Get("gonode.embeds").(*embed.Embeds).Add("setup", GetEmbedFS())

return nil
Expand Down
2 changes: 1 addition & 1 deletion test/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ func GetLifecycle(file string) *goapp.Lifecycle {
})

base.Configure(l, conf)
form.Configure(l, conf)
embed.Configure(l, conf)
form.Configure(l, conf)
debug.Configure(l, conf)
user.Configure(l, conf)
raw.Configure(l, conf)
Expand Down

0 comments on commit 59255e4

Please sign in to comment.