Add option for disabling counts (followers, statuses) in user profiles.

This commit is contained in:
scarlett 2018-09-04 00:32:25 +01:00
parent c348a3ec11
commit dcb7e1ecf4
7 changed files with 21 additions and 5 deletions

View file

@ -10,6 +10,7 @@ const settings = {
hideAttachmentsLocal: this.$store.state.config.hideAttachments,
hideAttachmentsInConvLocal: this.$store.state.config.hideAttachmentsInConv,
hideNsfwLocal: this.$store.state.config.hideNsfw,
hideUserStatsLocal: this.$store.state.config.hideUserStats,
notificationVisibilityLocal: this.$store.state.config.notificationVisibility,
replyVisibilityLocal: this.$store.state.config.replyVisibility,
loopVideoLocal: this.$store.state.config.loopVideo,
@ -47,6 +48,9 @@ const settings = {
hideAttachmentsInConvLocal (value) {
this.$store.dispatch('setOption', { name: 'hideAttachmentsInConv', value })
},
hideUserStatsLocal (value) {
this.$store.dispatch('setOption', { name: 'hideUserStats', value })
},
hideNsfwLocal (value) {
this.$store.dispatch('setOption', { name: 'hideNsfw', value })
},

View file

@ -122,6 +122,10 @@
<i class="icon-down-open"/>
</label>
</div>
<div>
<input type="checkbox" id="hideUserStats" v-model="hideUserStatsLocal">
<label for="hideUserStats">{{$t('settings.hide_user_stats')}}</label>
</div>
</div>
<div class="setting-item">
<p>{{$t('settings.filtering_explanation')}}</p>

View file

@ -3,6 +3,11 @@ import { hex2rgb } from '../../services/color_convert/color_convert.js'
export default {
props: [ 'user', 'switcher', 'selected', 'hideBio' ],
data () {
return {
hideUserStatsLocal: this.$store.state.config.hideUserStats
}
},
computed: {
headingStyle () {
const color = this.$store.state.config.colors.bg

View file

@ -17,7 +17,7 @@
<div :title="user.name" class='user-name' v-else>{{user.name}}</div>
<router-link class='user-screen-name':to="{ name: 'user-profile', params: { id: user.id } }">
<span>@{{user.screen_name}}</span><span v-if="user.locked"><i class="icon icon-lock"></i></span>
<span class="dailyAvg">{{dailyAvg}} {{ $t('user_card.per_day') }}</span>
<span v-if="!hideUserStatsLocal" class="dailyAvg">{{dailyAvg}} {{ $t('user_card.per_day') }}</span>
</router-link>
</div>
</div>
@ -90,19 +90,19 @@
</div>
</div>
</div>
<div class="panel-body profile-panel-body">
<div v-if="!hideUserStatsLocal || switcher" class="panel-body profile-panel-body">
<div class="user-counts" :class="{clickable: switcher}">
<div class="user-count" v-on:click.prevent="setProfileView('statuses')" :class="{selected: selected === 'statuses'}">
<h5>{{ $t('user_card.statuses') }}</h5>
<span>{{user.statuses_count}} <br></span>
<span v-if="!hideUserStatsLocal">{{user.statuses_count}} <br></span>
</div>
<div class="user-count" v-on:click.prevent="setProfileView('friends')" :class="{selected: selected === 'friends'}">
<h5>{{ $t('user_card.followees') }}</h5>
<span>{{user.friends_count}}</span>
<span v-if="!hideUserStatsLocal">{{user.friends_count}}</span>
</div>
<div class="user-count" v-on:click.prevent="setProfileView('followers')" :class="{selected: selected === 'followers'}">
<h5>{{ $t('user_card.followers') }}</h5>
<span>{{user.followers_count}}</span>
<span v-if="!hideUserStatsLocal">{{user.followers_count}}</span>
</div>
</div>
<p v-if="!hideBio && user.description_html" class="profile-bio" v-html="user.description_html"></p>

View file

@ -328,6 +328,7 @@ const en = {
loop_video_silent_only: 'Loop only videos without sound (i.e. Mastodon\'s "gifs")',
reply_link_preview: 'Enable reply-link preview on mouse hover',
replies_in_timeline: 'Replies in timeline',
hide_user_stats: 'Hide user statistics (e.g. status and follower counts)',
reply_visibility_all: 'Show all replies',
reply_visibility_following: 'Only show replies directed at me or users I\'m following',
reply_visibility_self: 'Only show replies directed at me',

View file

@ -48,6 +48,7 @@ const persistedStateOptions = {
'config.collapseMessageWithSubject',
'config.hideAttachments',
'config.hideAttachmentsInConv',
'config.hideUserStats',
'config.hideNsfw',
'config.replyVisibility',
'config.notificationVisibility',

View file

@ -9,6 +9,7 @@ const defaultState = {
collapseMessageWithSubject: false,
hideAttachments: false,
hideAttachmentsInConv: false,
hideUserStats: false,
hideNsfw: true,
loopVideo: true,
loopVideoSilentOnly: true,