Improved activity design

This commit is contained in:
Eduard Urbach 2019-06-07 12:38:03 +09:00
parent 6ec0efe93b
commit a0ee24e81e
Signed by: akyoto
GPG Key ID: C874F672B1AF20C0
4 changed files with 27 additions and 15 deletions

View File

@ -11,6 +11,7 @@
"mixins/sidebar",
"mixins/anime-grid",
"mixins/feature-card",
"mixins/horizontal-line",
"mixins/comments",
"reset",
"base",

View File

@ -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")
@ -56,16 +56,19 @@ component Activity(activity arn.Activity, user *arn.User)
else if activity.TypeName() == "ActivityConsumeAnime"
ActivityConsumeAnimeText(activity.(*arn.ActivityConsumeAnime), user)
component ActivityConsumeAnimeTitle(activity *arn.ActivityConsumeAnime, user *arn.User)
component ActivityConsumeAnimeText(activity *arn.ActivityConsumeAnime, user *arn.User)
.activity-text-consume-anime
span watched
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)
span= fmt.Sprintf(" episodes %d - %d.", activity.FromEpisode, activity.ToEpisode)
else
em.actvity-text-consume-anime= fmt.Sprintf("%s watched episode %d", activity.Creator().Nick, activity.ToEpisode)
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)

View File

@ -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

View File

@ -0,0 +1,4 @@
mixin horizontal-line-bottom
padding-bottom typography-margin
border-bottom 1px solid reverse-light-color
margin-bottom typography-margin