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()) .post-toolbar(id="toolbar-" + post.ID())
.spacer .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 != nil
//- if user.ID !== post.authorId //- if user.ID !== post.authorId

View File

@ -6,7 +6,8 @@ import (
"github.com/animenotifier/notify.moe/components" "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. // Get forum category.
func Get(ctx *aero.Context) string { func Get(ctx *aero.Context) string {
@ -14,9 +15,9 @@ func Get(ctx *aero.Context) string {
threads, _ := arn.GetThreadsByTag(tag) threads, _ := arn.GetThreadsByTag(tag)
arn.SortThreads(threads) arn.SortThreads(threads)
if len(threads) > threadsPerPage { if len(threads) > ThreadsPerPage {
threads = threads[:threadsPerPage] threads = threads[:ThreadsPerPage]
} }
return ctx.HTML(components.Forum(tag, threads)) return ctx.HTML(components.Forum(tag, threads, ThreadsPerPage))
} }

View File

@ -1,13 +1,14 @@
component Forum(tag string, threads []*arn.Thread) component Forum(tag string, threads []*arn.Thread, threadsPerPage int)
h2.page-title Forum h2.page-title Forum
ForumTags ForumTags
.forum .forum
ThreadList(threads) ThreadList(threads)
.buttons if len(threads) == threadsPerPage
button .buttons
Icon("refresh") button
span Load more Icon("refresh")
span Load more
component ThreadList(threads []*arn.Thread) component ThreadList(threads []*arn.Thread)
each thread in threads each thread in threads

View File

@ -69,9 +69,8 @@
horizontal horizontal
opacity 0 opacity 0
position absolute position absolute
bottom 3px bottom 0.25rem
right 0 right 0.25rem
margin-right 0.5rem
default-transition default-transition
.post-tool .post-tool