Improved group interface
This commit is contained in:
parent
621155bfcc
commit
999323f850
6
mixins/NewPostArea.pixy
Normal file
6
mixins/NewPostArea.pixy
Normal 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)
|
@ -25,11 +25,16 @@ 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
|
||||
each post in group.Posts()
|
||||
p!= post.HTML()
|
||||
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()
|
||||
|
||||
component GroupTabs(group *arn.Group, user *arn.User)
|
||||
.tabs
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user