Anime character refresh

This commit is contained in:
2017-07-13 08:23:20 +02:00
parent db4d362fb3
commit d6155bf3a1
9 changed files with 54 additions and 9 deletions

View File

@ -0,0 +1,21 @@
package character
import (
"net/http"
"github.com/aerogo/aero"
"github.com/animenotifier/arn"
"github.com/animenotifier/notify.moe/components"
)
// Get character.
func Get(ctx *aero.Context) string {
id := ctx.Get("id")
character, err := arn.GetCharacter(id)
if err != nil {
return ctx.Error(http.StatusNotFound, "Character not found", err)
}
return ctx.HTML(components.CharacterDetails(character))
}

View File

@ -0,0 +1,5 @@
component CharacterDetails(character *arn.Character)
h1= character.Name
p
img(src=character.Image, alt=character.Name)
p= character.Description