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.
|
||||
//- else
|
||||
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)
|
||||
.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())
|
||||
component Postable(post arn.Postable, user *arn.User, includeReplies bool, showParent bool, highlightAuthorID string)
|
||||
.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-author
|
||||
Avatar(post.Creator())
|
||||
@ -8,6 +8,15 @@ component Postable(post arn.Postable, user *arn.User, includeReplies bool, highl
|
||||
.post-header
|
||||
.post-creator
|
||||
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
|
||||
//- Don't display a like icon.
|
||||
@ -57,4 +66,4 @@ component Postable(post arn.Postable, user *arn.User, includeReplies bool, highl
|
||||
.replies(id="replies-" + post.GetID())
|
||||
if includeReplies
|
||||
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
|
||||
.posts
|
||||
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)
|
||||
|
||||
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"
|
||||
ActivityCreate(activity.(*arn.ActivityCreate), user)
|
||||
else if activity.TypeName() == "ActivityConsumeAnime"
|
||||
ActivityConsumeAnime(activity.(*arn.ActivityConsumeAnime), user)
|
||||
|
||||
if activity.TypeName() == "ActivityCreate"
|
||||
ActivityCreateMeta(activity.(*arn.ActivityCreate), 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 != 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")
|
||||
//- 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())
|
||||
//- .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)
|
||||
//- 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)
|
||||
span watched
|
||||
@ -65,6 +73,9 @@ component ActivityConsumeAnimeText(activity *arn.ActivityConsumeAnime, user *arn
|
||||
else
|
||||
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)
|
||||
if activity.ObjectType == "Post"
|
||||
if activity.Postable().GetParentType() != "User"
|
||||
|
@ -1,11 +1,9 @@
|
||||
component Post(post *arn.Post, user *arn.User)
|
||||
.thread
|
||||
.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")
|
||||
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)
|
||||
.posts
|
||||
Postable(thread, user, true, thread.Creator().ID)
|
||||
Postable(thread, user, true, false, thread.Creator().ID)
|
||||
|
||||
//- Reply
|
||||
if user != nil
|
||||
|
Loading…
Reference in New Issue
Block a user