Improved activity overview
This commit is contained in:
parent
17f734da1e
commit
4976e5ab35
@ -11,4 +11,4 @@ component Comments(parent arn.PostParent, user *arn.User)
|
|||||||
//- p.no-data.mountable No comments have been written yet.
|
//- p.no-data.mountable No comments have been written yet.
|
||||||
//- else
|
//- else
|
||||||
each post in parent.PostsRelevantFirst(5)
|
each post in parent.PostsRelevantFirst(5)
|
||||||
Postable(post, user, true, "")
|
Postable(post, user, true, false, "")
|
@ -1,5 +1,5 @@
|
|||||||
component Postable(post arn.Postable, user *arn.User, includeReplies bool, highlightAuthorID string)
|
component Postable(post arn.Postable, user *arn.User, includeReplies bool, showParent bool, highlightAuthorID string)
|
||||||
.post.mountable(id=strings.ToLower(post.TypeName()) + "-" + fmt.Sprint(post.GetID()), data-pro=post.Creator().IsPro(), data-api="/api/" + strings.ToLower(post.TypeName()) + "/" + post.GetID())
|
.post.mountable(id=fmt.Sprintf("%s-%s", strings.ToLower(post.TypeName()), post.GetID()), data-pro=post.Creator().IsPro(), data-api=fmt.Sprintf("/api/%s/%s", strings.ToLower(post.TypeName()), post.GetID()))
|
||||||
.post-parent
|
.post-parent
|
||||||
.post-author
|
.post-author
|
||||||
Avatar(post.Creator())
|
Avatar(post.Creator())
|
||||||
@ -9,6 +9,15 @@ component Postable(post arn.Postable, user *arn.User, includeReplies bool, highl
|
|||||||
.post-creator
|
.post-creator
|
||||||
a(href=post.Creator().Link())= post.Creator().Nick
|
a(href=post.Creator().Link())= post.Creator().Nick
|
||||||
|
|
||||||
|
if showParent
|
||||||
|
if post.GetParentType() == "User"
|
||||||
|
if post.GetParentID() != post.Creator().ID
|
||||||
|
span to
|
||||||
|
a(href=post.Parent().Link())= post.Parent().TitleByUser(user)
|
||||||
|
else if post.GetParentType() != ""
|
||||||
|
span in
|
||||||
|
a(href=post.Parent().Link())= post.Parent().TitleByUser(user)
|
||||||
|
|
||||||
if user == nil || user.ID == post.Creator().ID
|
if user == nil || user.ID == post.Creator().ID
|
||||||
//- Don't display a like icon.
|
//- Don't display a like icon.
|
||||||
else if post.LikedBy(user.ID)
|
else if post.LikedBy(user.ID)
|
||||||
@ -57,4 +66,4 @@ component Postable(post arn.Postable, user *arn.User, includeReplies bool, highl
|
|||||||
.replies(id="replies-" + post.GetID())
|
.replies(id="replies-" + post.GetID())
|
||||||
if includeReplies
|
if includeReplies
|
||||||
each reply in post.Posts()
|
each reply in post.Posts()
|
||||||
Postable(reply, user, true, highlightAuthorID)
|
Postable(reply, user, true, false, highlightAuthorID)
|
||||||
|
@ -2,4 +2,4 @@ component PostableList(postables []arn.Postable, user *arn.User)
|
|||||||
.thread
|
.thread
|
||||||
.posts
|
.posts
|
||||||
each post in postables
|
each post in postables
|
||||||
Postable(post, user, false, "")
|
Postable(post, user, false, false, "")
|
||||||
|
@ -26,35 +26,43 @@ component ActivitiesScrollable(entries []arn.Activity, user *arn.User)
|
|||||||
Activity(entry, user)
|
Activity(entry, user)
|
||||||
|
|
||||||
component Activity(activity arn.Activity, user *arn.User)
|
component Activity(activity arn.Activity, user *arn.User)
|
||||||
.activity.post-parent.mountable(id=fmt.Sprintf("activity-%s", activity.GetID()), data-api=utils.ActivityAPILink(activity))
|
|
||||||
.post-author
|
|
||||||
Avatar(activity.Creator())
|
|
||||||
.post-content
|
|
||||||
.post-header
|
|
||||||
.post-creator
|
|
||||||
a(href=activity.Creator().Link())= activity.Creator().Nick
|
|
||||||
|
|
||||||
if activity.TypeName() == "ActivityCreate"
|
if activity.TypeName() == "ActivityCreate"
|
||||||
ActivityCreateMeta(activity.(*arn.ActivityCreate), user)
|
ActivityCreate(activity.(*arn.ActivityCreate), user)
|
||||||
|
|
||||||
if user != nil
|
|
||||||
//- button.post-action.tip.action(data-action="like", data-trigger="click", aria-label="Like")
|
|
||||||
//- Icon("heart")
|
|
||||||
//- if activity.TypeName() == "ActivityCreate"
|
|
||||||
//- span= activity.(*arn.ActivityCreate).Object().CountLikes()
|
|
||||||
//- else
|
|
||||||
//- span= len(activity.(*arn.ActivityConsumeAnime).Likes)
|
|
||||||
|
|
||||||
if user.ID == activity.GetCreatedBy() && activity.TypeName() == "ActivityConsumeAnime"
|
|
||||||
button.post-action.tip.action(data-action="deleteObject", data-trigger="click", aria-label="Delete", data-return-path="/activity", data-confirm-type="activity")
|
|
||||||
RawIcon("trash")
|
|
||||||
|
|
||||||
.post-date.utc-date(data-date=activity.GetCreated())
|
|
||||||
|
|
||||||
if activity.TypeName() == "ActivityCreate"
|
|
||||||
ActivityCreateText(activity.(*arn.ActivityCreate), user)
|
|
||||||
else if activity.TypeName() == "ActivityConsumeAnime"
|
else if activity.TypeName() == "ActivityConsumeAnime"
|
||||||
ActivityConsumeAnimeText(activity.(*arn.ActivityConsumeAnime), user)
|
ActivityConsumeAnime(activity.(*arn.ActivityConsumeAnime), user)
|
||||||
|
|
||||||
|
//- .activity.post-parent.mountable(id=fmt.Sprintf("activity-%s", activity.GetID()), data-api=utils.ActivityAPILink(activity))
|
||||||
|
//- .post-author
|
||||||
|
//- Avatar(activity.Creator())
|
||||||
|
//- .post-content
|
||||||
|
//- .post-header
|
||||||
|
//- .post-creator
|
||||||
|
//- a(href=activity.Creator().Link())= activity.Creator().Nick
|
||||||
|
|
||||||
|
//- if activity.TypeName() == "ActivityCreate"
|
||||||
|
//- ActivityCreateMeta(activity.(*arn.ActivityCreate), user)
|
||||||
|
|
||||||
|
//- if user != nil
|
||||||
|
//- //- button.post-action.tip.action(data-action="like", data-trigger="click", aria-label="Like")
|
||||||
|
//- //- Icon("heart")
|
||||||
|
//- //- if activity.TypeName() == "ActivityCreate"
|
||||||
|
//- //- span= activity.(*arn.ActivityCreate).Object().CountLikes()
|
||||||
|
//- //- else
|
||||||
|
//- //- span= len(activity.(*arn.ActivityConsumeAnime).Likes)
|
||||||
|
|
||||||
|
//- if user.ID == activity.GetCreatedBy() && activity.TypeName() == "ActivityConsumeAnime"
|
||||||
|
//- button.post-action.tip.action(data-action="deleteObject", data-trigger="click", aria-label="Delete", data-return-path="/activity", data-confirm-type="activity")
|
||||||
|
//- RawIcon("trash")
|
||||||
|
|
||||||
|
//- .post-date.utc-date(data-date=activity.GetCreated())
|
||||||
|
|
||||||
|
//- if activity.TypeName() == "ActivityCreate"
|
||||||
|
//- ActivityCreateText(activity.(*arn.ActivityCreate), user)
|
||||||
|
//- else if activity.TypeName() == "ActivityConsumeAnime"
|
||||||
|
//- ActivityConsumeAnimeText(activity.(*arn.ActivityConsumeAnime), user)
|
||||||
|
|
||||||
|
component ActivityConsumeAnime(activity *arn.ActivityConsumeAnime, user *arn.User)
|
||||||
|
h1 TODO
|
||||||
|
|
||||||
component ActivityConsumeAnimeText(activity *arn.ActivityConsumeAnime, user *arn.User)
|
component ActivityConsumeAnimeText(activity *arn.ActivityConsumeAnime, user *arn.User)
|
||||||
span watched
|
span watched
|
||||||
@ -65,6 +73,9 @@ component ActivityConsumeAnimeText(activity *arn.ActivityConsumeAnime, user *arn
|
|||||||
else
|
else
|
||||||
span= fmt.Sprintf(" episode %d.", activity.ToEpisode)
|
span= fmt.Sprintf(" episode %d.", activity.ToEpisode)
|
||||||
|
|
||||||
|
component ActivityCreate(activity *arn.ActivityCreate, user *arn.User)
|
||||||
|
Postable(activity.Postable(), user, false, true, "")
|
||||||
|
|
||||||
component ActivityCreateMeta(activity *arn.ActivityCreate, user *arn.User)
|
component ActivityCreateMeta(activity *arn.ActivityCreate, user *arn.User)
|
||||||
if activity.ObjectType == "Post"
|
if activity.ObjectType == "Post"
|
||||||
if activity.Postable().GetParentType() != "User"
|
if activity.Postable().GetParentType() != "User"
|
||||||
|
@ -1,11 +1,9 @@
|
|||||||
component Post(post *arn.Post, user *arn.User)
|
component Post(post *arn.Post, user *arn.User)
|
||||||
.thread
|
.thread
|
||||||
.posts
|
.posts
|
||||||
Postable(post, user, true, "")
|
Postable(post, user, true, true, "")
|
||||||
|
|
||||||
.side-note-container.mountable
|
|
||||||
if user != nil && user.Role == "admin"
|
if user != nil && user.Role == "admin"
|
||||||
|
.side-note-container.mountable
|
||||||
a.side-note.tip(href=post.Link() + "/edit", aria-label="Admin Edit")
|
a.side-note.tip(href=post.Link() + "/edit", aria-label="Admin Edit")
|
||||||
Icon("edit")
|
Icon("edit")
|
||||||
|
|
||||||
a.side-note(href=post.Parent().Link())= post.Parent().TitleByUser(user)
|
|
||||||
|
@ -3,7 +3,7 @@ component Thread(thread *arn.Thread, user *arn.User)
|
|||||||
|
|
||||||
#thread.thread(data-id=thread.ID)
|
#thread.thread(data-id=thread.ID)
|
||||||
.posts
|
.posts
|
||||||
Postable(thread, user, true, thread.Creator().ID)
|
Postable(thread, user, true, false, thread.Creator().ID)
|
||||||
|
|
||||||
//- Reply
|
//- Reply
|
||||||
if user != nil
|
if user != nil
|
||||||
|
Loading…
Reference in New Issue
Block a user