Added user lists
This commit is contained in:
@ -8,9 +8,42 @@ import (
|
||||
"github.com/animenotifier/notify.moe/components"
|
||||
)
|
||||
|
||||
// Get ...
|
||||
func Get(ctx *aero.Context) string {
|
||||
users, err := arn.GetActiveUsersCached()
|
||||
// Active ...
|
||||
func Active(ctx *aero.Context) string {
|
||||
users, err := arn.GetListOfUsersCached("active users")
|
||||
|
||||
if err != nil {
|
||||
return ctx.Error(http.StatusInternalServerError, "Could not fetch user data", err)
|
||||
}
|
||||
|
||||
return ctx.HTML(components.Users(users))
|
||||
}
|
||||
|
||||
// Osu ...
|
||||
func Osu(ctx *aero.Context) string {
|
||||
users, err := arn.GetListOfUsersCached("active osu users")
|
||||
|
||||
if err != nil {
|
||||
return ctx.Error(http.StatusInternalServerError, "Could not fetch user data", err)
|
||||
}
|
||||
|
||||
return ctx.HTML(components.Users(users))
|
||||
}
|
||||
|
||||
// Staff ...
|
||||
func Staff(ctx *aero.Context) string {
|
||||
users, err := arn.GetListOfUsersCached("active staff users")
|
||||
|
||||
if err != nil {
|
||||
return ctx.Error(http.StatusInternalServerError, "Could not fetch user data", err)
|
||||
}
|
||||
|
||||
return ctx.HTML(components.Users(users))
|
||||
}
|
||||
|
||||
// AnimeWatching ...
|
||||
func AnimeWatching(ctx *aero.Context) string {
|
||||
users, err := arn.GetListOfUsersCached("active anime watching users")
|
||||
|
||||
if err != nil {
|
||||
return ctx.Error(http.StatusInternalServerError, "Could not fetch user data", err)
|
||||
|
@ -1,6 +1,23 @@
|
||||
component Users(users []*arn.User)
|
||||
h1.page-title Users
|
||||
|
||||
.buttons.tabs
|
||||
a.button.tab.action(href="/users", data-action="diff", data-trigger="click")
|
||||
Icon("users")
|
||||
span Active
|
||||
|
||||
a.button.tab.action(href="/users/anime/watching", data-action="diff", data-trigger="click")
|
||||
Icon("tv")
|
||||
span Watching
|
||||
|
||||
a.button.tab.action(href="/users/osu", data-action="diff", data-trigger="click")
|
||||
Icon("gamepad")
|
||||
span Osu
|
||||
|
||||
a.button.tab.action(href="/users/staff", data-action="diff", data-trigger="click")
|
||||
Icon("user-secret")
|
||||
span Staff
|
||||
|
||||
.user-avatars
|
||||
each user in users
|
||||
Avatar(user)
|
Reference in New Issue
Block a user