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

@ -16,6 +16,7 @@
.character-image
border-radius 3px
box-shadow shadow-medium
object-fit cover
.character-name

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

View File

@ -8,7 +8,7 @@ import (
"github.com/animenotifier/notify.moe/components"
)
// Get post.
// Get track.
func Get(ctx *aero.Context) string {
id := ctx.Get("id")
track, err := arn.GetSoundTrack(id)