Merge branch 'admin-tabs-2' into shigusegubu-themes3

This commit is contained in:
Henry Jameson 2025-12-15 22:56:19 +02:00
commit 4502a6cc25
8 changed files with 37 additions and 13 deletions

View file

@ -49,11 +49,15 @@
<PWAManifestIconsSetting path=":pleroma.:manifest.:icons" /> <PWAManifestIconsSetting path=":pleroma.:manifest.:icons" />
</li> </li>
<li> <li>
<ColorSetting path=":pleroma.:manifest.:theme_color" /> <ColorSetting hide-draft-buttons path=":pleroma.:manifest.:theme_color" />
</li> </li>
<li> <li>
<ColorSetting path=":pleroma.:manifest.:background_color" /> <ColorSetting hide-draft-buttons path=":pleroma.:manifest.:background_color" />
</li> </li>
<li>
<GroupSetting path=":pleroma.:manifest" />
</li>
<h4>{{ $t('admin_dash.instance.misc_brand') }}</H4>
<li> <li>
<AttachmentSetting path=":pleroma.:instance.:background_image" /> <AttachmentSetting path=":pleroma.:instance.:background_image" />
</li> </li>

View file

@ -131,13 +131,14 @@
</li> </li>
</ul> </ul>
</div> </div>
<DraftButtons />
</div> </div>
</template> </template>
<script src="./pwa_manifest_icons_setting.js"></script> <script src="./pwa_manifest_icons_setting.js"></script>
<style lang="scss"> <style lang="scss">
div.PWAManifestIconsSetting { div.PWAManifestIconsSetting {
margin-left: 3em;
&.setting-item { &.setting-item {
display: grid; display: grid;
grid-template-areas: grid-template-areas:

View file

@ -170,7 +170,7 @@ const SettingsModal = {
}, },
computed: { computed: {
...mapState(useInterfaceStore, { ...mapState(useInterfaceStore, {
temporaryChangesTimeoutId: store => store.temporaryChangesTimeoutId, temporaryChangesCountdown: store => store.temporaryChangesCountdown,
currentSaveStateNotice: store => store.settings.currentSaveStateNotice, currentSaveStateNotice: store => store.settings.currentSaveStateNotice,
modalActivated: store => store.settingsModalState !== 'hidden', modalActivated: store => store.settingsModalState !== 'hidden',
modalMode: store => store.settingsModalMode, modalMode: store => store.settingsModalMode,

View file

@ -70,7 +70,6 @@
.setting-label { .setting-label {
grid-area: label; grid-area: label;
text-align: right; text-align: right;
align-self: baseline;
} }
.ModifiedIndicator, .ModifiedIndicator,
@ -218,6 +217,13 @@
.setting-label { .setting-label {
text-align: left; text-align: left;
} }
.checkbox {
.label {
text-align: left;
margin-left: 0;
}
}
} }
ul { ul {

View file

@ -158,14 +158,14 @@
</div> </div>
<teleport to="#modal"> <teleport to="#modal">
<ConfirmModal <ConfirmModal
v-if="temporaryChangesTimeoutId" v-if="temporaryChangesCountdown > 0"
:title="$t('settings.confirm_new_setting')" :title="$t('settings.confirm_new_setting')"
:cancel-text="$t('settings.revert')" :cancel-text="$t('settings.revert')"
:confirm-text="$t('settings.confirm')" :confirm-text="$t('settings.confirm')"
@cancelled="temporaryChangesRevert" @cancelled="temporaryChangesRevert"
@accepted="temporaryChangesConfirm" @accepted="temporaryChangesConfirm"
> >
{{ $t('settings.confirm_new_question') }} {{ $t('settings.confirm_new_question_countdown', temporaryChangesCountdown) }}
</ConfirmModal> </ConfirmModal>
</teleport> </teleport>
</Modal> </Modal>

View file

@ -411,6 +411,7 @@
"appearance": "Appearance", "appearance": "Appearance",
"confirm_new_setting": "Confirm new setting?", "confirm_new_setting": "Confirm new setting?",
"confirm_new_question": "Does this look ok? Setting will be reverted in 10 seconds.", "confirm_new_question": "Does this look ok? Setting will be reverted in 10 seconds.",
"confirm_new_question_countdown": "Does this look ok? Setting will be reverted in 1 second. | Does this look ok? Setting will be reverted in {count} seconds.",
"revert": "Revert", "revert": "Revert",
"confirm": "Confirm", "confirm": "Confirm",
"text_size": "Text and interface size", "text_size": "Text and interface size",
@ -1404,6 +1405,7 @@
"maskable": "Maskable" "maskable": "Maskable"
} }
}, },
"misc_brand": "Miscellaneous elements",
"branding": "Branding", "branding": "Branding",
"access": "Instance access", "access": "Instance access",
"rich_metadata": "Metadata", "rich_metadata": "Metadata",

View file

@ -116,7 +116,6 @@ const config = {
} }
useInterfaceStore().setTemporaryChanges({ useInterfaceStore().setTemporaryChanges({
timeoutId: setTimeout(revert, 10000),
confirm, confirm,
revert revert
}) })

View file

@ -18,9 +18,10 @@ export const useInterfaceStore = defineStore('interface', {
paletteDataUsed: null, paletteDataUsed: null,
themeNameUsed: null, themeNameUsed: null,
themeDataUsed: null, themeDataUsed: null,
temporaryChangesTimeoutId: null, // used for temporary options that revert after a timeout temporaryChangesTimeoutId: null,
temporaryChangesCountdown: -1, // used for temporary options that revert after a timeout
temporaryChangesConfirm: () => {}, // used for applying temporary options temporaryChangesConfirm: () => {}, // used for applying temporary options
temporaryChangesRevert: () => {}, // used for reverting temporary options temporaryChangesRevert: () => {}, // used for reverting temporary options
settingsModalState: 'hidden', settingsModalState: 'hidden',
settingsModalLoadedUser: false, settingsModalLoadedUser: false,
settingsModalLoadedAdmin: false, settingsModalLoadedAdmin: false,
@ -44,14 +45,25 @@ export const useInterfaceStore = defineStore('interface', {
lastTimeline: null lastTimeline: null
}), }),
actions: { actions: {
setTemporaryChanges ({ timeoutId, confirm, revert }) { setTemporaryChanges ({ confirm, revert }) {
this.temporaryChangesTimeoutId = timeoutId this.temporaryChangesCountdown = 10
this.temporaryChangesConfirm = confirm this.temporaryChangesConfirm = confirm
this.temporaryChangesRevert = revert this.temporaryChangesRevert = revert
const countdownFunc = () => {
if (this.temporaryChangesCountdown === 1) {
this.temporaryChangesRevert()
this.clearTemporaryChanges()
} else {
this.temporaryChangesCountdown--
this.temporaryChangesTimeoutId = setTimeout(countdownFunc, 1000)
}
}
this.temporaryChangesTimeoutId = setTimeout(countdownFunc, 1000)
}, },
clearTemporaryChanges () { clearTemporaryChanges () {
clearTimeout(this.temporaryChangesTimeoutId) this.temporaryChangesTimeoutId ?? clearTimeout(this.temporaryChangesTimeoutId)
this.temporaryChangesTimeoutId = null this.temporaryChangesTimeoutId = null
this.temporaryChangesCountdown = -1
this.temporaryChangesConfirm = () => {} this.temporaryChangesConfirm = () => {}
this.temporaryChangesRevert = () => {} this.temporaryChangesRevert = () => {}
}, },