Improved post toolbar placement
This commit is contained in:
@ -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))
|
||||
}
|
||||
|
@ -1,13 +1,14 @@
|
||||
component Forum(tag string, threads []*arn.Thread)
|
||||
component Forum(tag string, threads []*arn.Thread, threadsPerPage int)
|
||||
h2.page-title Forum
|
||||
ForumTags
|
||||
.forum
|
||||
ThreadList(threads)
|
||||
|
||||
.buttons
|
||||
button
|
||||
Icon("refresh")
|
||||
span Load more
|
||||
if len(threads) == threadsPerPage
|
||||
.buttons
|
||||
button
|
||||
Icon("refresh")
|
||||
span Load more
|
||||
|
||||
component ThreadList(threads []*arn.Thread)
|
||||
each thread in threads
|
||||
|
Reference in New Issue
Block a user