Tracks have permalinks now

This commit is contained in:
2017-06-28 00:16:45 +02:00
parent 5099c0b0e7
commit d5dcd9c909
9 changed files with 89 additions and 12 deletions

21
pages/tracks/tracks.go Normal file
View File

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

5
pages/tracks/tracks.pixy Normal file
View File

@ -0,0 +1,5 @@
component Track(track *arn.SoundTrack)
h2= track.Media[0].Title
.sound-tracks
SoundTrackAllMedia(track)