Improved user profiles

This commit is contained in:
Eduard Urbach 2018-11-15 20:53:24 +09:00
parent d5dff615c1
commit 2b3a6329d2
3 changed files with 48 additions and 28 deletions

View File

@ -3,45 +3,60 @@ component Profile(viewUser *arn.User, user *arn.User, animeList *arn.AnimeList,
ProfileHeader(viewUser, user, uri)
.profile-columns
.profile-column.profile-favorites
//- Favorites
.profile-column.profile-favorites.mountable(data-mountable-type="column")
.profile-section
h3.profile-column-header.mountable Anime
h3.profile-column-header.mountable(data-mountable-type="favorites") Anime
.profile-favorite-anime-container
each item in animeList.Top(6)
a.profile-favorite-anime.tip.mountable(href=item.Anime().Link(), aria-label=item.Anime().Title.ByUser(user), data-mountable-type="favorites")
img.profile-favorite-anime-image.lazy(data-src=item.Anime().ImageLink("small"), data-webp=true, alt=item.Anime().Title.ByUser(user))
if len(animeList.Items) == 0
p.no-data.mountable(data-mountable-type="favorites") Nothing here yet.
else
.profile-favorite-anime-container
each item in animeList.Top(6)
a.profile-favorite-anime.tip.mountable(href=item.Anime().Link(), aria-label=item.Anime().Title.ByUser(user), data-mountable-type="favorites")
img.profile-favorite-anime-image.lazy(data-src=item.Anime().ImageLink("small"), data-webp=true, alt=item.Anime().Title.ByUser(user))
.profile-section
h3.profile-column-header.mountable(data-mountable-type="favorites") Characters
.profile-favorite-characters-container
each character in characters
.mountable(data-mountable-type="favorites")
CharacterSmall(character, user)
//- a.profile-favorite-character.tip.mountable(href=character.Link(), aria-label=character.Name.ByUser(user), data-mountable-type="favorite-anime")
//- img.profile-favorite-character-image.lazy(data-src=character.ImageLink("small"), data-webp=true, alt=character.Name.ByUser(user))
if len(characters) == 0
p.no-data.mountable(data-mountable-type="favorites") Nothing here yet.
else
.profile-favorite-characters-container
each character in characters
.mountable(data-mountable-type="favorites")
CharacterSmall(character, user)
//- a.profile-favorite-character.tip.mountable(href=character.Link(), aria-label=character.Name.ByUser(user), data-mountable-type="favorite-anime")
//- img.profile-favorite-character-image.lazy(data-src=character.ImageLink("small"), data-webp=true, alt=character.Name.ByUser(user))
.profile-column.profile-activity
//- Posts
.profile-column.profile-activity.mountable(data-mountable-type="column")
.profile-section
h3.profile-column-header.mountable(data-mountable-type="activity") Activity
h3.profile-column-header.mountable(data-mountable-type="activity") Posts
Comments(viewUser, user)
.profile-column.profile-extra
//- Extra
.profile-column.profile-extra.mountable(data-mountable-type="column")
.profile-section
h3.profile-column-header.mountable(data-mountable-type="extra") Genres
.anime-genres
each genre in topGenres
a.anime-genre.mountable(href="/genre/" + strings.ToLower(genre), data-mountable-type="extra")= genre
if len(topGenres) == 0
p.no-data.mountable(data-mountable-type="extra") Nothing here yet.
else
.anime-genres
each genre in topGenres
a.anime-genre.mountable(href="/genre/" + strings.ToLower(genre), data-mountable-type="extra")= genre
.profile-section
h3.profile-column-header.mountable(data-mountable-type="extra") Friends
.profile-friends
each friend in friends
.profile-friend.mountable(data-mountable-type="extra")
Avatar(friend)
if len(friends) == 0
p.no-data.mountable(data-mountable-type="extra") Nothing here yet.
else
.profile-friends
each friend in friends
.profile-friend.mountable(data-mountable-type="extra")
Avatar(friend)
component ProfileHeader(viewUser *arn.User, user *arn.User, uri string)
ProfileHead(viewUser, user, uri)

View File

@ -55,6 +55,12 @@ const profile-image-size = 280px
.profile-section
margin-bottom 1rem
.no-data
text-align left
&.mounted
opacity 0.5 !important
.profile-favorite-anime-container
display grid
grid-template-columns repeat(auto-fill, anime-image-small-width)
@ -74,8 +80,7 @@ const profile-image-size = 280px
// anime-mini-item
.profile-favorite-anime-image
// anime-mini-item-image
border-radius ui-element-border-radius
anime-mini-item-image
.profile-favorite-characters-container
display grid

View File

@ -380,7 +380,7 @@ var routeTests = map[string][]string{
},
"/api/notification/:id": []string{
"/api/notification/u2WHJpkigm",
"/api/notification/q6Y6eraig",
},
"/api/quote/:id": []string{