diff options
| -rw-r--r-- | src/components/favorite_button/favorite_button.js | 3 | ||||
| -rw-r--r-- | src/components/favorite_button/favorite_button.vue | 4 | ||||
| -rw-r--r-- | src/components/retweet_button/retweet_button.js | 3 | ||||
| -rw-r--r-- | src/components/retweet_button/retweet_button.vue | 4 | ||||
| -rw-r--r-- | src/components/settings/settings.js | 14 | ||||
| -rw-r--r-- | src/components/settings/settings.vue | 12 | ||||
| -rw-r--r-- | src/components/user_card_content/user_card_content.js | 7 | ||||
| -rw-r--r-- | src/components/user_card_content/user_card_content.vue | 10 | ||||
| -rw-r--r-- | src/i18n/en.json | 2 | ||||
| -rw-r--r-- | src/i18n/nb.json | 98 | ||||
| -rw-r--r-- | src/main.js | 4 | ||||
| -rw-r--r-- | src/modules/instance.js | 2 | ||||
| -rw-r--r-- | static/config.json | 4 |
13 files changed, 148 insertions, 19 deletions
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 @@ <template> <div v-if="loggedIn"> <i :class='classes' class='favorite-button fav-active' @click.prevent='favorite()'/> - <span v-if='status.fave_num > 0'>{{status.fave_num}}</span> + <span v-if='!hidePostStatsLocal && status.fave_num > 0'>{{status.fave_num}}</span> </div> <div v-else> <i :class='classes' class='favorite-button'/> - <span v-if='status.fave_num > 0'>{{status.fave_num}}</span> + <span v-if='!hidePostStatsLocal && status.fave_num > 0'>{{status.fave_num}}</span> </div> </template> 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 @@ <div v-if="loggedIn"> <template v-if="visibility !== 'private' && visibility !== 'direct'"> <i :class='classes' class='icon-retweet rt-active' v-on:click.prevent='retweet()'></i> - <span v-if='status.repeat_num > 0'>{{status.repeat_num}}</span> + <span v-if='!hidePostStatsLocal && status.repeat_num > 0'>{{status.repeat_num}}</span> </template> <template v-else> <i :class='classes' class='icon-lock' :title="$t('timeline.no_retweet_hint')"></i> @@ -10,7 +10,7 @@ </div> <div v-else-if="!loggedIn"> <i :class='classes' class='icon-retweet'></i> - <span v-if='status.repeat_num > 0'>{{status.repeat_num}}</span> + <span v-if='!hidePostStatsLocal && status.repeat_num > 0'>{{status.repeat_num}}</span> </div> </template> 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 @@ <i class="icon-down-open"/> </label> </div> + <div> + <input type="checkbox" id="hidePostStats" v-model="hidePostStatsLocal"> + <label for="hidePostStats"> + {{$t('settings.hide_post_stats')}} {{$t('settings.instance_default', { value: hidePostStatsDefault })}} + </label> + </div> + <div> + <input type="checkbox" id="hideUserStats" v-model="hideUserStatsLocal"> + <label for="hideUserStats"> + {{$t('settings.hide_user_stats')}} {{$t('settings.instance_default', { value: hideUserStatsDefault })}} + </label> + </div> </div> <div class="setting-item"> <p>{{$t('settings.filtering_explanation')}}</p> 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 @@ <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> @@ -91,18 +91,18 @@ </div> </div> <div class="panel-body profile-panel-body"> - <div class="user-counts" :class="{clickable: switcher}"> + <div v-if="!hideUserStatsLocal || switcher" 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> 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/i18n/nb.json b/src/i18n/nb.json index a95879b7..0f4dca58 100644 --- a/src/i18n/nb.json +++ b/src/i18n/nb.json @@ -1,6 +1,15 @@ { "chat": { - "title": "Chat" + "title": "Nettprat" + }, + "features_panel": { + "chat": "Nettprat", + "gopher": "Gopher", + "media_proxy": "Media proxy", + "scope_options": "Velg mottakere", + "text_limit": "Tekst-grense", + "title": "Egenskaper", + "who_to_follow": "Hvem å følge" }, "finder": { "error_fetching_user": "Feil ved henting av bruker", @@ -8,7 +17,7 @@ }, "general": { "apply": "Bruk", - "submit": "Legg ut" + "submit": "Send" }, "login": { "login": "Logg inn", @@ -19,29 +28,47 @@ "username": "Brukernavn" }, "nav": { - "chat": "Lokal Chat", + "chat": "Lokal nettprat", + "friend_requests": "Følgeforespørsler", "mentions": "Nevnt", "public_tl": "Offentlig Tidslinje", "timeline": "Tidslinje", "twkn": "Det hele kjente nettverket" }, "notifications": { + "broken_favorite": "Ukjent status, leter etter den...", "favorited_you": "likte din status", "followed_you": "fulgte deg", + "load_older": "Last eldre varsler", "notifications": "Varslinger", "read": "Les!", "repeated_you": "Gjentok din status" }, "post_status": { + "account_not_locked_warning": "Kontoen din er ikke {0}. Hvem som helst kan følge deg for å se dine statuser til følgere", + "account_not_locked_warning_link": "låst", + "attachments_sensitive": "Merk vedlegg som sensitive", + "content_type": { + "plain_text": "Klar tekst" + }, + "content_warning": "Tema (valgfritt)", "default": "Landet akkurat i L.A.", - "posting": "Publiserer" + "direct_warning": "Denne statusen vil kun bli sett av nevnte brukere", + "posting": "Publiserer", + "scope": { + "direct": "Direkte, publiser bare til nevnte brukere", + "private": "Bare følgere, publiser bare til brukere som følger deg", + "public": "Offentlig, publiser til offentlige tidslinjer", + "unlisted": "Uoppført, ikke publiser til offentlige tidslinjer" + } }, "registration": { "bio": "Biografi", "email": "Epost-adresse", "fullname": "Visningsnavn", "password_confirm": "Bekreft passord", - "registration": "Registrering" + "registration": "Registrering", + "token": "Invitasjons-bevis" }, "settings": { "attachmentRadius": "Vedlegg", @@ -57,27 +84,69 @@ "cGreen": "Grønn (Gjenta)", "cOrange": "Oransje (Lik)", "cRed": "Rød (Avbryt)", + "change_password": "Endre passord", + "change_password_error": "Feil ved endring av passord", + "changed_password": "Passord endret", + "collapse_subject": "Sammenfold statuser med tema", + "confirm_new_password": "Bekreft nytt passord", "current_avatar": "Ditt nåværende profilbilde", + "current_password": "Nåværende passord", "current_profile_banner": "Din nåværende profil-banner", + "data_import_export_tab": "Data import / eksport", + "default_vis": "Standard visnings-omfang", + "delete_account": "Slett konto", + "delete_account_description": "Slett din konto og alle dine statuser", + "delete_account_error": "Det oppsto et problem ved sletting av kontoen din, hvis dette problemet forblir kontakt din administrator", + "delete_account_instructions": "Skriv inn ditt passord i feltet nedenfor for å bekrefte sletting av konto", + "export_theme": "Lagre tema", "filtering": "Filtrering", "filtering_explanation": "Alle statuser som inneholder disse ordene vil bli dempet, en kombinasjon av tegn per linje", + "follow_export": "Eksporter følginger", + "follow_export_button": "Eksporter følgingene dine til en .csv fil", + "follow_export_processing": "Jobber, du vil snart bli spurt om å laste ned filen din.", "follow_import": "Importer følginger", "follow_import_error": "Feil ved importering av følginger.", - "follows_imported": "Følginger imported! Det vil ta litt tid å behandle de.", - "foreground": "Framgrunn", + "follows_imported": "Følginger importert! Behandling vil ta litt tid.", + "foreground": "Forgrunn", + "general": "Generell", "hide_attachments_in_convo": "Gjem vedlegg i samtaler", "hide_attachments_in_tl": "Gjem vedlegg på tidslinje", "import_followers_from_a_csv_file": "Importer følginger fra en csv fil", + "import_theme": "Last tema", + "inputRadius": "Input felt", + "instance_default": "(standard: {value})", + "interfaceLanguage": "Grensesnitt-språk", + "invalid_theme_imported": "Den valgte filen er ikke ett støttet Pleroma-tema, ingen endringer til ditt tema ble gjort", + "limited_availability": "Ikke tilgjengelig i din nettleser", "links": "Linker", + "lock_account_description": "Begrens din konto til bare godkjente følgere", + "loop_video": "Gjenta videoer", + "loop_video_silent_only": "Gjenta bare videoer uten lyd, (for eksempel Mastodon sine \"gifs\")", "name": "Navn", "name_bio": "Navn & Biografi", + "new_password": "Nytt passord", + "notification_visibility": "Typer varsler som skal vises", + "notification_visibility_follows": "Følginger", + "notification_visibility_likes": "Likes", + "notification_visibility_mentions": "Nevnt", + "notification_visibility_repeats": "Gjentakelser", + "no_rich_text_description": "Fjern all formatering fra statuser", "nsfw_clickthrough": "Krev trykk for å vise statuser som kan være upassende", "panelRadius": "Panel", - "presets": "Forhåndsdefinerte fargekoder", + "pause_on_unfocused": "Stopp henting av poster når vinduet ikke er i fokus", + "presets": "Forhåndsdefinerte tema", "profile_background": "Profil-bakgrunn", "profile_banner": "Profil-banner", + "profile_tab": "Profil", "radii_help": "Bestem hvor runde hjørnene i brukergrensesnittet skal være (i piksler)", + "replies_in_timeline": "Svar på tidslinje", "reply_link_preview": "Vis en forhåndsvisning når du holder musen over svar til en status", + "reply_visibility_all": "Vis alle svar", + "reply_visibility_following": "Vis bare svar som er til meg eller folk jeg følger", + "reply_visibility_self": "Vis bare svar som er til meg", + "saving_err": "Feil ved lagring av innstillinger", + "saving_ok": "Innstillinger lagret", + "security_tab": "Sikkerhet", "set_new_avatar": "Rediger profilbilde", "set_new_profile_background": "Rediger profil-bakgrunn", "set_new_profile_banner": "Sett ny profil-banner", @@ -88,20 +157,27 @@ "theme": "Tema", "theme_help": "Bruk heksadesimale fargekoder (#rrggbb) til å endre farge-temaet ditt.", "tooltipRadius": "Verktøytips/advarsler", - "user_settings": "Brukerinstillinger" + "user_settings": "Brukerinstillinger", + "values": { + "false": "nei", + "true": "ja" + } }, "timeline": { "collapse": "Sammenfold", "conversation": "Samtale", "error_fetching": "Feil ved henting av oppdateringer", "load_older": "Last eldre statuser", + "no_retweet_hint": "Status er markert som bare til følgere eller direkte og kan ikke gjentas", "repeated": "gjentok", "show_new": "Vis nye", "up_to_date": "Oppdatert" }, "user_card": { + "approve": "Godkjenn", "block": "Blokker", "blocked": "Blokkert!", + "deny": "Avslå", "follow": "Følg", "followees": "Følger", "followers": "Følgere", @@ -115,5 +191,9 @@ }, "user_profile": { "timeline_title": "Bruker-tidslinje" + }, + "who_to_follow": { + "more": "Mer", + "who_to_follow": "Hvem å følge" } } 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 } |
