Improved activity design
This commit is contained in:
parent
6ec0efe93b
commit
a0ee24e81e
@ -11,6 +11,7 @@
|
||||
"mixins/sidebar",
|
||||
"mixins/anime-grid",
|
||||
"mixins/feature-card",
|
||||
"mixins/horizontal-line",
|
||||
"mixins/comments",
|
||||
"reset",
|
||||
"base",
|
||||
|
@ -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)
|
||||
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)
|
||||
|
@ -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
|
||||
|
4
styles/mixins/horizontal-line.scarlet
Normal file
4
styles/mixins/horizontal-line.scarlet
Normal file
@ -0,0 +1,4 @@
|
||||
mixin horizontal-line-bottom
|
||||
padding-bottom typography-margin
|
||||
border-bottom 1px solid reverse-light-color
|
||||
margin-bottom typography-margin
|
Loading…
Reference in New Issue
Block a user