Update grant page
This commit is contained in:
parent
021fc3cc7e
commit
97f5ac7e1a
10 changed files with 313 additions and 54 deletions
|
|
@ -6,6 +6,7 @@ import (
|
|||
|
||||
"github.com/FAU-CDI/wisski-distillery/internal/dis/component"
|
||||
"github.com/FAU-CDI/wisski-distillery/internal/dis/component/auth"
|
||||
"github.com/FAU-CDI/wisski-distillery/internal/dis/component/auth/policy"
|
||||
"github.com/FAU-CDI/wisski-distillery/internal/dis/component/control/static/custom"
|
||||
"github.com/FAU-CDI/wisski-distillery/internal/dis/component/exporter"
|
||||
"github.com/FAU-CDI/wisski-distillery/internal/dis/component/exporter/logger"
|
||||
|
|
@ -28,6 +29,8 @@ type Admin struct {
|
|||
|
||||
Auth *auth.Auth
|
||||
|
||||
Policy *policy.Policy
|
||||
|
||||
Custom *custom.Custom
|
||||
}
|
||||
|
||||
|
|
@ -108,6 +111,16 @@ func (admin *Admin) HandleRoute(ctx context.Context, route string) (handler http
|
|||
Template: admin.Dependencies.Custom.Template(instanceTemplate),
|
||||
})
|
||||
|
||||
// add a router for the grants pages
|
||||
router.Handler(http.MethodGet, route+"grants/:slug", httpx.HTMLHandler[grantsContext]{
|
||||
Handler: admin.getGrants,
|
||||
Template: admin.Dependencies.Custom.Template(grantsTemplate),
|
||||
})
|
||||
router.Handler(http.MethodPost, route+"grants/", httpx.HTMLHandler[grantsContext]{
|
||||
Handler: admin.postGrants,
|
||||
Template: admin.Dependencies.Custom.Template(grantsTemplate),
|
||||
})
|
||||
|
||||
// add a router for the login page
|
||||
router.Handler(http.MethodPost, route+"login", admin.loginHandler(ctx))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue