Improved post toolbar placement

This commit is contained in:
2017-06-20 16:19:43 +02:00
parent 7f8e145a33
commit d314ebb33f
4 changed files with 14 additions and 13 deletions

View File

@ -6,7 +6,8 @@ import (
"github.com/animenotifier/notify.moe/components"
)
const threadsPerPage = 20
// ThreadsPerPage indicates how many threads are shown on one page.
const ThreadsPerPage = 20
// Get forum category.
func Get(ctx *aero.Context) string {
@ -14,9 +15,9 @@ func Get(ctx *aero.Context) string {
threads, _ := arn.GetThreadsByTag(tag)
arn.SortThreads(threads)
if len(threads) > threadsPerPage {
threads = threads[:threadsPerPage]
if len(threads) > ThreadsPerPage {
threads = threads[:ThreadsPerPage]
}
return ctx.HTML(components.Forum(tag, threads))
return ctx.HTML(components.Forum(tag, threads, ThreadsPerPage))
}