Improved post toolbar placement

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

View File

@ -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

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))
}

View File

@ -1,9 +1,10 @@
component Forum(tag string, threads []*arn.Thread)
component Forum(tag string, threads []*arn.Thread, threadsPerPage int)
h2.page-title Forum
ForumTags
.forum
ThreadList(threads)
if len(threads) == threadsPerPage
.buttons
button
Icon("refresh")

View File

@ -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