settings for confirmations
This commit is contained in:
parent
71d1baffcc
commit
2441e6508d
3 changed files with 113 additions and 8 deletions
|
|
@ -5,9 +5,12 @@ import IntegerSetting from '../helpers/integer_setting.vue'
|
|||
import FloatSetting from '../helpers/float_setting.vue'
|
||||
import UnitSetting from '../helpers/unit_setting.vue'
|
||||
import InterfaceLanguageSwitcher from 'src/components/interface_language_switcher/interface_language_switcher.vue'
|
||||
import Select from 'src/components/select/select.vue'
|
||||
|
||||
import SharedComputedObject from '../helpers/shared_computed_object.js'
|
||||
import ProfileSettingIndicator from '../helpers/profile_setting_indicator.vue'
|
||||
|
||||
import { mapState } from 'vuex'
|
||||
import { clearCache, cacheKey, emojiCacheKey } from 'src/services/sw/sw.js'
|
||||
import { library } from '@fortawesome/fontawesome-svg-core'
|
||||
import {
|
||||
|
|
@ -56,6 +59,11 @@ const GeneralTab = {
|
|||
value: mode,
|
||||
label: this.$t(`settings.unsaved_post_action_${mode}`)
|
||||
})),
|
||||
muteBlockLv1Options: ['ask', 'forever', 'temporarily'].map(mode => ({
|
||||
key: mode,
|
||||
value: mode,
|
||||
label: this.$t(`user_card.mute_block_${mode}`)
|
||||
})),
|
||||
loopSilentAvailable:
|
||||
// Firefox
|
||||
Object.getOwnPropertyDescriptor(HTMLVideoElement.prototype, 'mozHasAudio') ||
|
||||
|
|
@ -73,12 +81,47 @@ const GeneralTab = {
|
|||
UnitSetting,
|
||||
InterfaceLanguageSwitcher,
|
||||
ScopeSelector,
|
||||
ProfileSettingIndicator
|
||||
ProfileSettingIndicator,
|
||||
Select
|
||||
},
|
||||
computed: {
|
||||
postFormats () {
|
||||
return this.$store.state.instance.postFormats || []
|
||||
},
|
||||
onMuteDefaultActionLv1: {
|
||||
get () {
|
||||
const value = this.$store.state.config.onMuteDefaultAction
|
||||
if (value === 'ask' || value === 'forever') {
|
||||
return value
|
||||
} else {
|
||||
return 'temporarily'
|
||||
}
|
||||
},
|
||||
set (value) {
|
||||
let realValue = value
|
||||
if (value !== 'ask' && value !== 'forever') {
|
||||
realValue = '14d'
|
||||
}
|
||||
this.$store.dispatch('setOption', { name: 'onMuteDefaultAction', value: realValue })
|
||||
}
|
||||
},
|
||||
onBlockDefaultActionLv1: {
|
||||
get () {
|
||||
const value = this.$store.state.config.onBlockDefaultAction
|
||||
if (value === 'ask' || value === 'forever') {
|
||||
return value
|
||||
} else {
|
||||
return 'temporarily'
|
||||
}
|
||||
},
|
||||
set (value) {
|
||||
let realValue = value
|
||||
if (value !== 'ask' && value !== 'forever') {
|
||||
realValue = '14d'
|
||||
}
|
||||
this.$store.dispatch('setOption', { name: 'onBlockDefaultAction', value: realValue })
|
||||
}
|
||||
},
|
||||
postContentOptions () {
|
||||
return this.postFormats.map(format => ({
|
||||
key: format,
|
||||
|
|
@ -94,7 +137,10 @@ const GeneralTab = {
|
|||
},
|
||||
instanceShoutboxPresent () { return this.$store.state.instance.shoutAvailable },
|
||||
instanceSpecificPanelPresent () { return this.$store.state.instance.showInstanceSpecificPanel },
|
||||
...SharedComputedObject()
|
||||
...SharedComputedObject(),
|
||||
...mapState({
|
||||
blockExpirationSupported: state => state.instance.blockExpiration
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
changeDefaultScope (value) {
|
||||
|
|
|
|||
|
|
@ -69,6 +69,66 @@
|
|||
{{ $t('settings.user_popover_avatar_overlay') }}
|
||||
</BooleanSetting>
|
||||
</li>
|
||||
<li>
|
||||
{{ $t('user_card.default_mute_expiration') }}
|
||||
<Select
|
||||
id="onMuteDefaultActionLv1"
|
||||
v-model="onMuteDefaultActionLv1"
|
||||
>
|
||||
<option
|
||||
v-for="option in muteBlockLv1Options"
|
||||
:key="option.key"
|
||||
:value="option.value"
|
||||
>
|
||||
{{ option.label }}
|
||||
</option>
|
||||
</Select>
|
||||
<ul
|
||||
class="setting-list suboptions"
|
||||
v-if="onMuteDefaultActionLv1 === 'temporarily'"
|
||||
>
|
||||
<li>
|
||||
<UnitSetting
|
||||
path="onMuteDefaultAction"
|
||||
unit-set="time"
|
||||
:units="['s', 'm', 'h', 'd']"
|
||||
:min="0"
|
||||
>
|
||||
{{ $t('user_card.default_expiration_time') }}
|
||||
</UnitSetting>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li v-if="blockExpirationSupported">
|
||||
{{ $t('user_card.default_block_expiration') }}
|
||||
<Select
|
||||
id="onBlockDefaultActionLv1"
|
||||
v-model="onBlockDefaultActionLv1"
|
||||
>
|
||||
<option
|
||||
v-for="option in muteBlockLv1Options"
|
||||
:key="option.key"
|
||||
:value="option.value"
|
||||
>
|
||||
{{ option.label }}
|
||||
</option>
|
||||
</Select>
|
||||
<ul
|
||||
class="setting-list suboptions"
|
||||
v-if="onBlockDefaultActionLv1 === 'temporarily'"
|
||||
>
|
||||
<li>
|
||||
<UnitSetting
|
||||
path="onBlockDefaultAction"
|
||||
unit-set="time"
|
||||
:units="['s', 'm', 'h', 'd']"
|
||||
:min="0"
|
||||
>
|
||||
{{ $t('user_card.default_expiration_time') }}
|
||||
</UnitSetting>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<BooleanSetting
|
||||
path="alwaysShowNewPostButton"
|
||||
|
|
@ -107,15 +167,10 @@
|
|||
</BooleanSetting>
|
||||
</li>
|
||||
<li>
|
||||
<BooleanSetting path="modalOnBlock">
|
||||
<BooleanSetting v-if="!blockExpirationSupported" path="modalOnBlock">
|
||||
{{ $t('settings.confirm_dialogs_block') }}
|
||||
</BooleanSetting>
|
||||
</li>
|
||||
<li>
|
||||
<BooleanSetting path="modalOnMute">
|
||||
{{ $t('settings.confirm_dialogs_mute') }}
|
||||
</BooleanSetting>
|
||||
</li>
|
||||
<li>
|
||||
<BooleanSetting path="modalOnMuteConversation">
|
||||
{{ $t('settings.confirm_dialogs_mute_conversation') }}
|
||||
|
|
|
|||
|
|
@ -1412,6 +1412,10 @@
|
|||
"dont_ask_again_block": "Always block users this way",
|
||||
"mute_block_temporarily": "Temporarily",
|
||||
"mute_block_forever": "Forever",
|
||||
"mute_block_ask": "Ask",
|
||||
"default_mute_expiration": "Always mute users",
|
||||
"default_block_expiration": "Always block users",
|
||||
"default_expiration_time": "Expire in",
|
||||
"mute_expires_forever": "Muted forever",
|
||||
"mute_expires_at": "Muted until {0}",
|
||||
"block_expires_forever": "Blocked forever",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue