Deleted utils.GetUser

This commit is contained in:
2019-11-17 16:59:34 +09:00
parent ad9870b1c1
commit daed4146ed
117 changed files with 178 additions and 271 deletions

View File

@ -21,6 +21,6 @@ package profile
// followers := viewUser.Followers()
// arn.SortUsersLastSeenFirst(followers)
// return ctx.HTML(components.ProfileFollowers(followers, viewUser, utils.GetUser(ctx), ctx.Path()))
// return ctx.HTML(components.ProfileFollowers(followers, viewUser, arn.GetUserFromContext(ctx), ctx.Path()))
// }

View File

@ -27,6 +27,6 @@ package profile
// posts = posts[:postLimit]
// }
// return ctx.HTML(components.LatestPosts(arn.ToPostables(posts), viewUser, utils.GetUser(ctx), ctx.Path()))
// return ctx.HTML(components.LatestPosts(arn.ToPostables(posts), viewUser, arn.GetUserFromContext(ctx), ctx.Path()))
// }

View File

@ -33,7 +33,7 @@ func Get(ctx aero.Context) error {
// Profile renders the user profile page of the given viewUser.
func Profile(ctx aero.Context, viewUser *arn.User) error {
user := utils.GetUser(ctx)
user := arn.GetUserFromContext(ctx)
sortBy := arn.SortByRating
if user != nil {

View File

@ -7,7 +7,6 @@ import (
"github.com/aerogo/aero"
"github.com/animenotifier/notify.moe/arn"
"github.com/animenotifier/notify.moe/components"
"github.com/animenotifier/notify.moe/utils"
)
// Liked shows all liked characters of a particular user.
@ -40,5 +39,5 @@ func Liked(ctx aero.Context) error {
// return aLikes > bLikes
})
return ctx.HTML(components.ProfileCharacters(characters, viewUser, utils.GetUser(ctx), ctx.Path()))
return ctx.HTML(components.ProfileCharacters(characters, viewUser, arn.GetUserFromContext(ctx), ctx.Path()))
}

View File

@ -19,7 +19,7 @@ package profilequotes
// func render(ctx aero.Context, fetch func(userID string) []*arn.Quote) string {
// nick := ctx.Get("nick")
// index, _ := ctx.GetInt("index")
// user := utils.GetUser(ctx)
// user := arn.GetUserFromContext(ctx)
// viewUser, err := arn.GetUserByNick(nick)
// if err != nil {

View File

@ -19,7 +19,7 @@ package profiletracks
// func render(ctx aero.Context, fetch func(userID string) []*arn.SoundTrack) string {
// nick := ctx.Get("nick")
// index, _ := ctx.GetInt("index")
// user := utils.GetUser(ctx)
// user := arn.GetUserFromContext(ctx)
// viewUser, err := arn.GetUserByNick(nick)
// if err != nil {

View File

@ -98,5 +98,5 @@ package profile
// arn.NewPieChart("Soundtracks", trackTags),
// }
// return ctx.HTML(components.ProfileStats(&userStats, viewUser, utils.GetUser(ctx), ctx.Path()))
// return ctx.HTML(components.ProfileStats(&userStats, viewUser, arn.GetUserFromContext(ctx), ctx.Path()))
// }

View File

@ -27,5 +27,5 @@ package profile
// threads = threads[:maxThreads]
// }
// return ctx.HTML(components.ProfileThreads(threads, viewUser, utils.GetUser(ctx), ctx.Path()))
// return ctx.HTML(components.ProfileThreads(threads, viewUser, arn.GetUserFromContext(ctx), ctx.Path()))
// }