Improved group interface

This commit is contained in:
Eduard Urbach 2018-03-07 01:08:47 +01:00
parent 621155bfcc
commit 999323f850
5 changed files with 28 additions and 16 deletions

6
mixins/NewPostArea.pixy Normal file
View File

@ -0,0 +1,6 @@
component NewPostArea(user *arn.User, placeholder string)
.post.mountable
.post-author
Avatar(user)
textarea#new-reply.post-content(placeholder=placeholder + "...", aria-label=placeholder)

View File

@ -25,9 +25,14 @@ component Group(group *arn.Group, user *arn.User)
Avatar(member.User())
.group-feed.mountable
if len(group.Posts()) == 0
p.text-center.mountable No posts in this group yet.
else
if user != nil
NewPostArea(user, "Content")
.buttons
button.action(data-action="newGroupPost", data-trigger="click")
Icon("check")
span Publish
each post in group.Posts()
p!= post.HTML()

View File

@ -1,19 +1,20 @@
.group-view
horizontal-wrap
width 100%
max-width 1200px
max-width 900px
margin 0 auto
border 1px solid red
< 1100px
.group-view
vertical
.group-feed
flex 0.75
flex 1
padding 1rem
.group-sidebar
flex 0.25
flex-basis 300px
.group-sidebar-section
ui-element

View File

@ -10,19 +10,14 @@ component Thread(thread *arn.Thread, posts []*arn.Post, user *arn.User)
// Reply
if user != nil
.post.mountable
.post-author
Avatar(user)
.post-content
textarea#new-reply(placeholder="Reply...", aria-label="Reply")
NewPostArea(user, "Reply")
.buttons
button.action(data-action="forumReply", data-trigger="click")
Icon("mail-reply")
span Reply
if user.Role == "admin" || user.Role == "editor"
button.action(data-action="deleteObject", data-trigger="click", data-return-path="/forum", data-confirm-type="thread", data-api="/api/thread/" + thread.ID)
Icon("trash")
span Delete

View File

@ -73,6 +73,11 @@ export function forumReply(arn: AnimeNotifier) {
.catch(err => arn.statusMessage.showError(err))
}
// Group post
export function newGroupPost(arn: AnimeNotifier) {
// TODO: ...
}
// Create thread
export function createThread(arn: AnimeNotifier) {
let title = arn.app.find("title") as HTMLInputElement