Refactor: Menu

This commit is contained in:
Tom Wiesing 2023-02-03 15:46:53 +01:00
parent a7309d5268
commit 7f820224ec
No known key found for this signature in database
16 changed files with 103 additions and 92 deletions

View file

@ -5,7 +5,6 @@ import (
"errors"
"net/http"
"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/server/assets"
"github.com/FAU-CDI/wisski-distillery/internal/dis/component/server/templating"
@ -45,11 +44,11 @@ func (panel *UserPanel) sshRoute(ctx context.Context) http.Handler {
tpl := sshTemplate.Prepare(
panel.Dependencies.Templating,
templating.Crumbs(
component.MenuItem{Title: "User", Path: "/user/"},
component.MenuItem{Title: "SSH Keys", Path: "/user/ssh/"},
menuUser,
menuSSH,
),
templating.Actions(
component.MenuItem{Title: "Add New Key", Path: "/user/ssh/add/"},
menuSSHAdd,
),
)
@ -136,9 +135,9 @@ func (panel *UserPanel) sshAddRoute(ctx context.Context) http.Handler {
tpl := sshAddTemplate.Prepare(
panel.Dependencies.Templating,
templating.Crumbs(
component.MenuItem{Title: "User", Path: "/user/"},
component.MenuItem{Title: "SSH Keys", Path: "/user/ssh/"},
component.MenuItem{Title: "Add New Key", Path: "/user/ssh/add/"},
menuUser,
menuSSH,
menuSSHAdd,
),
)