diff --git a/src/components/favorite_button/favorite_button.js b/src/components/favorite_button/favorite_button.js index 1266be90..a2b4cb65 100644 --- a/src/components/favorite_button/favorite_button.js +++ b/src/components/favorite_button/favorite_button.js @@ -2,6 +2,9 @@ const FavoriteButton = { props: ['status', 'loggedIn'], data () { return { + hidePostStatsLocal: typeof this.$store.state.config.hidePostStats === 'undefined' + ? this.$store.state.instance.hidePostStats + : this.$store.state.config.hidePostStats, animated: false } }, diff --git a/src/components/favorite_button/favorite_button.vue b/src/components/favorite_button/favorite_button.vue index 1e1a6970..71cb875e 100644 --- a/src/components/favorite_button/favorite_button.vue +++ b/src/components/favorite_button/favorite_button.vue @@ -1,11 +1,11 @@ diff --git a/src/components/retweet_button/retweet_button.js b/src/components/retweet_button/retweet_button.js index cafa9cbc..eb4e4b41 100644 --- a/src/components/retweet_button/retweet_button.js +++ b/src/components/retweet_button/retweet_button.js @@ -2,6 +2,9 @@ const RetweetButton = { props: ['status', 'loggedIn', 'visibility'], data () { return { + hidePostStatsLocal: typeof this.$store.state.config.hidePostStats === 'undefined' + ? this.$store.state.instance.hidePostStats + : this.$store.state.config.hidePostStats, animated: false } }, diff --git a/src/components/retweet_button/retweet_button.vue b/src/components/retweet_button/retweet_button.vue index ee5722bd..5b1e64b8 100644 --- a/src/components/retweet_button/retweet_button.vue +++ b/src/components/retweet_button/retweet_button.vue @@ -2,7 +2,7 @@
diff --git a/src/components/settings/settings.js b/src/components/settings/settings.js index a24bc265..67110841 100644 --- a/src/components/settings/settings.js +++ b/src/components/settings/settings.js @@ -13,6 +13,14 @@ const settings = { hideAttachmentsLocal: user.hideAttachments, hideAttachmentsInConvLocal: user.hideAttachmentsInConv, hideNsfwLocal: user.hideNsfw, + hidePostStatsLocal: typeof user.hidePostStats === 'undefined' + ? instance.hidePostStats + : user.hidePostStats, + hidePostStatsDefault: this.$t('settings.values.' + instance.hidePostStats), + hideUserStatsLocal: typeof user.hideUserStats === 'undefined' + ? instance.hideUserStats + : user.hideUserStats, + hideUserStatsDefault: this.$t('settings.values.' + instance.hideUserStats), notificationVisibilityLocal: user.notificationVisibility, replyVisibilityLocal: user.replyVisibility, loopVideoLocal: user.loopVideo, @@ -56,6 +64,12 @@ const settings = { hideAttachmentsInConvLocal (value) { this.$store.dispatch('setOption', { name: 'hideAttachmentsInConv', value }) }, + hidePostStatsLocal (value) { + this.$store.dispatch('setOption', { name: 'hidePostStats', value }) + }, + hideUserStatsLocal (value) { + this.$store.dispatch('setOption', { name: 'hideUserStats', value }) + }, hideNsfwLocal (value) { this.$store.dispatch('setOption', { name: 'hideNsfw', value }) }, diff --git a/src/components/settings/settings.vue b/src/components/settings/settings.vue index 42c660a3..652bdcc1 100644 --- a/src/components/settings/settings.vue +++ b/src/components/settings/settings.vue @@ -138,6 +138,18 @@
+
+ + +
+
+ + +

{{$t('settings.filtering_explanation')}}

diff --git a/src/components/user_card_content/user_card_content.js b/src/components/user_card_content/user_card_content.js index 76a5577e..b5dd9b91 100644 --- a/src/components/user_card_content/user_card_content.js +++ b/src/components/user_card_content/user_card_content.js @@ -3,6 +3,13 @@ import { hex2rgb } from '../../services/color_convert/color_convert.js' export default { props: [ 'user', 'switcher', 'selected', 'hideBio' ], + data () { + return { + hideUserStatsLocal: typeof this.$store.state.config.hideUserStats === 'undefined' + ? this.$store.state.instance.hideUserStats + : this.$store.state.config.hideUserStats + } + }, computed: { headingStyle () { const color = this.$store.state.config.colors.bg diff --git a/src/components/user_card_content/user_card_content.vue b/src/components/user_card_content/user_card_content.vue index 59358040..84669d7f 100644 --- a/src/components/user_card_content/user_card_content.vue +++ b/src/components/user_card_content/user_card_content.vue @@ -17,7 +17,7 @@
{{user.name}}
@{{user.screen_name}} - {{dailyAvg}} {{ $t('user_card.per_day') }} + {{dailyAvg}} {{ $t('user_card.per_day') }}
@@ -91,18 +91,18 @@
-
+
{{ $t('user_card.statuses') }}
- {{user.statuses_count}}
+ {{user.statuses_count}}
{{ $t('user_card.followees') }}
- {{user.friends_count}} + {{user.friends_count}}
{{ $t('user_card.followers') }}
- {{user.followers_count}} + {{user.followers_count}}

diff --git a/src/i18n/en.json b/src/i18n/en.json index b3cb6598..8963e479 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -111,6 +111,8 @@ "general": "General", "hide_attachments_in_convo": "Hide attachments in conversations", "hide_attachments_in_tl": "Hide attachments in timeline", + "hide_post_stats": "Hide post statistics (e.g. the number of favorites)", + "hide_user_stats": "Hide user statistics (e.g. the number of followers)", "import_followers_from_a_csv_file": "Import follows from a csv file", "import_theme": "Load preset", "inputRadius": "Input fields", diff --git a/src/main.js b/src/main.js index 367db881..1b1780df 100644 --- a/src/main.js +++ b/src/main.js @@ -100,6 +100,8 @@ window.fetch('/api/statusnet/config.json') var theme = (config.theme) var background = (config.background) + var hidePostStats = (config.hidePostStats) + var hideUserStats = (config.hideUserStats) var logo = (config.logo) var logoMask = (typeof config.logoMask === 'undefined' ? true : config.logoMask) var logoMargin = (typeof config.logoMargin === 'undefined' ? 0 : config.logoMargin) @@ -113,6 +115,8 @@ window.fetch('/api/statusnet/config.json') store.dispatch('setInstanceOption', { name: 'theme', value: theme }) store.dispatch('setInstanceOption', { name: 'background', value: background }) + store.dispatch('setInstanceOption', { name: 'hidePostStats', value: hidePostStats }) + store.dispatch('setInstanceOption', { name: 'hideUserStats', value: hideUserStats }) store.dispatch('setInstanceOption', { name: 'logo', value: logo }) store.dispatch('setInstanceOption', { name: 'logoMask', value: logoMask }) store.dispatch('setInstanceOption', { name: 'logoMargin', value: logoMargin }) diff --git a/src/modules/instance.js b/src/modules/instance.js index cb724821..d61ca842 100644 --- a/src/modules/instance.js +++ b/src/modules/instance.js @@ -18,6 +18,8 @@ const defaultState = { scopeOptionsEnabled: true, formattingOptionsEnabled: false, collapseMessageWithSubject: false, + hidePostStats: false, + hideUserStats: false, disableChat: false, // Nasty stuff diff --git a/static/config.json b/static/config.json index 144fe951..a6eace0f 100644 --- a/static/config.json +++ b/static/config.json @@ -10,5 +10,7 @@ "showInstanceSpecificPanel": false, "scopeOptionsEnabled": false, "formattingOptionsEnabled": false, - "collapseMessageWithSubject": false + "collapseMessageWithSubject": false, + "hidePostStats": false, + "hideUserStats": false }