Improved navigation

This commit is contained in:
Eduard Urbach 2017-06-21 02:51:55 +02:00
parent f1767f034e
commit 62a5f391a4
3 changed files with 15 additions and 9 deletions

View File

@ -9,8 +9,13 @@ component LoggedOutMenu
NavigationButton("About", "/", "question-circle") NavigationButton("About", "/", "question-circle")
NavigationButton("Anime", "/anime", "television") NavigationButton("Anime", "/anime", "television")
NavigationButton("Forum", "/forum", "comment") 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) component LoggedInMenu(user *arn.User)
nav#navigation.logged-in nav#navigation.logged-in
@ -22,9 +27,6 @@ component LoggedInMenu(user *arn.User)
FuzzySearch FuzzySearch
.extra-navigation .extra-navigation
//- if user.Role == "admin"
//- ExtraNavigationButton("Admin", "/admin", "wrench")
ExtraNavigationButton("Users", "/users", "globe") ExtraNavigationButton("Users", "/users", "globe")
ExtraNavigationButton("Airing", "/airing", "th") ExtraNavigationButton("Airing", "/airing", "th")
ExtraNavigationButton("Settings", "/settings", "cog") ExtraNavigationButton("Settings", "/settings", "cog")

View File

@ -1,6 +1,8 @@
package settings package settings
import ( import (
"net/http"
"github.com/aerogo/aero" "github.com/aerogo/aero"
"github.com/animenotifier/notify.moe/components" "github.com/animenotifier/notify.moe/components"
"github.com/animenotifier/notify.moe/utils" "github.com/animenotifier/notify.moe/utils"
@ -11,7 +13,7 @@ func Get(ctx *aero.Context) string {
user := utils.GetUser(ctx) user := utils.GetUser(ctx)
if user == nil { if user == nil {
return ctx.Redirect("/") return ctx.Error(http.StatusForbidden, "Not logged in", nil)
} }
return ctx.HTML(components.Settings(user)) return ctx.HTML(components.Settings(user))

View File

@ -48,6 +48,8 @@
background text-color background text-color
border none border none
color white color white
font-size 1em
min-width 0
:focus :focus
border none !important border none !important
@ -64,12 +66,12 @@
margin-right 0 margin-right 0
> 330px > 330px
.navigation-button .navigation-button, #search
font-size 1.3em font-size 1.3em
> 930px > 930px
.navigation-button .navigation-button, #search
font-size 1.1em font-size 1.2em
#navigation #navigation
justify-content flex-start justify-content flex-start