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,9 +25,14 @@ component Group(group *arn.Group, user *arn.User)
|
|||||||
Avatar(member.User())
|
Avatar(member.User())
|
||||||
|
|
||||||
.group-feed.mountable
|
.group-feed.mountable
|
||||||
if len(group.Posts()) == 0
|
if user != nil
|
||||||
p.text-center.mountable No posts in this group yet.
|
NewPostArea(user, "Content")
|
||||||
else
|
|
||||||
|
.buttons
|
||||||
|
button.action(data-action="newGroupPost", data-trigger="click")
|
||||||
|
Icon("check")
|
||||||
|
span Publish
|
||||||
|
|
||||||
each post in group.Posts()
|
each post in group.Posts()
|
||||||
p!= post.HTML()
|
p!= post.HTML()
|
||||||
|
|
||||||
|
@ -1,19 +1,20 @@
|
|||||||
.group-view
|
.group-view
|
||||||
horizontal-wrap
|
horizontal-wrap
|
||||||
width 100%
|
width 100%
|
||||||
max-width 1200px
|
max-width 900px
|
||||||
margin 0 auto
|
margin 0 auto
|
||||||
|
border 1px solid red
|
||||||
|
|
||||||
< 1100px
|
< 1100px
|
||||||
.group-view
|
.group-view
|
||||||
vertical
|
vertical
|
||||||
|
|
||||||
.group-feed
|
.group-feed
|
||||||
flex 0.75
|
flex 1
|
||||||
padding 1rem
|
padding 1rem
|
||||||
|
|
||||||
.group-sidebar
|
.group-sidebar
|
||||||
flex 0.25
|
flex-basis 300px
|
||||||
|
|
||||||
.group-sidebar-section
|
.group-sidebar-section
|
||||||
ui-element
|
ui-element
|
||||||
|
@ -10,19 +10,14 @@ component Thread(thread *arn.Thread, posts []*arn.Post, user *arn.User)
|
|||||||
|
|
||||||
// Reply
|
// Reply
|
||||||
if user != nil
|
if user != nil
|
||||||
.post.mountable
|
NewPostArea(user, "Reply")
|
||||||
.post-author
|
|
||||||
Avatar(user)
|
|
||||||
|
|
||||||
.post-content
|
|
||||||
textarea#new-reply(placeholder="Reply...", aria-label="Reply")
|
|
||||||
|
|
||||||
.buttons
|
.buttons
|
||||||
button.action(data-action="forumReply", data-trigger="click")
|
button.action(data-action="forumReply", data-trigger="click")
|
||||||
Icon("mail-reply")
|
Icon("mail-reply")
|
||||||
span Reply
|
span Reply
|
||||||
|
|
||||||
if user.Role == "admin" || user.Role == "editor"
|
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)
|
button.action(data-action="deleteObject", data-trigger="click", data-return-path="/forum", data-confirm-type="thread", data-api="/api/thread/" + thread.ID)
|
||||||
Icon("trash")
|
Icon("trash")
|
||||||
span Delete
|
span Delete
|
||||||
|
|
@ -73,6 +73,11 @@ export function forumReply(arn: AnimeNotifier) {
|
|||||||
.catch(err => arn.statusMessage.showError(err))
|
.catch(err => arn.statusMessage.showError(err))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Group post
|
||||||
|
export function newGroupPost(arn: AnimeNotifier) {
|
||||||
|
// TODO: ...
|
||||||
|
}
|
||||||
|
|
||||||
// Create thread
|
// Create thread
|
||||||
export function createThread(arn: AnimeNotifier) {
|
export function createThread(arn: AnimeNotifier) {
|
||||||
let title = arn.app.find("title") as HTMLInputElement
|
let title = arn.app.find("title") as HTMLInputElement
|
||||||
|
Loading…
Reference in New Issue
Block a user