2017-07-20 00:54:53 +00:00
|
|
|
component Sidebar(user *arn.User)
|
|
|
|
.user-image-container
|
|
|
|
if user != nil
|
|
|
|
Avatar(user)
|
|
|
|
else
|
2017-10-03 02:59:39 +00:00
|
|
|
img.user-image.lazy(src=utils.EmptyImage(), data-src="/images/brand/64.png", data-webp="true", alt="Anime Notifier")
|
2017-07-20 00:54:53 +00:00
|
|
|
|
2017-09-22 18:10:37 +00:00
|
|
|
if user != nil
|
|
|
|
SidebarButton("Home", "/animelist/watching", "home")
|
|
|
|
else
|
|
|
|
SidebarButton("Home", "/", "home")
|
|
|
|
|
2017-07-20 00:54:53 +00:00
|
|
|
SidebarButton("Forum", "/forum", "comment")
|
|
|
|
SidebarButton("Explore", "/explore", "th")
|
2017-10-06 04:49:11 +00:00
|
|
|
//- SidebarButton("Artworks", "/artworks", "paint-brush")
|
2017-07-20 00:54:53 +00:00
|
|
|
SidebarButton("Soundtracks", "/soundtracks", "headphones")
|
2017-10-06 04:49:11 +00:00
|
|
|
//- SidebarButton("AMVs", "/amvs", "video-camera")
|
2017-09-22 21:36:43 +00:00
|
|
|
//- SidebarButton("Games", "/games", "gamepad")
|
2017-07-20 00:54:53 +00:00
|
|
|
SidebarButton("Users", "/users", "globe")
|
2017-09-22 21:36:43 +00:00
|
|
|
//- SidebarButton("Search", "/search", "search")
|
2017-07-20 00:54:53 +00:00
|
|
|
|
|
|
|
if user != nil
|
2017-10-05 11:48:16 +00:00
|
|
|
if user.Role == "admin" || user.Role == "editor"
|
|
|
|
SidebarButton("Shop", "/shop", "shopping-cart")
|
|
|
|
|
2017-09-22 21:36:43 +00:00
|
|
|
SidebarButton("Statistics", "/statistics", "pie-chart")
|
2017-07-20 00:54:53 +00:00
|
|
|
SidebarButton("Settings", "/settings", "cog")
|
|
|
|
|
2017-07-22 13:04:54 +00:00
|
|
|
.spacer
|
|
|
|
|
2017-09-22 21:36:43 +00:00
|
|
|
.sidebar-link(aria-label="Search")
|
|
|
|
.sidebar-button
|
|
|
|
Icon("search")
|
|
|
|
FuzzySearch
|
|
|
|
|
2017-10-03 13:26:29 +00:00
|
|
|
if user != nil && (user.Role == "admin" || user.Role == "editor")
|
|
|
|
SidebarButton("Admin", "/admin", "wrench")
|
|
|
|
|
2017-07-23 03:57:33 +00:00
|
|
|
SidebarButton("Help", "/thread/I3MMiOtzR", "question-circle")
|
2017-07-20 00:54:53 +00:00
|
|
|
|
|
|
|
if user != nil
|
|
|
|
SidebarButtonNoAJAX("Logout", "/logout", "sign-out")
|
|
|
|
else
|
2017-10-06 03:53:49 +00:00
|
|
|
SidebarButton("Login", "/login", "sign-in")
|
|
|
|
|
|
|
|
component SidebarButton(name string, target string, icon string)
|
|
|
|
a.sidebar-link.ajax(href=target, aria-label=name, data-bubble="true")
|
|
|
|
.sidebar-button
|
|
|
|
Icon(icon)
|
|
|
|
span.sidebar-text= name
|
|
|
|
|
|
|
|
component SidebarButtonNoAJAX(name string, target string, icon string)
|
|
|
|
a.sidebar-link(href=target, aria-label=name, data-bubble="true")
|
|
|
|
.sidebar-button
|
|
|
|
Icon(icon)
|
|
|
|
span.sidebar-text= name
|