aboutsummaryrefslogtreecommitdiff
path: root/src/components/user_card
diff options
context:
space:
mode:
authorHenry Jameson <me@hjkos.com>2022-01-24 19:28:38 +0200
committerHenry Jameson <me@hjkos.com>2022-01-24 19:28:38 +0200
commitc551e3e6974164f221a81ebc2d3bfbcac7978058 (patch)
tree636f3185698152073e4fe822fa3805c1309e635f /src/components/user_card
parent49fe33418609e68e4056783e84292ac856b989a5 (diff)
parent182fcca5da9fa284f46f5ca1c8b1790353dec316 (diff)
Merge remote-tracking branch 'origin/develop' into proper-attachments
* origin/develop: (81 commits) Improve the user card for deactivated users Update CHANGELOG.md Update CHANGELOG.md Allow canceling a follow request Simple policy reasons for instance specific policies entity_normalizer: Escape name when parsing user Translated using Weblate (Spanish) Translated using Weblate (Catalan) Translated using Weblate (Korean) Translated using Weblate (Japanese (ja_PEDANTIC)) Translated using Weblate (Indonesian) Translated using Weblate (Esperanto) Translated using Weblate (Vietnamese) Translated using Weblate (Italian) Translated using Weblate (Vietnamese) Translated using Weblate (Indonesian) Translated using Weblate (Italian) Translated using Weblate (Vietnamese) Translated using Weblate (Indonesian) Translated using Weblate (Chinese (Simplified)) ...
Diffstat (limited to 'src/components/user_card')
-rw-r--r--src/components/user_card/user_card.js9
-rw-r--r--src/components/user_card/user_card.vue34
2 files changed, 38 insertions, 5 deletions
diff --git a/src/components/user_card/user_card.js b/src/components/user_card/user_card.js
index a453ce79..4168c54a 100644
--- a/src/components/user_card/user_card.js
+++ b/src/components/user_card/user_card.js
@@ -13,14 +13,16 @@ import {
faBell,
faRss,
faSearchPlus,
- faExternalLinkAlt
+ faExternalLinkAlt,
+ faEdit
} from '@fortawesome/free-solid-svg-icons'
library.add(
faRss,
faBell,
faSearchPlus,
- faExternalLinkAlt
+ faExternalLinkAlt,
+ faEdit
)
export default {
@@ -155,6 +157,9 @@ export default {
this.$store.state.instance.restrictedNicknames
)
},
+ openProfileTab () {
+ this.$store.dispatch('openSettingsModalTab', 'profile')
+ },
zoomAvatar () {
const attachment = {
url: this.user.profile_image_url_original,
diff --git a/src/components/user_card/user_card.vue b/src/components/user_card/user_card.vue
index 794a2350..5f957003 100644
--- a/src/components/user_card/user_card.vue
+++ b/src/components/user_card/user_card.vue
@@ -45,6 +45,18 @@
:emoji="user.emoji"
/>
<button
+ v-if="!isOtherUser && user.is_local"
+ class="button-unstyled edit-profile-button"
+ @click.stop="openProfileTab"
+ >
+ <FAIcon
+ fixed-width
+ class="icon"
+ icon="edit"
+ :title="$t('user_card.edit_profile')"
+ />
+ </button>
+ <a
v-if="isOtherUser && !user.is_local"
:href="user.statusnet_profile_url"
target="_blank"
@@ -54,7 +66,7 @@
class="icon"
icon="external-link-alt"
/>
- </button>
+ </a>
<AccountActions
v-if="isOtherUser && loggedIn"
:user="user"
@@ -71,6 +83,12 @@
</router-link>
<template v-if="!hideBio">
<span
+ v-if="user.deactivated"
+ class="alert user-role"
+ >
+ {{ $t('user_card.deactivated') }}
+ </span>
+ <span
v-if="!!visibleRole"
class="alert user-role"
>
@@ -148,7 +166,10 @@
class="user-interactions"
>
<div class="btn-group">
- <FollowButton :relationship="relationship" />
+ <FollowButton
+ :relationship="relationship"
+ :user="user"
+ />
<template v-if="relationship.following">
<ProgressButton
v-if="!relationship.subscribing"
@@ -183,6 +204,7 @@
<button
v-if="relationship.muting"
class="btn button-default btn-block toggled"
+ :disabled="user.deactivated"
@click="unmuteUser"
>
{{ $t('user_card.muted') }}
@@ -190,6 +212,7 @@
<button
v-else
class="btn button-default btn-block"
+ :disabled="user.deactivated"
@click="muteUser"
>
{{ $t('user_card.mute') }}
@@ -198,6 +221,7 @@
<div>
<button
class="btn button-default btn-block"
+ :disabled="user.deactivated"
@click="mentionUser"
>
{{ $t('user_card.mention') }}
@@ -405,7 +429,7 @@
}
}
- .external-link-button {
+ .external-link-button, .edit-profile-button {
cursor: pointer;
width: 2.5em;
text-align: center;
@@ -545,6 +569,10 @@
}
}
+.sidebar .edit-profile-button {
+ display: none;
+}
+
.user-counts {
display: flex;
line-height:16px;