diff --git a/.env.example b/.env.example index d69aa474..1805a40d 100644 --- a/.env.example +++ b/.env.example @@ -3,5 +3,5 @@ # APP_NAME=litter-go -APP_VERSION=0.38.7 +APP_VERSION=0.38.8 GOLANG_VERSION=1.23 diff --git a/api/swagger.json b/api/swagger.json index ce502c7c..9090593d 100644 --- a/api/swagger.json +++ b/api/swagger.json @@ -13,7 +13,7 @@ "name": "MIT", "url": "https://github.com/krustowski/litter-go/blob/master/LICENSE" }, - "version": "0.38.7" + "version": "0.38.8" }, "host": "littr.eu", "basePath": "/api/v1", diff --git a/pkg/backend/router.go b/pkg/backend/router.go index 5330109f..306e702e 100644 --- a/pkg/backend/router.go +++ b/pkg/backend/router.go @@ -1,5 +1,5 @@ // @title litter-go -// @version 0.38.7 +// @version 0.38.8 // @description nanoblogging platform as PWA built on go-app framework // @termsOfService https://littr.eu/tos diff --git a/pkg/frontend/flow.go b/pkg/frontend/flow.go index 34d24e45..ad07a792 100644 --- a/pkg/frontend/flow.go +++ b/pkg/frontend/flow.go @@ -1178,7 +1178,7 @@ func (c *flowContent) Render() app.UI { ), app.Div().Class("small-padding").Body( - app.Button().Class("border black white-text bold").Style("border-radius", "8px").OnClick(c.onClickRefresh).Disabled(c.postButtonsDisabled).Body( + app.Button().Title("refresh flow [r]").Class("border black white-text bold").Style("border-radius", "8px").OnClick(c.onClickRefresh).Disabled(c.postButtonsDisabled).Body( app.If(c.refreshClicked, app.Progress().Class("circle deep-orange-border small"), ), diff --git a/pkg/frontend/navbars.go b/pkg/frontend/navbars.go index 33630878..6492188b 100644 --- a/pkg/frontend/navbars.go +++ b/pkg/frontend/navbars.go @@ -81,6 +81,28 @@ func (h *header) onKeyDown(ctx app.Context, e app.Event) { ctx.NewAction("dismiss-general") return } + + var authGranted bool + ctx.LocalStorage().Get("authGranted", &authGranted) + + if !authGranted { + return + } + + switch e.Get("key").String() { + case "1": + ctx.Navigate("/stats") + case "2": + ctx.Navigate("/users") + case "3": + ctx.Navigate("/post") + case "4": + ctx.Navigate("/polls") + case "5": + ctx.Navigate("/flow") + case "6": + ctx.Navigate("/settings") + } } func (h *header) onMessage(ctx app.Context, e app.Event) { @@ -353,7 +375,7 @@ func (h *header) Render() app.UI { return app.Nav().ID("nav-top").Class("top fixed-top center-align").Style("opacity", "1.0"). //Style("background-color", navbarColor). Body( - app.A().Href(settingsHref).Text("settings").Class("max").Title("settings").Aria("label", "settings").Body( + app.A().Href(settingsHref).Text("settings").Class("max").Title("settings [6]").Aria("label", "settings").Body( app.I().Class("large").Class("deep-orange-text").Body( app.Text("build")), ), @@ -527,27 +549,27 @@ func (f *footer) Render() app.UI { return app.Nav().ID("nav-top").Class("bottom fixed-top center-align").Style("opacity", "1.0"). Body( - app.A().Href(statsHref).Text("stats").Class("max").Title("stats").Aria("label", "stats").Body( + app.A().Href(statsHref).Text("stats").Class("max").Title("stats [1]").Aria("label", "stats").Body( app.I().Class("large deep-orange-text").Body( app.Text("query_stats")), ), - app.A().Href(usersHref).Text("users").Class("max").Title("users").Aria("label", "users").Body( + app.A().Href(usersHref).Text("users").Class("max").Title("users [2]").Aria("label", "users").Body( app.I().Class("large deep-orange-text").Body( app.Text("group")), ), - app.A().Href(postHref).Text("post").Class("max").Title("new post/poll").Aria("label", "new post/poll").Body( + app.A().Href(postHref).Text("post").Class("max").Title("new post/poll [3]").Aria("label", "new post/poll").Body( app.I().Class("large deep-orange-text").Body( app.Text("add")), ), - app.A().Href(pollsHref).Text("polls").Class("max").Title("polls").Aria("label", "polls").Body( + app.A().Href(pollsHref).Text("polls").Class("max").Title("polls [4]").Aria("label", "polls").Body( app.I().Class("large deep-orange-text").Body( app.Text("equalizer")), ), - app.A().Href(flowHref).Text("flow").Class("max").Title("flow").Aria("label", "flow").Body( + app.A().Href(flowHref).Text("flow").Class("max").Title("flow [5]").Aria("label", "flow").Body( app.I().Class("large deep-orange-text").Body( app.Text("tsunami")), ),