yandere_fe/src/components/settings_modal/settings_modal.vue

156 lines
4.7 KiB
Vue
Raw Normal View History

2020-05-03 07:36:12 -07:00
<template>
2020-05-24 17:43:55 -07:00
<Modal
:is-open="modalActivated"
class="settings-modal"
:class="{ peek: modalPeeked }"
:no-background="modalPeeked"
2020-05-03 07:36:12 -07:00
>
<div class="settings-modal-panel panel">
<div class="panel-heading">
<span class="title">
2023-03-21 01:26:25 -07:00
{{ modalMode === 'user' ? $t('settings.settings') : $t('admin_dash.window_title') }}
</span>
<transition name="fade">
2022-04-19 14:46:04 -07:00
<div
v-if="currentSaveStateNotice"
class="alert"
:class="{ transparent: !currentSaveStateNotice.error, error: currentSaveStateNotice.error}"
@click.prevent
>
{{ currentSaveStateNotice.error ? $t('settings.saving_err') : $t('settings.saving_ok') }}
2022-03-16 13:02:44 -07:00
</div>
</transition>
<button
class="btn button-default"
2021-03-08 09:53:30 -08:00
:title="$t('general.peek')"
2021-03-08 11:03:55 -08:00
@click="peekModal"
>
2021-03-08 09:53:30 -08:00
<FAIcon
:icon="['far', 'window-minimize']"
fixed-width
/>
</button>
<button
class="btn button-default"
2021-03-08 09:53:30 -08:00
:title="$t('general.close')"
2021-03-08 11:03:55 -08:00
@click="closeModal"
>
2021-03-08 09:53:30 -08:00
<FAIcon
icon="times"
fixed-width
/>
</button>
</div>
<div class="panel-body">
2023-03-14 12:50:43 -07:00
<SettingsModalUserContent v-if="modalMode === 'user' && modalOpenedOnceUser" />
<SettingsModalAdminContent v-if="modalMode === 'admin' && modalOpenedOnceAdmin" />
</div>
<div class="panel-footer settings-footer -flexible-height">
2021-03-08 09:53:30 -08:00
<Popover
2023-03-21 01:26:25 -07:00
v-if="modalMode === 'user'"
2021-03-08 09:53:30 -08:00
class="export"
trigger="click"
placement="top"
:offset="{ y: 5, x: 5 }"
:bound-to="{ x: 'container' }"
remove-padding
2021-03-08 11:03:55 -08:00
>
2022-07-31 02:35:48 -07:00
<template #trigger>
2021-04-07 12:42:34 -07:00
<button
class="btn button-default"
:title="$t('general.close')"
>
<span>{{ $t("settings.file_export_import.backup_restore") }}</span>
2022-03-23 07:15:05 -07:00
{{ ' ' }}
2021-04-07 12:42:34 -07:00
<FAIcon
icon="chevron-down"
/>
</button>
</template>
2022-07-31 02:35:48 -07:00
<template #content="{close}">
2021-03-08 09:53:30 -08:00
<div class="dropdown-menu">
<button
class="button-default dropdown-item dropdown-item-icon"
@click.prevent="backup"
@click="close"
>
<FAIcon
icon="file-download"
fixed-width
2021-03-08 11:00:43 -08:00
/><span>{{ $t("settings.file_export_import.backup_settings") }}</span>
2021-03-08 09:53:30 -08:00
</button>
<button
class="button-default dropdown-item dropdown-item-icon"
@click.prevent="backupWithTheme"
@click="close"
>
<FAIcon
icon="file-download"
fixed-width
2021-03-08 11:00:43 -08:00
/><span>{{ $t("settings.file_export_import.backup_settings_theme") }}</span>
2021-03-08 09:53:30 -08:00
</button>
<button
class="button-default dropdown-item dropdown-item-icon"
@click.prevent="restore"
@click="close"
>
<FAIcon
icon="file-upload"
fixed-width
2021-03-08 11:00:43 -08:00
/><span>{{ $t("settings.file_export_import.restore_settings") }}</span>
2021-03-08 09:53:30 -08:00
</button>
</div>
2021-04-07 12:42:34 -07:00
</template>
2021-03-08 09:53:30 -08:00
</Popover>
2022-03-29 05:35:18 -07:00
<Checkbox
:model-value="!!expertLevel"
@update:modelValue="expertLevel = Number($event)"
>
2022-02-28 08:23:32 -08:00
{{ $t("settings.expert_mode") }}
</Checkbox>
2023-03-21 01:26:25 -07:00
<span v-if="modalMode === 'admin'">
<i18n-t keypath="admin_dash.wip_notice">
<template #adminFeLink>
<a
href="/pleroma/admin/#/login-pleroma"
target="_blank"
>
{{ $t("admin_dash.old_ui_link") }}
</a>
</template>
</i18n-t>
</span>
2022-03-27 02:58:28 -07:00
<span
id="unscrolled-content"
2022-03-29 05:35:18 -07:00
class="extra-content"
/>
2023-04-24 13:01:29 -07:00
<span
v-if="modalMode === 'admin'"
class="admin-buttons"
>
<button
class="button-default btn"
:disabled="!adminDraftAny"
2023-04-24 13:01:29 -07:00
@click="resetAdminDraft"
>
2023-04-24 13:01:29 -07:00
{{ $t("admin_dash.reset_all") }}
</button>
{{ ' ' }}
<button
class="button-default btn"
:disabled="!adminDraftAny"
2023-04-24 13:01:29 -07:00
@click="pushAdminDraft"
>
2023-04-24 13:01:29 -07:00
{{ $t("admin_dash.commit_all") }}
</button>
</span>
2021-03-08 09:53:30 -08:00
</div>
</div>
2020-05-24 17:43:55 -07:00
</Modal>
2020-05-03 07:36:12 -07:00
</template>
<script src="./settings_modal.js"></script>
<style src="./settings_modal.scss" lang="scss"></style>