commit: 2d07f26dd7ee21745aeac9f827421150f9ee6cbb
parent: a954f56e3444e921dcf5ff6651e443ac110f1804
Author: HJ <30-hj@users.noreply.git.pleroma.social>
Date: Wed, 1 May 2019 20:30:40 +0000
Merge branch 'feat/title-alt-for-avatars' into 'develop'
#513 Title/alt for avatars
See merge request pleroma/pleroma-fe!776
Diffstat:
10 files changed, 33 insertions(+), 19 deletions(-)
diff --git a/src/components/avatar_list/avatar_list.js b/src/components/avatar_list/avatar_list.js
@@ -1,10 +1,10 @@
import UserAvatar from '../user_avatar/user_avatar.vue'
const AvatarList = {
- props: ['avatars'],
+ props: ['users'],
computed: {
- slicedAvatars () {
- return this.avatars ? this.avatars.slice(0, 15) : []
+ slicedUsers () {
+ return this.users ? this.users.slice(0, 15) : []
}
},
components: {
diff --git a/src/components/avatar_list/avatar_list.vue b/src/components/avatar_list/avatar_list.vue
@@ -1,7 +1,7 @@
<template>
<div class="avatars">
- <div class="avatars-item" v-for="avatar in slicedAvatars">
- <UserAvatar :src="avatar.profile_image_url" class="avatar-small" />
+ <div class="avatars-item" v-for="user in slicedUsers">
+ <UserAvatar :user="user" class="avatar-small" />
</div>
</div>
</template>
diff --git a/src/components/basic_user_card/basic_user_card.vue b/src/components/basic_user_card/basic_user_card.vue
@@ -1,7 +1,11 @@
<template>
<div class="basic-user-card">
<router-link :to="userProfileLink(user)">
- <UserAvatar class="avatar" @click.prevent.native="toggleUserExpanded" :src="user.profile_image_url"/>
+ <UserAvatar
+ class="avatar"
+ :user="user"
+ @click.prevent.native="toggleUserExpanded"
+ />
</router-link>
<div class="basic-user-card-expanded-content" v-if="userExpanded">
<UserCard :user="user" :rounded="true" :bordered="true"/>
diff --git a/src/components/notification/notification.vue b/src/components/notification/notification.vue
@@ -7,7 +7,7 @@
</status>
<div class="non-mention" :class="[userClass, { highlighted: userStyle }]" :style="[ userStyle ]" v-else>
<a class='avatar-container' :href="notification.from_profile.statusnet_profile_url" @click.stop.prevent.capture="toggleUserExpanded">
- <UserAvatar :compact="true" :betterShadow="betterShadow" :src="notification.from_profile.profile_image_url_original" />
+ <UserAvatar :compact="true" :betterShadow="betterShadow" :user="notification.from_profile"/>
</a>
<div class='notification-right'>
<UserCard :user="getUser(notification)" :rounded="true" :bordered="true" v-if="userExpanded" />
diff --git a/src/components/status/status.js b/src/components/status/status.js
@@ -263,13 +263,13 @@ const Status = {
}
return this.status.summary_html + '<br />' + this.status.statusnet_html
},
- combinedFavsAndRepeatsAvatars () {
+ combinedFavsAndRepeatsUsers () {
// Use the status from the global status repository since favs and repeats are saved in it
- const combinedAvatars = [].concat(
+ const combinedUsers = [].concat(
this.statusFromGlobalRepository.favoritedBy,
this.statusFromGlobalRepository.rebloggedBy
)
- return uniqBy(combinedAvatars, 'id')
+ return uniqBy(combinedUsers, 'id')
}
},
components: {
diff --git a/src/components/status/status.vue b/src/components/status/status.vue
@@ -13,7 +13,7 @@
</template>
<template v-else>
<div v-if="retweet && !noHeading && !inConversation" :class="[repeaterClass, { highlighted: repeaterStyle }]" :style="[repeaterStyle]" class="media container retweet-info">
- <UserAvatar class="media-left" v-if="retweet" :betterShadow="betterShadow" :src="statusoid.user.profile_image_url_original"/>
+ <UserAvatar class="media-left" v-if="retweet" :betterShadow="betterShadow" :user="statusoid.user"/>
<div class="media-body faint">
<span class="user-name">
<router-link v-if="retweeterHtml" :to="retweeterProfileLink" v-html="retweeterHtml"/>
@@ -27,7 +27,7 @@
<div :class="[userClass, { highlighted: userStyle, 'is-retweet': retweet && !inConversation }]" :style="[ userStyle ]" class="media status">
<div v-if="!noHeading" class="media-left">
<router-link :to="userProfileLink" @click.stop.prevent.capture.native="toggleUserExpanded">
- <UserAvatar :compact="compact" :betterShadow="betterShadow" :src="status.user.profile_image_url_original"/>
+ <UserAvatar :compact="compact" :betterShadow="betterShadow" :user="status.user"/>
</router-link>
</div>
<div class="status-body">
@@ -91,8 +91,13 @@
</div>
<div v-if="showPreview" class="status-preview-container">
- <status class="status-preview" v-if="preview" :isPreview="true" :statusoid="preview" :compact=true></status>
- <div class="status-preview status-preview-loading" v-else>
+ <status class="status-preview"
+ v-if="preview"
+ :isPreview="true"
+ :statusoid="preview"
+ :compact=true
+ />
+ <div v-else class="status-preview status-preview-loading">
<i class="icon-spin4 animate-spin"></i>
</div>
</div>
@@ -134,7 +139,7 @@
</div>
<transition name="fade">
- <div class="favs-repeated-users" v-if="combinedFavsAndRepeatsAvatars.length > 0 && isFocused">
+ <div class="favs-repeated-users" v-if="combinedFavsAndRepeatsUsers.length > 0 && isFocused">
<div class="stats">
<div class="stat-count" v-if="statusFromGlobalRepository.rebloggedBy && statusFromGlobalRepository.rebloggedBy.length > 0">
<a class="stat-title">{{ $t('status.repeats') }}</a>
@@ -145,7 +150,7 @@
<div class="stat-number">{{ statusFromGlobalRepository.favoritedBy.length }}</div>
</div>
<div class="avatar-row">
- <AvatarList :avatars='combinedFavsAndRepeatsAvatars'></AvatarList>
+ <AvatarList :users="combinedFavsAndRepeatsUsers"></AvatarList>
</div>
</div>
</div>
diff --git a/src/components/user_avatar/user_avatar.js b/src/components/user_avatar/user_avatar.js
@@ -2,7 +2,7 @@ import StillImage from '../still-image/still-image.vue'
const UserAvatar = {
props: [
- 'src',
+ 'user',
'betterShadow',
'compact'
],
diff --git a/src/components/user_avatar/user_avatar.vue b/src/components/user_avatar/user_avatar.vue
@@ -1,8 +1,10 @@
<template>
<StillImage
class="avatar"
+ :alt="user.screen_name"
+ :title="user.screen_name"
+ :src="user.profile_image_url_original"
:class="{ 'avatar-compact': compact, 'better-shadow': betterShadow }"
- :src="imgSrc"
:imageLoadError="imageLoadError"
/>
</template>
diff --git a/src/components/user_card/user_card.vue b/src/components/user_card/user_card.vue
@@ -4,7 +4,7 @@
<div class='user-info'>
<div class='container'>
<router-link :to="userProfileLink(user)">
- <UserAvatar :betterShadow="betterShadow" :src="user.profile_image_url_original"/>
+ <UserAvatar :betterShadow="betterShadow" :user="user"/>
</router-link>
<div class="name-and-screen-name">
<div class="top-line">
diff --git a/src/services/entity_normalizer/entity_normalizer.service.js b/src/services/entity_normalizer/entity_normalizer.service.js
@@ -275,6 +275,9 @@ export const parseStatus = (data) => {
output.retweeted_status = parseStatus(retweetedStatus)
}
+ output.favoritedBy = []
+ output.rebloggedBy = []
+
return output
}