Improved anime list rendering

This commit is contained in:
2017-07-05 15:00:58 +02:00
parent a94b69d671
commit 59daa5404e
7 changed files with 19 additions and 3 deletions

28
utils/GetUser.go Normal file
View File

@ -0,0 +1,28 @@
package utils
import (
"github.com/aerogo/aero"
"github.com/animenotifier/arn"
)
// GetUser returns the logged in user for the given context.
func GetUser(ctx *aero.Context) *arn.User {
return arn.GetUserFromContext(ctx)
}
// SameUser returns "true" or "false" depending on if the users are the same.
func SameUser(a *arn.User, b *arn.User) string {
if a == nil {
return "false"
}
if b == nil {
return "false"
}
if a.ID == b.ID {
return "true"
}
return "false"
}