diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js index fa86ee59937a46aa094b7e79495d02e065ca7cb1..789243cf6b4149195f5e20c024161bd523469ea7 100644 --- a/src/components/post_status_form/post_status_form.js +++ b/src/components/post_status_form/post_status_form.js @@ -150,6 +150,15 @@ const PostStatusForm = { scopeOptionsEnabled () { return this.$store.state.instance.scopeOptionsEnabled }, + alwaysShowSubject () { + if (typeof this.$store.state.config.alwaysShowSubjectInput !== 'undefined') { + return this.$store.state.config.alwaysShowSubjectInput + } else if (typeof this.$store.state.instance.alwaysShowSubjectInput !== 'undefined') { + return this.$store.state.instance.alwaysShowSubjectInput + } else { + return this.$store.state.instance.scopeOptionsEnabled + } + }, formattingOptionsEnabled () { return this.$store.state.instance.formattingOptionsEnabled } diff --git a/src/components/post_status_form/post_status_form.vue b/src/components/post_status_form/post_status_form.vue index 42e9c65c227bb81915e869052a05cc8a58935bd2..e4c46b9ac3fa5073fa5ccabfbeec8d1cff162980 100644 --- a/src/components/post_status_form/post_status_form.vue +++ b/src/components/post_status_form/post_status_form.vue @@ -11,7 +11,7 @@ </i18n> <p v-if="this.newStatus.visibility == 'direct'" class="visibility-notice">{{ $t('post_status.direct_warning') }}</p> <input - v-if="scopeOptionsEnabled" + v-if="newStatus.spoilerText || alwaysShowSubject" type="text" :placeholder="$t('post_status.content_warning')" v-model="newStatus.spoilerText" diff --git a/src/components/settings/settings.js b/src/components/settings/settings.js index 910eea63f535261c22c71e82a3e4c94eb07464b1..91a2014a5ed47c98bb6964b5921ad4a5edcb7174 100644 --- a/src/components/settings/settings.js +++ b/src/components/settings/settings.js @@ -38,6 +38,10 @@ const settings = { ? instance.subjectLineBehavior : user.subjectLineBehavior, subjectLineBehaviorDefault: instance.subjectLineBehavior, + alwaysShowSubjectInputLocal: typeof user.alwaysShowSubjectInput === 'undefined' + ? instance.alwaysShowSubjectInput + : user.alwaysShowSubjectInput, + alwaysShowSubjectInputDefault: instance.alwaysShowSubjectInput, scopeCopyLocal: user.scopeCopy, scopeCopyDefault: this.$t('settings.values.' + instance.scopeCopy), stopGifs: user.stopGifs, @@ -122,6 +126,9 @@ const settings = { scopeCopyLocal (value) { this.$store.dispatch('setOption', { name: 'scopeCopy', value }) }, + alwaysShowSubjectInputLocal (value) { + this.$store.dispatch('setOption', { name: 'alwaysShowSubjectInput', value }) + }, subjectLineBehaviorLocal (value) { this.$store.dispatch('setOption', { name: 'subjectLineBehavior', value }) }, diff --git a/src/components/settings/settings.vue b/src/components/settings/settings.vue index 4a236d238f3cb650e39a10a5b4633d111882e0f9..de506e4df126b403dee73e3a8f963ef37d5a9858 100644 --- a/src/components/settings/settings.vue +++ b/src/components/settings/settings.vue @@ -63,6 +63,12 @@ {{$t('settings.scope_copy')}} {{$t('settings.instance_default', { value: scopeCopyDefault })}} </label> </li> + <li> + <input type="checkbox" id="subjectHide" v-model="alwaysShowSubjectInputLocal"> + <label for="subjectHide"> + {{$t('settings.subject_input_always_show')}} {{$t('settings.instance_default', { value: alwaysShowSubjectInputDefault })}} + </label> + </li> <li> <div> {{$t('settings.subject_line_behavior')}} diff --git a/src/i18n/en.json b/src/i18n/en.json index 314fa083a078dfc56be129515657fc7f02ac7037..ae4f93d9abbe466485fc1a327598163548d82267 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -159,6 +159,7 @@ "set_new_profile_background": "Set new profile background", "set_new_profile_banner": "Set new profile banner", "settings": "Settings", + "subject_input_always_show": "Always show subject field", "subject_line_behavior": "Copy subject when replying", "subject_line_email": "Like email: \"re: subject\"", "subject_line_mastodon": "Like mastodon: copy as is", diff --git a/src/i18n/ru.json b/src/i18n/ru.json index 921bf67e69e7275e88deb61bb88aaace4b385e99..9c28ccf4fe86af9a1ea7897976c283fe00ac0ad5 100644 --- a/src/i18n/ru.json +++ b/src/i18n/ru.json @@ -133,6 +133,7 @@ "set_new_profile_background": "Загрузить новый фон профилÑ", "set_new_profile_banner": "Загрузить новый баннер профилÑ", "settings": "ÐаÑтройки", + "subject_input_always_show": "Ð’Ñегда показывать поле ввода темы", "stop_gifs": "Проигрывать GIF анимации только при наведении", "streaming": "Включить автоматичеÑкую загрузку новых Ñообщений при прокрутке вверх", "text": "ТекÑÑ‚", diff --git a/src/modules/config.js b/src/modules/config.js index 0d36e9bf97b634602ecf76c6f646aba413b6bd57..f23cacb776dd042489dea1f3d819e6dd55b76350 100644 --- a/src/modules/config.js +++ b/src/modules/config.js @@ -27,7 +27,8 @@ const defaultState = { highlight: {}, interfaceLanguage: browserLocale, scopeCopy: undefined, // instance default - subjectLineBehavior: undefined // instance default + subjectLineBehavior: undefined, // instance default + alwaysShowSubjectInput: undefined // instance default } const config = { diff --git a/src/modules/instance.js b/src/modules/instance.js index 9a39cccfb083c320c4458507b71e101c487226f2..641424b6f58477f8817f80482d09410f23f56913 100644 --- a/src/modules/instance.js +++ b/src/modules/instance.js @@ -17,6 +17,7 @@ const defaultState = { showInstanceSpecificPanel: false, scopeOptionsEnabled: true, formattingOptionsEnabled: false, + alwaysShowSubjectInput: true, collapseMessageWithSubject: false, hidePostStats: false, hideUserStats: false, diff --git a/static/config.json b/static/config.json index 67d84579f96f4108f7048bdb5f4e55fc4fdfe131..c49930efd3ec22e8c22cfe0b9a270fdecc014c76 100644 --- a/static/config.json +++ b/static/config.json @@ -13,6 +13,7 @@ "collapseMessageWithSubject": false, "scopeCopy": false, "subjectLineBehavior": "email", + "alwaysShowSubjectInput": true, "hidePostStats": false, "hideUserStats": false, "loginMethod": "password"