Improved activity design
This commit is contained in:
parent
6ec0efe93b
commit
a0ee24e81e
@ -11,6 +11,7 @@
|
|||||||
"mixins/sidebar",
|
"mixins/sidebar",
|
||||||
"mixins/anime-grid",
|
"mixins/anime-grid",
|
||||||
"mixins/feature-card",
|
"mixins/feature-card",
|
||||||
|
"mixins/horizontal-line",
|
||||||
"mixins/comments",
|
"mixins/comments",
|
||||||
"reset",
|
"reset",
|
||||||
"base",
|
"base",
|
||||||
|
@ -31,11 +31,11 @@ component Activity(activity arn.Activity, user *arn.User)
|
|||||||
Avatar(activity.Creator())
|
Avatar(activity.Creator())
|
||||||
.post-content
|
.post-content
|
||||||
.activity-header
|
.activity-header
|
||||||
.activity-parent
|
.activity-creator
|
||||||
|
a(href=activity.Creator().Link())= activity.Creator().Nick
|
||||||
|
|
||||||
if activity.TypeName() == "ActivityCreate"
|
if activity.TypeName() == "ActivityCreate"
|
||||||
ActivityCreateTitle(activity.(*arn.ActivityCreate), user)
|
ActivityCreateMeta(activity.(*arn.ActivityCreate), user)
|
||||||
else if activity.TypeName() == "ActivityConsumeAnime"
|
|
||||||
ActivityConsumeAnimeTitle(activity.(*arn.ActivityConsumeAnime), user)
|
|
||||||
|
|
||||||
if user != nil
|
if user != nil
|
||||||
//- button.activity-action.tip.action(data-action="like", data-trigger="click", aria-label="Like")
|
//- 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"
|
else if activity.TypeName() == "ActivityConsumeAnime"
|
||||||
ActivityConsumeAnimeText(activity.(*arn.ActivityConsumeAnime), user)
|
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)
|
component ActivityConsumeAnimeText(activity *arn.ActivityConsumeAnime, user *arn.User)
|
||||||
if activity.ToEpisode > activity.FromEpisode
|
.activity-text-consume-anime
|
||||||
em.actvity-text-consume-anime= fmt.Sprintf("%s watched episodes %d - %d", activity.Creator().Nick, activity.FromEpisode, activity.ToEpisode)
|
span watched
|
||||||
else
|
a(href=activity.Anime().Link())= activity.Anime().TitleByUser(user)
|
||||||
em.actvity-text-consume-anime= fmt.Sprintf("%s watched episode %d", activity.Creator().Nick, activity.ToEpisode)
|
|
||||||
|
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"
|
if activity.ObjectType == "Post"
|
||||||
a(href=activity.Postable().Parent().Link())= activity.Postable().Parent().TitleByUser(user)
|
a(href=activity.Postable().Parent().Link())= activity.Postable().Parent().TitleByUser(user)
|
||||||
else if activity.ObjectType == "Thread"
|
else if activity.ObjectType == "Thread"
|
||||||
@ -77,4 +80,4 @@ component ActivityCreateText(activity *arn.ActivityCreate, user *arn.User)
|
|||||||
if activity.ObjectType == "Post" || activity.ObjectType == "Thread"
|
if activity.ObjectType == "Post" || activity.ObjectType == "Thread"
|
||||||
div!= activity.Postable().HTML()
|
div!= activity.Postable().HTML()
|
||||||
else
|
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
|
.activity-header
|
||||||
horizontal
|
horizontal
|
||||||
|
horizontal-line-bottom
|
||||||
|
|
||||||
.activity-parent
|
.activity-creator
|
||||||
flex 1
|
flex 1
|
||||||
|
|
||||||
.activity-date
|
.activity-date
|
||||||
@ -21,6 +22,9 @@
|
|||||||
.actvity-text-create
|
.actvity-text-create
|
||||||
opacity 0.8
|
opacity 0.8
|
||||||
|
|
||||||
|
.activity-text-consume-anime
|
||||||
|
// ...
|
||||||
|
|
||||||
.activity-action
|
.activity-action
|
||||||
border none
|
border none
|
||||||
background 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