77 lines
2.2 KiB
Plaintext

component Sidebar(user *arn.User)
aside#sidebar
//- User avatar
.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")
//- Sidebar buttons
if user != nil
SidebarButton("Home", "/animelist/watching", "home")
else
SidebarButton("Home", "/", "home")
SidebarButton("Forum", "/forum", "comment")
SidebarButton("Explore", "/explore", "th")
SidebarButton("Soundtracks", "/soundtracks", "headphones")
if user != nil && user.Role == "admin"
SidebarButton("Companies", "/companies", "building")
SidebarButton("Calendar", "/calendar", "calendar")
SidebarButton("Users", "/users", "globe")
if user != nil
SidebarButton("Shop", "/shop", "shopping-cart")
SidebarButton("Settings", "/settings", "cog")
//- 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")
.spacer
.sidebar-link(aria-label="Search")
.sidebar-button
Icon("search")
FuzzySearch
if user != nil
if user.Role == "admin"
SidebarButton("Admin", "/admin", "wrench")
if user.Role == "editor"
SidebarButton("Editor", "/editor", "pencil")
a.sidebar-link.action(href="#", data-action="toggleTheme", data-trigger="click")
.sidebar-button
Icon("paint-brush")
span.sidebar-text Theme
SidebarButton("Help", "/thread/I3MMiOtzR", "question-circle")
if user != nil
SidebarButtonNoAJAX("Logout", "/logout", "sign-out")
else
SidebarButton("Login", "/login", "sign-in")
.sidebar-social-media
SocialMediaButtons
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