23 lines
440 B
Go
Raw Normal View History

2016-11-19 14:54:31 +00:00
package forum
import (
"github.com/aerogo/aero"
"github.com/animenotifier/arn"
"github.com/animenotifier/notify.moe/components"
)
const threadsPerPage = 20
2017-06-16 23:25:02 +00:00
// Get forum category.
2016-11-19 14:54:31 +00:00
func Get(ctx *aero.Context) string {
tag := ctx.Get("tag")
threads, _ := arn.GetThreadsByTag(tag)
2016-12-06 03:36:31 +00:00
arn.SortThreads(threads)
2016-11-19 14:54:31 +00:00
if len(threads) > threadsPerPage {
threads = threads[:threadsPerPage]
}
return ctx.HTML(components.Forum(tag, threads))
2016-11-19 14:54:31 +00:00
}