Added infinite scrolling to AMVs

This commit is contained in:
2018-04-16 15:48:54 +02:00
parent 39ef07307c
commit ca020a9faa
6 changed files with 95 additions and 44 deletions

18
pages/amvs/latest.go Normal file
View File

@ -0,0 +1,18 @@
package amvs
import (
"sort"
"github.com/aerogo/aero"
)
// Latest AMVs.
func Latest(ctx *aero.Context) string {
amvs := fetchAll()
sort.Slice(amvs, func(i, j int) bool {
return amvs[i].Created > amvs[j].Created
})
return render(ctx, amvs)
}