diff --git a/config.json b/config.json index 272e8577..4c71cbf6 100644 --- a/config.json +++ b/config.json @@ -11,6 +11,7 @@ "mixins/sidebar", "mixins/anime-grid", "mixins/feature-card", + "mixins/horizontal-line", "mixins/comments", "reset", "base", diff --git a/pages/activity/activity.pixy b/pages/activity/activity.pixy index 09431454..2ee3c53f 100644 --- a/pages/activity/activity.pixy +++ b/pages/activity/activity.pixy @@ -31,11 +31,11 @@ component Activity(activity arn.Activity, user *arn.User) Avatar(activity.Creator()) .post-content .activity-header - .activity-parent + .activity-creator + a(href=activity.Creator().Link())= activity.Creator().Nick + if activity.TypeName() == "ActivityCreate" - ActivityCreateTitle(activity.(*arn.ActivityCreate), user) - else if activity.TypeName() == "ActivityConsumeAnime" - ActivityConsumeAnimeTitle(activity.(*arn.ActivityConsumeAnime), user) + ActivityCreateMeta(activity.(*arn.ActivityCreate), user) if user != nil //- button.activity-action.tip.action(data-action="like", data-trigger="click", aria-label="Like") @@ -50,22 +50,25 @@ component Activity(activity arn.Activity, user *arn.User) RawIcon("trash") .activity-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 ActivityConsumeAnimeTitle(activity *arn.ActivityConsumeAnime, user *arn.User) - a(href=activity.Anime().Link())= activity.Anime().TitleByUser(user) - component ActivityConsumeAnimeText(activity *arn.ActivityConsumeAnime, user *arn.User) - if activity.ToEpisode > activity.FromEpisode - em.actvity-text-consume-anime= fmt.Sprintf("%s watched episodes %d - %d", activity.Creator().Nick, activity.FromEpisode, activity.ToEpisode) - else - em.actvity-text-consume-anime= fmt.Sprintf("%s watched episode %d", activity.Creator().Nick, activity.ToEpisode) + .activity-text-consume-anime + span watched + a(href=activity.Anime().Link())= activity.Anime().TitleByUser(user) + + if activity.ToEpisode > activity.FromEpisode + span= fmt.Sprintf(" episodes %d - %d.", activity.FromEpisode, activity.ToEpisode) + else + span= fmt.Sprintf(" episode %d.", activity.ToEpisode) + +component ActivityCreateMeta(activity *arn.ActivityCreate, user *arn.User) + span in -component ActivityCreateTitle(activity *arn.ActivityCreate, user *arn.User) if activity.ObjectType == "Post" a(href=activity.Postable().Parent().Link())= activity.Postable().Parent().TitleByUser(user) else if activity.ObjectType == "Thread" @@ -77,4 +80,4 @@ component ActivityCreateText(activity *arn.ActivityCreate, user *arn.User) if activity.ObjectType == "Post" || activity.ObjectType == "Thread" div!= activity.Postable().HTML() else - em.actvity-text-create= "new " + strings.ToLower(activity.ObjectType) + em.activity-text-create= "new " + strings.ToLower(activity.ObjectType) diff --git a/pages/activity/activity.scarlet b/pages/activity/activity.scarlet index 6c2ebdbe..b9a8d719 100644 --- a/pages/activity/activity.scarlet +++ b/pages/activity/activity.scarlet @@ -11,8 +11,9 @@ .activity-header horizontal + horizontal-line-bottom -.activity-parent +.activity-creator flex 1 .activity-date @@ -21,6 +22,9 @@ .actvity-text-create opacity 0.8 +.activity-text-consume-anime + // ... + .activity-action border none background none diff --git a/styles/mixins/horizontal-line.scarlet b/styles/mixins/horizontal-line.scarlet new file mode 100644 index 00000000..c73a600c --- /dev/null +++ b/styles/mixins/horizontal-line.scarlet @@ -0,0 +1,4 @@ +mixin horizontal-line-bottom + padding-bottom typography-margin + border-bottom 1px solid reverse-light-color + margin-bottom typography-margin \ No newline at end of file