templating: Move actions into template

This commit is contained in:
Tom Wiesing 2023-01-12 13:55:07 +01:00
parent 313af2b9e3
commit 202599aaeb
No known key found for this signature in database
23 changed files with 153 additions and 105 deletions

View file

@ -40,10 +40,12 @@ type grantsContext struct {
}
func (gc *grantsContext) use(r *http.Request, slug string, admin *Admin) (err error) {
admin.Dependencies.Custom.Update(gc, r, []component.MenuItem{
{Title: "Admin", Path: "/admin/"},
{Title: "Instance", Path: template.URL("/admin/instance/" + slug)},
{Title: "Grants", Path: template.URL("/admin/instance/" + slug + "/grants/")},
admin.Dependencies.Custom.Update(gc, r, custom.BaseContextGaps{
Crumbs: []component.MenuItem{
{Title: "Admin", Path: "/admin/"},
{Title: "Instance", Path: template.URL("/admin/instance/" + slug)},
{Title: "Grants", Path: template.URL("/admin/instance/" + slug + "/grants/")},
},
})
// find the instance itself