From e1361a1caef3aa9d1faaeb420b03c5400a44c943 Mon Sep 17 00:00:00 2001
From: Eris <femmediscord@gmail.com>
Date: Thu, 17 Jun 2021 19:29:58 +0000
Subject: Add edit profile button

---
 src/components/user_card/user_card.vue | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

(limited to 'src/components/user_card/user_card.vue')

diff --git a/src/components/user_card/user_card.vue b/src/components/user_card/user_card.vue
index a16f7873..972b72d2 100644
--- a/src/components/user_card/user_card.vue
+++ b/src/components/user_card/user_card.vue
@@ -53,6 +53,18 @@
               >
                 {{ user.name }}
               </div>
+              <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>
               <button
                 v-if="isOtherUser && !user.is_local"
                 :href="user.statusnet_profile_url"
@@ -426,7 +438,7 @@
     }
   }
 
-  .external-link-button {
+  .external-link-button, .edit-profile-button {
     cursor: pointer;
     width: 2.5em;
     text-align: center;
-- 
cgit v1.2.3-70-g09d2


From 85e2f8f78c55c3bda7733205be49c93cb34d96d2 Mon Sep 17 00:00:00 2001
From: Eris <femmediscord@gmail.com>
Date: Thu, 17 Jun 2021 20:57:23 +0000
Subject: Don't show profile edit button in sidebar

---
 src/components/user_card/user_card.vue | 4 ++++
 1 file changed, 4 insertions(+)

(limited to 'src/components/user_card/user_card.vue')

diff --git a/src/components/user_card/user_card.vue b/src/components/user_card/user_card.vue
index 972b72d2..528b92fb 100644
--- a/src/components/user_card/user_card.vue
+++ b/src/components/user_card/user_card.vue
@@ -590,6 +590,10 @@
   }
 }
 
+.sidebar .edit-profile-button {
+  display: none;
+}
+
 .user-counts {
   display: flex;
   line-height:16px;
-- 
cgit v1.2.3-70-g09d2


From dbdc5e050fa900fb31ae76ba1047390ae19407c5 Mon Sep 17 00:00:00 2001
From: Henry Jameson <me@hjkos.com>
Date: Mon, 16 Aug 2021 01:41:52 +0300
Subject: fix ext profile bug

---
 src/components/user_card/user_card.vue | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'src/components/user_card/user_card.vue')

diff --git a/src/components/user_card/user_card.vue b/src/components/user_card/user_card.vue
index 528b92fb..72c151b9 100644
--- a/src/components/user_card/user_card.vue
+++ b/src/components/user_card/user_card.vue
@@ -65,7 +65,7 @@
                   :title="$t('user_card.edit_profile')"
                 />
               </button>
-              <button
+              <a
                 v-if="isOtherUser && !user.is_local"
                 :href="user.statusnet_profile_url"
                 target="_blank"
@@ -75,7 +75,7 @@
                   class="icon"
                   icon="external-link-alt"
                 />
-              </button>
+              </a>
               <AccountActions
                 v-if="isOtherUser && loggedIn"
                 :user="user"
-- 
cgit v1.2.3-70-g09d2


From 2ac78219eee4f123c398cedb0709cc32c84740e0 Mon Sep 17 00:00:00 2001
From: Ilja <pleroma@spectraltheorem.be>
Date: Wed, 19 Jan 2022 13:09:48 +0000
Subject: Improve the user card for deactivated users

---
 src/components/follow_button/follow_button.js  |  5 ++++-
 src/components/follow_button/follow_button.vue |  2 +-
 src/components/user_card/user_card.vue         | 14 +++++++++++++-
 src/i18n/en.json                               |  1 +
 src/modules/users.js                           |  2 +-
 5 files changed, 20 insertions(+), 4 deletions(-)

(limited to 'src/components/user_card/user_card.vue')

diff --git a/src/components/follow_button/follow_button.js b/src/components/follow_button/follow_button.js
index 95e7cb6b..1a44d18e 100644
--- a/src/components/follow_button/follow_button.js
+++ b/src/components/follow_button/follow_button.js
@@ -1,6 +1,6 @@
 import { requestFollow, requestUnfollow } from '../../services/follow_manipulate/follow_manipulate'
 export default {
-  props: ['relationship', 'labelFollowing', 'buttonClass'],
+  props: ['relationship', 'user', 'labelFollowing', 'buttonClass'],
   data () {
     return {
       inProgress: false
@@ -29,6 +29,9 @@ export default {
       } else {
         return this.$t('user_card.follow')
       }
+    },
+    disabled () {
+      return this.inProgress || this.user.deactivated
     }
   },
   methods: {
diff --git a/src/components/follow_button/follow_button.vue b/src/components/follow_button/follow_button.vue
index 7f85f1d7..965d5256 100644
--- a/src/components/follow_button/follow_button.vue
+++ b/src/components/follow_button/follow_button.vue
@@ -2,7 +2,7 @@
   <button
     class="btn button-default follow-button"
     :class="{ toggled: isPressed }"
-    :disabled="inProgress"
+    :disabled="disabled"
     :title="title"
     @click="onClick"
   >
diff --git a/src/components/user_card/user_card.vue b/src/components/user_card/user_card.vue
index 6b69d15a..5f957003 100644
--- a/src/components/user_card/user_card.vue
+++ b/src/components/user_card/user_card.vue
@@ -82,6 +82,12 @@
                 @{{ user.screen_name_ui }}
               </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"
@@ -160,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"
@@ -195,6 +204,7 @@
             <button
               v-if="relationship.muting"
               class="btn button-default btn-block toggled"
+              :disabled="user.deactivated"
               @click="unmuteUser"
             >
               {{ $t('user_card.muted') }}
@@ -202,6 +212,7 @@
             <button
               v-else
               class="btn button-default btn-block"
+              :disabled="user.deactivated"
               @click="muteUser"
             >
               {{ $t('user_card.mute') }}
@@ -210,6 +221,7 @@
           <div>
             <button
               class="btn button-default btn-block"
+              :disabled="user.deactivated"
               @click="mentionUser"
             >
               {{ $t('user_card.mention') }}
diff --git a/src/i18n/en.json b/src/i18n/en.json
index 0dac0fa3..571e6ad3 100644
--- a/src/i18n/en.json
+++ b/src/i18n/en.json
@@ -727,6 +727,7 @@
     "approve": "Approve",
     "block": "Block",
     "blocked": "Blocked!",
+    "deactivated": "Deactivated",
     "deny": "Deny",
     "edit_profile": "Edit profile",
     "favorites": "Favorites",
diff --git a/src/modules/users.js b/src/modules/users.js
index fb92cc91..05ff44d5 100644
--- a/src/modules/users.js
+++ b/src/modules/users.js
@@ -393,7 +393,7 @@ const users = {
     toggleActivationStatus ({ rootState, commit }, { user }) {
       const api = user.deactivated ? rootState.api.backendInteractor.activateUser : rootState.api.backendInteractor.deactivateUser
       api({ user })
-        .then(({ deactivated }) => commit('updateActivationStatus', { user, deactivated }))
+        .then((user) => { let deactivated = !user.is_active; commit('updateActivationStatus', { user, deactivated }) })
     },
     registerPushNotifications (store) {
       const token = store.state.currentUser.credentials
-- 
cgit v1.2.3-70-g09d2

