Show threads in activity view
This commit is contained in:
parent
e21e3498f7
commit
e74253df96
@ -53,7 +53,3 @@ component Postable(post arn.Postable, user *arn.User, headerContent string, high
|
|||||||
|
|
||||||
a.post-tool.post-permalink.tip(href=post.Link(), aria-label="Link")
|
a.post-tool.post-permalink.tip(href=post.Link(), aria-label="Link")
|
||||||
Icon("link")
|
Icon("link")
|
||||||
|
|
||||||
//- if type === "Messages" && user && (user.ID === post.authorId || user.ID === post.recipientId)
|
|
||||||
//- a.post-tool.post-delete(onclick=`if(confirm("Do you really want to delete this ${typeSingular.toLowerCase()} from ${post.author.nick}?")) $.delete${typeSingular}("${post.ID}")`, title="Delete")
|
|
||||||
//- i.fa.fa-trash.fa-fw
|
|
||||||
|
@ -21,7 +21,23 @@ func Get(ctx *aero.Context) string {
|
|||||||
// })
|
// })
|
||||||
|
|
||||||
entries := arn.FilterEditLogEntries(func(entry *arn.EditLogEntry) bool {
|
entries := arn.FilterEditLogEntries(func(entry *arn.EditLogEntry) bool {
|
||||||
return entry.Action == "create" && entry.ObjectType == "Post" && entry.Object() != nil
|
if entry.Action != "create" {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
obj := entry.Object()
|
||||||
|
|
||||||
|
if obj == nil {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
_, isPostable := obj.(arn.Postable)
|
||||||
|
|
||||||
|
if !isPostable {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
return true
|
||||||
})
|
})
|
||||||
|
|
||||||
arn.SortEditLogEntriesLatestFirst(entries)
|
arn.SortEditLogEntriesLatestFirst(entries)
|
||||||
|
@ -3,14 +3,11 @@ component ActivityFeed(entries []*arn.EditLogEntry, user *arn.User)
|
|||||||
|
|
||||||
.activities
|
.activities
|
||||||
each entry in entries
|
each entry in entries
|
||||||
if entry.ObjectType == "Post"
|
|
||||||
.activity
|
.activity
|
||||||
ActivityPost(entry.Object().(*arn.Post), user)
|
ActivityPost(entry.Object().(arn.Postable), user)
|
||||||
|
|
||||||
component ActivityPost(post *arn.Post, user *arn.User)
|
|
||||||
//- .activity-header.mountable
|
|
||||||
//- a(href=post.Creator().Link())= post.Creator().Nick
|
|
||||||
//- span commented on
|
|
||||||
//- a(href=post.Parent().Link())= post.Parent().TitleByUser(user)
|
|
||||||
|
|
||||||
|
component ActivityPost(post arn.Postable, user *arn.User)
|
||||||
|
if post.Parent() != nil
|
||||||
Postable(post, user, fmt.Sprintf(`<p class="activity-header"><a href="%s">%s</a></p>`, post.Parent().Link(), html.EscapeString(post.Parent().TitleByUser(user))), "")
|
Postable(post, user, fmt.Sprintf(`<p class="activity-header"><a href="%s">%s</a></p>`, post.Parent().Link(), html.EscapeString(post.Parent().TitleByUser(user))), "")
|
||||||
|
else
|
||||||
|
Postable(post, user, fmt.Sprintf(`<p class="activity-header"><a href="%s">%s</a></p>`, post.Link(), html.EscapeString(post.TitleByUser(user))), "")
|
Loading…
Reference in New Issue
Block a user