48 lines
1.5 KiB
Plaintext
Raw Normal View History

2017-06-15 21:03:55 +00:00
component Navigation(user *arn.User)
if user == nil
LoggedOutMenu
else
2017-06-18 15:16:40 +00:00
LoggedInMenu(user)
2017-06-15 21:03:55 +00:00
component LoggedOutMenu
nav#navigation
NavigationButton("Dash", "/", "inbox")
NavigationButton("Anime", "/anime", "television")
NavigationButton("Forum", "/forum", "comment")
2017-06-10 00:19:31 +00:00
NavigationButton("Users", "/users", "globe")
NavigationButton("Airing", "/airing", "rss")
2017-06-15 21:03:55 +00:00
2017-06-18 15:16:40 +00:00
component LoggedInMenu(user *arn.User)
2017-06-15 21:03:55 +00:00
nav#navigation
NavigationButton("Dash", "/", "inbox")
NavigationButton("Anime", "/anime", "television")
2017-06-20 12:16:23 +00:00
NavigationButton("Profile", "/+", "user")
2017-06-15 21:03:55 +00:00
NavigationButton("Forum", "/forum", "comment")
2017-06-18 15:16:40 +00:00
NavigationButton("Settings", "/settings", "cog")
.extra-navigation
ExtraNavigationButton("Users", "/users", "globe")
2017-06-20 12:16:23 +00:00
ExtraNavigationButton("Airing", "/airing", "rss")
2017-06-18 15:16:40 +00:00
if user.Role == "admin"
ExtraNavigationButton("Admin", "/admin", "wrench")
NavigationButtonNoAJAX("Logout", "/logout", "sign-out")
component NavigationButton(name string, target string, icon string)
2017-06-17 11:05:52 +00:00
a.navigation-link.ajax(href=target, aria-label=name)
2017-06-15 21:03:55 +00:00
.navigation-button
2017-06-16 16:12:18 +00:00
Icon(icon)
2017-06-15 21:03:55 +00:00
span.navigation-text= name
2017-06-18 15:16:40 +00:00
component ExtraNavigationButton(name string, target string, icon string)
a.navigation-link.ajax(href=target, aria-label=name, title=name)
.navigation-button
Icon(icon)
span.navigation-text= name
2017-06-15 21:03:55 +00:00
component NavigationButtonNoAJAX(name string, target string, icon string)
2017-06-17 22:06:08 +00:00
a.navigation-link(href=target, aria-label=name)
.navigation-button
2017-06-16 16:12:18 +00:00
Icon(icon)
span.navigation-text= name