75 lines
2.2 KiB
Plaintext
Raw Normal View History

2017-07-20 00:54:53 +00:00
component Sidebar(user *arn.User)
2017-11-03 08:34:21 +00:00
aside#sidebar
2017-11-13 13:28:52 +00:00
//- User avatar
2017-11-03 08:34:21 +00:00
.user-image-container
if user != nil
Avatar(user)
else
img.user-image.lazy(src=utils.EmptyImage(), data-src="/images/brand/64.png", data-webp="true", alt="Anime Notifier")
2017-11-13 13:28:52 +00:00
//- Sidebar buttons
2017-07-20 00:54:53 +00:00
if user != nil
2017-11-03 08:34:21 +00:00
SidebarButton("Home", "/animelist/watching", "home")
2017-07-20 00:54:53 +00:00
else
2017-11-03 08:34:21 +00:00
SidebarButton("Home", "/", "home")
2017-11-13 13:28:52 +00:00
2017-11-03 08:34:21 +00:00
SidebarButton("Forum", "/forum", "comment")
SidebarButton("Explore", "/explore", "th")
SidebarButton("Soundtracks", "/soundtracks", "headphones")
SidebarButton("Users", "/users", "globe")
2017-11-02 10:07:33 +00:00
2017-11-03 08:34:21 +00:00
if user != nil
SidebarButton("Shop", "/shop", "shopping-cart")
SidebarButton("Settings", "/settings", "cog")
2017-07-22 13:04:54 +00:00
2017-11-13 13:28:52 +00:00
//- Disabled:
//- SidebarButton("Dash", "/dashboard", "tachometer")
//- SidebarButton("Artworks", "/artworks", "paint-brush")
//- SidebarButton("AMVs", "/amvs", "video-camera")
//- SidebarButton("Games", "/games", "gamepad")
//- SidebarButton("Groups", "/groups", "users")
//- SidebarButton("Statistics", "/statistics", "pie-chart")
2017-11-03 08:34:21 +00:00
.spacer
2017-09-22 21:36:43 +00:00
2017-11-16 14:15:35 +00:00
//- .theme-switcher
//- button.theme-switcher-button.action(data-action="toggleTheme", data-trigger="click") Switch theme
2017-11-03 08:34:21 +00:00
.sidebar-link(aria-label="Search")
.sidebar-button
Icon("search")
FuzzySearch
2017-10-03 13:26:29 +00:00
2017-11-03 08:34:21 +00:00
if user != nil
if user.Role == "admin"
SidebarButton("Admin", "/admin", "wrench")
2017-11-13 13:28:52 +00:00
2017-11-03 08:34:21 +00:00
if user.Role == "editor"
SidebarButton("Editor", "/editor", "pencil")
2017-11-16 14:15:35 +00:00
a.sidebar-link.action(href="#", data-action="toggleTheme", data-trigger="click")
.sidebar-button
Icon("paint-brush")
span.sidebar-text Theme
2017-11-03 08:34:21 +00:00
SidebarButton("Help", "/thread/I3MMiOtzR", "question-circle")
2017-07-20 00:54:53 +00:00
2017-11-03 08:34:21 +00:00
if user != nil
SidebarButtonNoAJAX("Logout", "/logout", "sign-out")
else
SidebarButton("Login", "/login", "sign-in")
2017-10-06 03:53:49 +00:00
.sidebar-social-media
SocialMediaButtons
2017-10-06 03:53:49 +00:00
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