From 3f23aecd10e570f78b4142687a9a3fa349c13018 Mon Sep 17 00:00:00 2001 From: Shpuld Shpuldson Date: Tue, 23 Feb 2021 10:00:23 +0200 Subject: [PATCH 01/13] add sensitive by default option --- src/components/post_status_form/post_status_form.js | 4 ++-- src/components/settings_modal/tabs/general_tab.vue | 7 ++++++- src/i18n/en.json | 1 + src/modules/config.js | 3 ++- src/modules/instance.js | 1 + 5 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js index 4148381c83..e540654be3 100644 --- a/src/components/post_status_form/post_status_form.js +++ b/src/components/post_status_form/post_status_form.js @@ -115,7 +115,7 @@ const PostStatusForm = { ? this.copyMessageScope : this.$store.state.users.currentUser.default_scope - const { postContentType: contentType } = this.$store.getters.mergedConfig + const { postContentType: contentType, sensitiveByDefault } = this.$store.getters.mergedConfig return { dropFiles: [], @@ -126,7 +126,7 @@ const PostStatusForm = { newStatus: { spoilerText: this.subject || '', status: statusText, - nsfw: false, + nsfw: !!sensitiveByDefault, files: [], poll: {}, mediaDescriptions: {}, diff --git a/src/components/settings_modal/tabs/general_tab.vue b/src/components/settings_modal/tabs/general_tab.vue index f93f4ea05f..9228c78e25 100644 --- a/src/components/settings_modal/tabs/general_tab.vue +++ b/src/components/settings_modal/tabs/general_tab.vue @@ -144,7 +144,12 @@
  • - {{ $t('settings.minimal_scopes_mode') }} {{ minimalScopesModeDefaultValue }} + {{ $t('settings.minimal_scopes_mode') }} + +
  • +
  • + + {{ $t('settings.sensitive_by_default') }}
  • diff --git a/src/i18n/en.json b/src/i18n/en.json index 0e069785d6..e6acda9c6c 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -429,6 +429,7 @@ "subject_line_mastodon": "Like mastodon: copy as is", "subject_line_noop": "Do not copy", "post_status_content_type": "Post status content type", + "sensitive_by_default": "Mark posts as sensitive by default", "stop_gifs": "Play-on-hover GIFs", "streaming": "Enable automatic streaming of new posts when scrolled to the top", "user_mutes": "Users", diff --git a/src/modules/config.js b/src/modules/config.js index f992519e3a..b08903d18e 100644 --- a/src/modules/config.js +++ b/src/modules/config.js @@ -67,7 +67,8 @@ export const defaultState = { greentext: undefined, // instance default hidePostStats: undefined, // instance default hideUserStats: undefined, // instance default - virtualScrolling: undefined // instance default + virtualScrolling: undefined, // instance default + sensitiveByDefault: undefined } // caching the instance default properties diff --git a/src/modules/instance.js b/src/modules/instance.js index 411b1caa87..96de73ca15 100644 --- a/src/modules/instance.js +++ b/src/modules/instance.js @@ -43,6 +43,7 @@ const defaultState = { subjectLineBehavior: 'email', theme: 'pleroma-dark', virtualScrolling: true, + sensitiveByDefault: false, // Nasty stuff customEmoji: [], From 29dae3c12e9533f9d9b8ce058686f9a6a47719ad Mon Sep 17 00:00:00 2001 From: Shpuld Shpuldson Date: Tue, 23 Feb 2021 10:03:29 +0200 Subject: [PATCH 02/13] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1fbb357557..0abc39292b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Added - Added reason field for registration when approval is required +- Added option to mark posts as sensitive by default ## [2.2.3] - 2021-01-18 ### Added From ecb211606cddeeec809c8a6bc39f9c96a0af95f5 Mon Sep 17 00:00:00 2001 From: Shpuld Shpuldson Date: Tue, 23 Feb 2021 10:06:45 +0200 Subject: [PATCH 03/13] change config comment to be consistent --- src/modules/config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/config.js b/src/modules/config.js index b08903d18e..eca58c12c3 100644 --- a/src/modules/config.js +++ b/src/modules/config.js @@ -68,7 +68,7 @@ export const defaultState = { hidePostStats: undefined, // instance default hideUserStats: undefined, // instance default virtualScrolling: undefined, // instance default - sensitiveByDefault: undefined + sensitiveByDefault: undefined // instance default } // caching the instance default properties From 59aaade7fc796ce43f5fd035fa5f1375d5e3dc75 Mon Sep 17 00:00:00 2001 From: Shpuld Shpuldson Date: Thu, 25 Feb 2021 14:32:21 +0200 Subject: [PATCH 04/13] fix vue warnings --- src/components/emoji_input/emoji_input.vue | 2 +- src/components/mfa_form/recovery_form.vue | 4 ++-- src/components/mfa_form/totp_form.vue | 4 ++-- src/components/popover/popover.vue | 2 +- .../scope_selector/scope_selector.vue | 8 ++++---- src/components/search/search.vue | 2 +- src/components/search_bar/search_bar.vue | 6 +++--- .../helpers/boolean_setting.vue | 12 +++++------ .../helpers/modified_indicator.vue | 20 +++++++++---------- .../settings_modal/tabs/filtering_tab.vue | 2 +- 10 files changed, 31 insertions(+), 31 deletions(-) diff --git a/src/components/emoji_input/emoji_input.vue b/src/components/emoji_input/emoji_input.vue index 1d6c760ef0..ad62484d6e 100644 --- a/src/components/emoji_input/emoji_input.vue +++ b/src/components/emoji_input/emoji_input.vue @@ -9,8 +9,8 @@ diff --git a/src/components/mfa_form/recovery_form.vue b/src/components/mfa_form/recovery_form.vue index 8457ec5d86..7c59422837 100644 --- a/src/components/mfa_form/recovery_form.vue +++ b/src/components/mfa_form/recovery_form.vue @@ -25,16 +25,16 @@

    diff --git a/src/components/mfa_form/totp_form.vue b/src/components/mfa_form/totp_form.vue index 5d80e1852e..4ee1399245 100644 --- a/src/components/mfa_form/totp_form.vue +++ b/src/components/mfa_form/totp_form.vue @@ -27,16 +27,16 @@

    diff --git a/src/components/popover/popover.vue b/src/components/popover/popover.vue index 876dd61d67..bacbc5904d 100644 --- a/src/components/popover/popover.vue +++ b/src/components/popover/popover.vue @@ -6,8 +6,8 @@ diff --git a/src/components/scope_selector/scope_selector.vue b/src/components/scope_selector/scope_selector.vue index 60e8c3baea..a01242fc1c 100644 --- a/src/components/scope_selector/scope_selector.vue +++ b/src/components/scope_selector/scope_selector.vue @@ -8,8 +8,8 @@ class="button-unstyled scope" :class="css.direct" :title="$t('post_status.scope.direct')" - @click="changeVis('direct')" type="button" + @click="changeVis('direct')" > diff --git a/src/components/search_bar/search_bar.vue b/src/components/search_bar/search_bar.vue index a7432dcba8..222f57ba33 100644 --- a/src/components/search_bar/search_bar.vue +++ b/src/components/search_bar/search_bar.vue @@ -7,8 +7,8 @@ v-if="hidden" class="button-unstyled nav-icon" :title="$t('nav.search')" - @click.prevent.stop="toggleHidden" type="button" + @click.prevent.stop="toggleHidden" >