99 lines
4.0 KiB
Plaintext
Raw Normal View History

2018-11-12 06:05:46 +00:00
component ActivityFeed(entries []arn.Activity, nextIndex int, user *arn.User)
h1.page-title Activity
.tabs
Tab("Global", "globe", "/activity")
Tab("Followed", "user-plus", "/activity/followed")
2018-10-31 05:27:48 +00:00
2018-11-12 06:05:46 +00:00
if len(entries) == 0
p.no-data.mountable No activity here.
else
#load-more-target.activities
ActivitiesScrollable(entries, user)
if nextIndex != -1
.buttons
LoadMore(nextIndex)
#load-new-activities(data-count="0")
.buttons
button.page-main-action.action(data-action="reloadContent", data-trigger="click")
Icon("refresh")
span#load-new-activities-text 0 new activities
2018-10-31 05:27:48 +00:00
2018-11-12 06:05:46 +00:00
component ActivitiesScrollable(entries []arn.Activity, user *arn.User)
each entry in entries
Activity(entry, user)
2018-11-12 01:41:46 +00:00
component Activity(activity arn.Activity, user *arn.User)
2019-08-30 01:02:22 +00:00
if activity.TypeName() == "ActivityCreate"
ActivityCreate(activity.(*arn.ActivityCreate), user)
else if activity.TypeName() == "ActivityConsumeAnime"
ActivityConsumeAnime(activity.(*arn.ActivityConsumeAnime), user)
2019-06-07 03:38:03 +00:00
2019-08-30 01:02:22 +00:00
//- .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
2019-08-30 02:42:46 +00:00
//- .post-header-info
2019-08-30 01:02:22 +00:00
//- a(href=activity.Creator().Link())= activity.Creator().Nick
//- if activity.TypeName() == "ActivityCreate"
//- ActivityCreateMeta(activity.(*arn.ActivityCreate), user)
2018-11-12 01:41:46 +00:00
2019-08-30 01:02:22 +00:00
//- 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)
2018-11-16 20:33:40 +00:00
2019-08-30 01:02:22 +00:00
//- 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")
2018-11-12 05:52:02 +00:00
2019-08-30 01:02:22 +00:00
//- .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)
2019-06-07 03:38:03 +00:00
2019-08-30 01:02:22 +00:00
component ActivityConsumeAnime(activity *arn.ActivityConsumeAnime, user *arn.User)
h1 TODO
2018-11-12 02:40:46 +00:00
component ActivityConsumeAnimeText(activity *arn.ActivityConsumeAnime, user *arn.User)
2019-06-09 03:06:01 +00:00
span watched
a(href=activity.Anime().Link())= activity.Anime().TitleByUser(user)
2019-06-07 03:38:03 +00:00
2019-06-09 03:06:01 +00:00
if activity.ToEpisode > activity.FromEpisode
span= fmt.Sprintf(" episodes %d - %d.", activity.FromEpisode, activity.ToEpisode)
else
span= fmt.Sprintf(" episode %d.", activity.ToEpisode)
2019-06-07 03:38:03 +00:00
2019-08-30 01:02:22 +00:00
component ActivityCreate(activity *arn.ActivityCreate, user *arn.User)
Postable(activity.Postable(), user, false, true, "")
2019-06-07 03:38:03 +00:00
component ActivityCreateMeta(activity *arn.ActivityCreate, user *arn.User)
2018-11-12 01:41:46 +00:00
if activity.ObjectType == "Post"
2019-08-27 06:44:10 +00:00
if activity.Postable().GetParentType() != "User"
2019-08-27 06:03:29 +00:00
span in
a(href=activity.Postable().Parent().Link())= activity.Postable().Parent().TitleByUser(user)
2019-08-27 06:44:10 +00:00
else if activity.Postable().GetParentID() != activity.CreatedBy
span to
a(href=activity.Postable().Parent().Link())= activity.Postable().Parent().TitleByUser(user)
2018-11-12 01:41:46 +00:00
else if activity.ObjectType == "Thread"
2019-08-27 06:03:29 +00:00
span in
2018-11-12 01:41:46 +00:00
a(href=activity.Postable().Link())= activity.Postable().TitleByUser(user)
else if activity.ObjectType == "AMV" || activity.ObjectType == "SoundTrack" || activity.ObjectType == "Quote"
2019-08-27 06:03:29 +00:00
span in
a(href=activity.Object().(arn.PostParent).Link())= activity.Object().(arn.PostParent).TitleByUser(user)
2018-11-12 01:41:46 +00:00
component ActivityCreateText(activity *arn.ActivityCreate, user *arn.User)
if activity.ObjectType == "Post" || activity.ObjectType == "Thread"
div!= activity.Postable().HTML()
else
2019-06-07 03:38:03 +00:00
em.activity-text-create= "new " + strings.ToLower(activity.ObjectType)