Improved post toolbar placement
This commit is contained in:
parent
7f8e145a33
commit
d314ebb33f
@ -17,7 +17,7 @@ component Postable(post arn.Postable, viewUser *arn.User, highlightAuthorID stri
|
||||
|
||||
.post-toolbar(id="toolbar-" + post.ID())
|
||||
.spacer
|
||||
.post-likes(id="likes-" + post.ID())= len(post.Likes())
|
||||
.post-likes(id="likes-" + post.ID(), title="Likes")= len(post.Likes())
|
||||
|
||||
//- if user != nil
|
||||
//- if user.ID !== post.authorId
|
||||
|
@ -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
|
||||
|
@ -69,9 +69,8 @@
|
||||
horizontal
|
||||
opacity 0
|
||||
position absolute
|
||||
bottom 3px
|
||||
right 0
|
||||
margin-right 0.5rem
|
||||
bottom 0.25rem
|
||||
right 0.25rem
|
||||
default-transition
|
||||
|
||||
.post-tool
|
||||
|
Loading…
Reference in New Issue
Block a user