From 62a5f391a41be50528457596bbe3c7cadb0c9d3d Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Wed, 21 Jun 2017 02:51:55 +0200 Subject: [PATCH] Improved navigation --- mixins/Navigation.pixy | 12 +++++++----- pages/settings/settings.go | 4 +++- styles/navigation.scarlet | 8 +++++--- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/mixins/Navigation.pixy b/mixins/Navigation.pixy index 5767e511..0aa276c0 100644 --- a/mixins/Navigation.pixy +++ b/mixins/Navigation.pixy @@ -9,8 +9,13 @@ component LoggedOutMenu NavigationButton("About", "/", "question-circle") NavigationButton("Anime", "/anime", "television") NavigationButton("Forum", "/forum", "comment") - NavigationButton("Users", "/users", "globe") - NavigationButton("Airing", "/airing", "th") + + FuzzySearch + + .extra-navigation + NavigationButton("Users", "/users", "globe") + NavigationButton("Airing", "/airing", "th") + NavigationButton("Settings", "/settings", "cog") component LoggedInMenu(user *arn.User) nav#navigation.logged-in @@ -22,9 +27,6 @@ component LoggedInMenu(user *arn.User) FuzzySearch .extra-navigation - //- if user.Role == "admin" - //- ExtraNavigationButton("Admin", "/admin", "wrench") - ExtraNavigationButton("Users", "/users", "globe") ExtraNavigationButton("Airing", "/airing", "th") ExtraNavigationButton("Settings", "/settings", "cog") diff --git a/pages/settings/settings.go b/pages/settings/settings.go index e23ff35e..978866bb 100644 --- a/pages/settings/settings.go +++ b/pages/settings/settings.go @@ -1,6 +1,8 @@ package settings import ( + "net/http" + "github.com/aerogo/aero" "github.com/animenotifier/notify.moe/components" "github.com/animenotifier/notify.moe/utils" @@ -11,7 +13,7 @@ func Get(ctx *aero.Context) string { user := utils.GetUser(ctx) if user == nil { - return ctx.Redirect("/") + return ctx.Error(http.StatusForbidden, "Not logged in", nil) } return ctx.HTML(components.Settings(user)) diff --git a/styles/navigation.scarlet b/styles/navigation.scarlet index 57530be7..fc628492 100644 --- a/styles/navigation.scarlet +++ b/styles/navigation.scarlet @@ -48,6 +48,8 @@ background text-color border none color white + font-size 1em + min-width 0 :focus border none !important @@ -64,12 +66,12 @@ margin-right 0 > 330px - .navigation-button + .navigation-button, #search font-size 1.3em > 930px - .navigation-button - font-size 1.1em + .navigation-button, #search + font-size 1.2em #navigation justify-content flex-start