pleroma-fe/src/components/settings_modal/helpers/choice_setting.vue

59 lines
1.3 KiB
Vue
Raw Normal View History

<template>
<label
v-if="matchesExpertLevel"
2025-12-10 18:34:19 +02:00
class="ChoiceSetting setting-item"
2025-11-28 15:44:03 +02:00
:class="{ 'faint': shouldBeDisabled }"
>
2025-12-10 18:34:19 +02:00
<span class="setting-label">
<ModifiedIndicator
:changed="isChanged"
:onclick="reset"
/>
<ProfileSettingIndicator :is-profile="isProfileSetting" />
{{ ' ' }}
<template v-if="backendDescriptionLabel">
{{ backendDescriptionLabel }}
</template>
<template v-else>
<slot />
</template>
</span>
<Select
2025-12-10 18:34:19 +02:00
class="setting-control"
2025-11-28 02:02:29 +02:00
:model-value="realDraftMode ? draft : state"
2025-11-28 15:44:03 +02:00
:disabled="shouldBeDisabled"
2025-02-04 14:14:31 +02:00
@update:model-value="update"
>
<option
v-for="option in realOptions"
:key="option.key"
:value="option.value"
>
{{ option.label }}
2021-03-11 17:04:31 +02:00
{{ option.value === defaultState ? $t('settings.instance_default_simple') : '' }}
</option>
</Select>
<DraftButtons />
<p
v-if="backendDescriptionDescription"
class="setting-description"
>
{{ backendDescriptionDescription + ' ' }}
</p>
</label>
</template>
<script src="./choice_setting.js"></script>
2025-12-10 18:34:19 +02:00
<style lang="scss">
.ChoiceSetting.setting-item {
.-mobile & {
display: block;
.setting-label {
display: block;
margin-bottom: 0.5em
}
}
}
</style>