Added a site picker plus options to create new sites
This commit is contained in:
parent
cc0da8d668
commit
d80aacc180
14 changed files with 203 additions and 29 deletions
|
|
@ -9,7 +9,7 @@ import (
|
|||
func LogErrors() func(c fiber.Ctx) error {
|
||||
return func(c fiber.Ctx) error {
|
||||
if err := c.Next(); err != nil {
|
||||
log.Printf("error: %v\n", err)
|
||||
log.Printf("%v: error: %v\n", c.Path(), err)
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
|
|
|
|||
|
|
@ -32,9 +32,19 @@ func RequiresSite(sites *sites.Service) func(c fiber.Ctx) error {
|
|||
return err
|
||||
}
|
||||
}
|
||||
|
||||
c.Locals("site", site)
|
||||
c.SetContext(models.WithSite(c.Context(), site))
|
||||
|
||||
sitesOwnedByUser, err := sites.ListSites(c.Context())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
c.Locals("allSites", sitesOwnedByUser)
|
||||
|
||||
if pubTargets, err := sites.BestPubTarget(c.Context(), site); err == nil {
|
||||
c.Locals("pubTarget", pubTargets)
|
||||
}
|
||||
|
||||
return c.Next()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue