From 18594569bd0fe77507ee700ddcc1cc2589f925dd Mon Sep 17 00:00:00 2001
From: Maxim Filippov <colixer@gmail.com>
Date: Wed, 30 Jan 2019 01:11:40 +0300
Subject: Split hide_network into hide_followers & hide_followings

---
 src/components/user_settings/user_settings.vue | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

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

diff --git a/src/components/user_settings/user_settings.vue b/src/components/user_settings/user_settings.vue
index d0743ef0..af8a1208 100644
--- a/src/components/user_settings/user_settings.vue
+++ b/src/components/user_settings/user_settings.vue
@@ -30,8 +30,12 @@
               <label for="account-no-rich-text">{{$t('settings.no_rich_text_description')}}</label>
             </p>
             <p>
-              <input type="checkbox" v-model="newHideNetwork" id="account-hide-network">
-              <label for="account-hide-network">{{$t('settings.hide_network_description')}}</label>
+              <input type="checkbox" v-model="hideFollowings" id="account-hide-followings">
+              <label for="account-hide-followings">{{$t('settings.hide_followings_description')}}</label>
+            </p>
+            <p>
+              <input type="checkbox" v-model="hideFollowers" id="account-hide-followers">
+              <label for="account-hide-followers">{{$t('settings.hide_followers_description')}}</label>
             </p>
             <button :disabled='newName && newName.length === 0' class="btn btn-default" @click="updateProfile">{{$t('general.submit')}}</button>
           </div>
-- 
cgit v1.2.3-70-g09d2


From 0c5c8898509e195654f4a42be77c59dbf6713c34 Mon Sep 17 00:00:00 2001
From: Maxim Filippov <colixer@gmail.com>
Date: Wed, 6 Feb 2019 14:21:13 +0300
Subject: Rename "hide_following" to "hide_follows"

---
 src/components/user_settings/user_settings.js               | 6 +++---
 src/components/user_settings/user_settings.vue              | 4 ++--
 src/i18n/de.json                                            | 2 +-
 src/i18n/en.json                                            | 2 +-
 src/i18n/ja.json                                            | 2 +-
 src/i18n/ko.json                                            | 2 +-
 src/i18n/ru.json                                            | 2 +-
 src/services/api/api.service.js                             | 2 +-
 src/services/entity_normalizer/entity_normalizer.service.js | 2 +-
 9 files changed, 12 insertions(+), 12 deletions(-)

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

diff --git a/src/components/user_settings/user_settings.js b/src/components/user_settings/user_settings.js
index 64f18373..ef9398f6 100644
--- a/src/components/user_settings/user_settings.js
+++ b/src/components/user_settings/user_settings.js
@@ -12,7 +12,7 @@ const UserSettings = {
       newLocked: this.$store.state.users.currentUser.locked,
       newNoRichText: this.$store.state.users.currentUser.no_rich_text,
       newDefaultScope: this.$store.state.users.currentUser.default_scope,
-      hideFollowings: this.$store.state.users.currentUser.hide_followings,
+      hideFollows: this.$store.state.users.currentUser.hide_follows,
       hideFollowers: this.$store.state.users.currentUser.hide_followers,
       followList: null,
       followImportError: false,
@@ -69,7 +69,7 @@ const UserSettings = {
       /* eslint-disable camelcase */
       const default_scope = this.newDefaultScope
       const no_rich_text = this.newNoRichText
-      const hide_followings = this.hideFollowings
+      const hide_follows = this.hideFollows
       const hide_followers = this.hideFollowers
       /* eslint-enable camelcase */
       this.$store.state.api.backendInteractor
@@ -82,7 +82,7 @@ const UserSettings = {
             /* eslint-disable camelcase */
             default_scope,
             no_rich_text,
-            hide_followings,
+            hide_follows,
             hide_followers
             /* eslint-enable camelcase */
           }}).then((user) => {
diff --git a/src/components/user_settings/user_settings.vue b/src/components/user_settings/user_settings.vue
index af8a1208..19b7bdbd 100644
--- a/src/components/user_settings/user_settings.vue
+++ b/src/components/user_settings/user_settings.vue
@@ -30,8 +30,8 @@
               <label for="account-no-rich-text">{{$t('settings.no_rich_text_description')}}</label>
             </p>
             <p>
-              <input type="checkbox" v-model="hideFollowings" id="account-hide-followings">
-              <label for="account-hide-followings">{{$t('settings.hide_followings_description')}}</label>
+              <input type="checkbox" v-model="hideFollows" id="account-hide-follows">
+              <label for="account-hide-follows">{{$t('settings.hide_follows_description')}}</label>
             </p>
             <p>
               <input type="checkbox" v-model="hideFollowers" id="account-hide-followers">
diff --git a/src/i18n/de.json b/src/i18n/de.json
index 82860e9e..59449e33 100644
--- a/src/i18n/de.json
+++ b/src/i18n/de.json
@@ -155,7 +155,7 @@
     "notification_visibility_mentions": "Erwähnungen",
     "notification_visibility_repeats": "Wiederholungen",
     "no_rich_text_description": "Rich-Text Formatierungen von allen Beiträgen entfernen",
-    "hide_followings_description": "Zeige nicht, wem ich folge",
+    "hide_follows_description": "Zeige nicht, wem ich folge",
     "hide_followers_description": "Zeige nicht, wer mir folgt",
     "nsfw_clickthrough": "Aktiviere ausblendbares Overlay für Anhänge, die als NSFW markiert sind",
     "panelRadius": "Panel",
diff --git a/src/i18n/en.json b/src/i18n/en.json
index dc10fa7f..ac7cc2a7 100644
--- a/src/i18n/en.json
+++ b/src/i18n/en.json
@@ -164,7 +164,7 @@
     "notification_visibility_mentions": "Mentions",
     "notification_visibility_repeats": "Repeats",
     "no_rich_text_description": "Strip rich text formatting from all posts",
-    "hide_followings_description": "Don't show who I'm following",
+    "hide_follows_description": "Don't show who I'm following",
     "hide_followers_description": "Don't show who's following me",
     "nsfw_clickthrough": "Enable clickthrough NSFW attachment hiding",
     "panelRadius": "Panels",
diff --git a/src/i18n/ja.json b/src/i18n/ja.json
index 37e96f6c..afce03a4 100644
--- a/src/i18n/ja.json
+++ b/src/i18n/ja.json
@@ -157,7 +157,7 @@
     "notification_visibility_mentions": "メンション",
     "notification_visibility_repeats": "リピート",
     "no_rich_text_description": "リッチテキストをつかわない",
-    "hide_followings_description": "フォローしている人を表示しない",
+    "hide_follows_description": "フォローしている人を表示しない",
     "hide_followers_description": "フォローしている人を表示しない",
     "nsfw_clickthrough": "NSFWなファイルをかくす",
     "panelRadius": "パネル",
diff --git a/src/i18n/ko.json b/src/i18n/ko.json
index 9f40be51..f9e4dfa3 100644
--- a/src/i18n/ko.json
+++ b/src/i18n/ko.json
@@ -156,7 +156,7 @@
     "notification_visibility_mentions": "멘션",
     "notification_visibility_repeats": "반복",
     "no_rich_text_description": "모든 게시물의 서식을 지우기",
-    "hide_followings_description": "내가 팔로우하는 사람을 표시하지 않음",
+    "hide_follows_description": "내가 팔로우하는 사람을 표시하지 않음",
     "hide_followers_description": "나를 따르는 사람을 보여주지 마라.",
     "nsfw_clickthrough": "NSFW 이미지 \"클릭해서 보이기\"를 활성화",
     "panelRadius": "패널",
diff --git a/src/i18n/ru.json b/src/i18n/ru.json
index bf1e319f..e86eaff9 100644
--- a/src/i18n/ru.json
+++ b/src/i18n/ru.json
@@ -127,7 +127,7 @@
     "notification_visibility_mentions": "Упоминания",
     "notification_visibility_repeats": "Повторы",
     "no_rich_text_description": "Убрать форматирование из всех постов",
-    "hide_followings_description": "Не показывать кого я читаю",
+    "hide_follows_description": "Не показывать кого я читаю",
     "hide_followers_description": "Не показывать кто читает меня",
     "nsfw_clickthrough": "Включить скрытие NSFW вложений",
     "panelRadius": "Панели",
diff --git a/src/services/api/api.service.js b/src/services/api/api.service.js
index 1d4790a0..d4d52ab1 100644
--- a/src/services/api/api.service.js
+++ b/src/services/api/api.service.js
@@ -130,7 +130,7 @@ const updateBanner = ({credentials, params}) => {
 // description
 const updateProfile = ({credentials, params}) => {
   // Always include these fields, because they might be empty or false
-  const fields = ['description', 'locked', 'no_rich_text', 'hide_followings', 'hide_followers']
+  const fields = ['description', 'locked', 'no_rich_text', 'hide_follows', 'hide_followers']
   let url = PROFILE_UPDATE_URL
 
   const form = new FormData()
diff --git a/src/services/entity_normalizer/entity_normalizer.service.js b/src/services/entity_normalizer/entity_normalizer.service.js
index af774675..bba6b363 100644
--- a/src/services/entity_normalizer/entity_normalizer.service.js
+++ b/src/services/entity_normalizer/entity_normalizer.service.js
@@ -100,7 +100,7 @@ export const parseUser = (data) => {
     output.rights = data.rights
     output.no_rich_text = data.no_rich_text
     output.default_scope = data.default_scope
-    output.hide_followings = data.hide_followings
+    output.hide_follows = data.hide_follows
     output.hide_followers = data.hide_followers
     output.background_image = data.background_image
     // on mastoapi this info is contained in a "relationship"
-- 
cgit v1.2.3-70-g09d2


From 648f635429da929e7090b103b9c8d354a1d3860a Mon Sep 17 00:00:00 2001
From: eugenijm <eugenijm@protonmail.com>
Date: Mon, 4 Feb 2019 17:03:35 +0300
Subject: Allow to configure visibility for admin and moderator badges

---
 src/components/user_card_content/user_card_content.js     | 15 +++++++++++++++
 src/components/user_card_content/user_card_content.vue    |  4 ++--
 src/components/user_settings/user_settings.js             |  7 ++++++-
 src/components/user_settings/user_settings.vue            |  5 +++++
 src/i18n/en.json                                          |  2 ++
 src/i18n/ru.json                                          |  2 ++
 src/services/api/api.service.js                           |  2 +-
 .../entity_normalizer/entity_normalizer.service.js        |  4 ++--
 8 files changed, 35 insertions(+), 6 deletions(-)

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

diff --git a/src/components/user_card_content/user_card_content.js b/src/components/user_card_content/user_card_content.js
index 6f6d04a7..427cb32d 100644
--- a/src/components/user_card_content/user_card_content.js
+++ b/src/components/user_card_content/user_card_content.js
@@ -79,6 +79,21 @@ export default {
       set (color) {
         this.$store.dispatch('setHighlight', { user: this.user.screen_name, color })
       }
+    },
+    visibleRole () {
+      const user = this.user
+
+      if (!(user.role === 'admin' || user.role === 'moderator')) {
+        return undefined
+      }
+
+      if (this.isOtherUser) {
+        return user.role
+      }
+
+      if (user.show_role) {
+        return user.role
+      }
     }
   },
   components: {
diff --git a/src/components/user_card_content/user_card_content.vue b/src/components/user_card_content/user_card_content.vue
index 3c0e160c..0b4d0d21 100644
--- a/src/components/user_card_content/user_card_content.vue
+++ b/src/components/user_card_content/user_card_content.vue
@@ -20,8 +20,7 @@
 
           <router-link class='user-screen-name' :to="userProfileLink(user)">
             <span class="handle">@{{user.screen_name}}
-              <span class="staff" v-if="user.is_admin">Admin</span>
-              <span class="staff" v-else-if="user.is_moderator">Moderator</span>
+              <span class="staff" v-if="!!visibleRole">{{visibleRole}}</span>
             </span><span v-if="user.locked"><i class="icon icon-lock"></i></span>
             <span v-if="!hideUserStatsLocal && !hideBio" class="dailyAvg">{{dailyAvg}} {{ $t('user_card.per_day') }}</span>
           </router-link>
@@ -254,6 +253,7 @@
     .staff {
       border: 1px solid $admin-border-color;
       color: $admin-color;
+      text-transform: capitalize;
       background-color: $admin-background-color;
       line-height: 12px;
       border-radius: 3px;
diff --git a/src/components/user_settings/user_settings.js b/src/components/user_settings/user_settings.js
index ef9398f6..4f991370 100644
--- a/src/components/user_settings/user_settings.js
+++ b/src/components/user_settings/user_settings.js
@@ -14,6 +14,8 @@ const UserSettings = {
       newDefaultScope: this.$store.state.users.currentUser.default_scope,
       hideFollows: this.$store.state.users.currentUser.hide_follows,
       hideFollowers: this.$store.state.users.currentUser.hide_followers,
+      showRole: this.$store.state.users.currentUser.show_role,
+      role: this.$store.state.users.currentUser.role,
       followList: null,
       followImportError: false,
       followsImported: false,
@@ -71,6 +73,8 @@ const UserSettings = {
       const no_rich_text = this.newNoRichText
       const hide_follows = this.hideFollows
       const hide_followers = this.hideFollowers
+      const show_role = this.showRole
+
       /* eslint-enable camelcase */
       this.$store.state.api.backendInteractor
         .updateProfile({
@@ -83,7 +87,8 @@ const UserSettings = {
             default_scope,
             no_rich_text,
             hide_follows,
-            hide_followers
+            hide_followers,
+            show_role
             /* eslint-enable camelcase */
           }}).then((user) => {
             if (!user.error) {
diff --git a/src/components/user_settings/user_settings.vue b/src/components/user_settings/user_settings.vue
index 19b7bdbd..ea5b3de5 100644
--- a/src/components/user_settings/user_settings.vue
+++ b/src/components/user_settings/user_settings.vue
@@ -37,6 +37,11 @@
               <input type="checkbox" v-model="hideFollowers" id="account-hide-followers">
               <label for="account-hide-followers">{{$t('settings.hide_followers_description')}}</label>
             </p>
+            <p>
+              <input type="checkbox" v-model="showRole" id="account-show-role">
+              <label for="account-show-role" v-if="role === 'admin'">{{$t('settings.show_admin_badge')}}</label>
+              <label for="account-show-role" v-if="role === 'moderator'">{{$t('settings.show_moderator_badge')}}</label>
+            </p>
             <button :disabled='newName && newName.length === 0' class="btn btn-default" @click="updateProfile">{{$t('general.submit')}}</button>
           </div>
           <div class="setting-item">
diff --git a/src/i18n/en.json b/src/i18n/en.json
index ac7cc2a7..30bbe214 100644
--- a/src/i18n/en.json
+++ b/src/i18n/en.json
@@ -166,6 +166,8 @@
     "no_rich_text_description": "Strip rich text formatting from all posts",
     "hide_follows_description": "Don't show who I'm following",
     "hide_followers_description": "Don't show who's following me",
+    "show_admin_badge": "Show Admin badge on my user card",
+    "show_moderator_badge": "Show Moderator badge on my user card",
     "nsfw_clickthrough": "Enable clickthrough NSFW attachment hiding",
     "panelRadius": "Panels",
     "pause_on_unfocused": "Pause streaming when tab is not focused",
diff --git a/src/i18n/ru.json b/src/i18n/ru.json
index e86eaff9..b5686a5c 100644
--- a/src/i18n/ru.json
+++ b/src/i18n/ru.json
@@ -129,6 +129,8 @@
     "no_rich_text_description": "Убрать форматирование из всех постов",
     "hide_follows_description": "Не показывать кого я читаю",
     "hide_followers_description": "Не показывать кто читает меня",
+    "show_admin_badge": "Показывать значок администратора на моей карточке пользователя",
+    "show_moderator_badge": "Показывать значок модератора на моей карточке пользователя",
     "nsfw_clickthrough": "Включить скрытие NSFW вложений",
     "panelRadius": "Панели",
     "pause_on_unfocused": "Приостановить загрузку когда вкладка не в фокусе",
diff --git a/src/services/api/api.service.js b/src/services/api/api.service.js
index d4d52ab1..f2365b7e 100644
--- a/src/services/api/api.service.js
+++ b/src/services/api/api.service.js
@@ -130,7 +130,7 @@ const updateBanner = ({credentials, params}) => {
 // description
 const updateProfile = ({credentials, params}) => {
   // Always include these fields, because they might be empty or false
-  const fields = ['description', 'locked', 'no_rich_text', 'hide_follows', 'hide_followers']
+  const fields = ['description', 'locked', 'no_rich_text', 'hide_follows', 'hide_followers', 'show_role']
   let url = PROFILE_UPDATE_URL
 
   const form = new FormData()
diff --git a/src/services/entity_normalizer/entity_normalizer.service.js b/src/services/entity_normalizer/entity_normalizer.service.js
index bbf20b64..828c48f9 100644
--- a/src/services/entity_normalizer/entity_normalizer.service.js
+++ b/src/services/entity_normalizer/entity_normalizer.service.js
@@ -90,8 +90,8 @@ export const parseUser = (data) => {
     output.statusnet_blocking = data.statusnet_blocking
 
     output.is_local = data.is_local
-    output.is_admin = data.is_admin
-    output.is_moderator = data.is_moderator
+    output.role = data.role
+    output.show_role = data.show_role
 
     output.follows_you = data.follows_you
 
-- 
cgit v1.2.3-70-g09d2


From 7743e3b277d6d4fb74696e5c76b061c1db594858 Mon Sep 17 00:00:00 2001
From: jo <jo@cutest.tech>
Date: Sat, 9 Feb 2019 20:42:51 +0000
Subject: Add quick css fix for user profile bg img preview

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

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

diff --git a/src/components/user_settings/user_settings.vue b/src/components/user_settings/user_settings.vue
index ea5b3de5..134f70ef 100644
--- a/src/components/user_settings/user_settings.vue
+++ b/src/components/user_settings/user_settings.vue
@@ -189,5 +189,9 @@
   .name-changer {
     width: 100%;
   }
+
+  .bg {
+    max-width: 100%;
+  }
 }
 </style>
-- 
cgit v1.2.3-70-g09d2

