2023-07-26 04:09:10 +02:00
|
|
|
<script setup lang="ts">
|
2023-11-25 20:14:12 +01:00
|
|
|
const { t, locales, getBrowserLocale } = useI18n()
|
2023-09-07 18:13:09 +02:00
|
|
|
|
|
|
|
useHead({
|
|
|
|
title: t('footerlink_edit'),
|
|
|
|
})
|
|
|
|
|
2023-11-25 21:28:41 +01:00
|
|
|
const settings = await useSettings()
|
|
|
|
const preferedTheme = await usePreferedTheme()
|
2023-11-25 20:14:12 +01:00
|
|
|
const preferedLocale = usePreferedLocale()
|
|
|
|
|
2023-11-18 17:08:22 +01:00
|
|
|
const localesAsOptions = computed(() => {
|
2023-11-25 20:14:12 +01:00
|
|
|
const options = locales.value.map((locale) => ({
|
2023-11-18 17:08:22 +01:00
|
|
|
text: locale.name,
|
|
|
|
value: locale.code,
|
|
|
|
}))
|
2023-11-25 20:14:12 +01:00
|
|
|
const browserLocale = getBrowserLocale()
|
|
|
|
const browserLocaleName = locales.value.find(
|
|
|
|
(locale) => locale.code === browserLocale,
|
|
|
|
)?.name
|
|
|
|
options.unshift({
|
|
|
|
text: t('automatic', { name: browserLocaleName }),
|
|
|
|
value: 'auto',
|
|
|
|
})
|
|
|
|
|
|
|
|
return options
|
2023-11-18 17:08:22 +01:00
|
|
|
})
|
|
|
|
|
2024-02-14 14:09:07 +01:00
|
|
|
const { colors, sizes } = useThemeOverride()
|
|
|
|
|
2023-11-18 17:08:22 +01:00
|
|
|
const themesAsOptions = [
|
2023-11-25 21:28:41 +01:00
|
|
|
'auto',
|
2023-11-18 17:08:22 +01:00
|
|
|
'system',
|
|
|
|
'light',
|
|
|
|
'dark',
|
|
|
|
'cupcake',
|
|
|
|
'bumblebee',
|
|
|
|
'emerald',
|
|
|
|
'corporate',
|
|
|
|
'synthwave',
|
|
|
|
'retro',
|
|
|
|
'cyberpunk',
|
|
|
|
'valentine',
|
|
|
|
'halloween',
|
|
|
|
'garden',
|
|
|
|
'forest',
|
|
|
|
'aqua',
|
|
|
|
'lofi',
|
|
|
|
'pastel',
|
|
|
|
'fantasy',
|
|
|
|
'wireframe',
|
|
|
|
'black',
|
|
|
|
'luxury',
|
|
|
|
'dracula',
|
|
|
|
'cmyk',
|
|
|
|
'autumn',
|
|
|
|
'business',
|
|
|
|
'acid',
|
|
|
|
'lemonade',
|
|
|
|
'night',
|
|
|
|
'coffee',
|
|
|
|
'winter',
|
|
|
|
'dim',
|
|
|
|
'nord',
|
|
|
|
'sunset',
|
|
|
|
].map((theme) => ({
|
2023-11-25 21:28:41 +01:00
|
|
|
text:
|
|
|
|
theme !== 'auto'
|
|
|
|
? theme.charAt(0).toUpperCase() + theme.slice(1)
|
|
|
|
: t('automatic', { name: settings.value.portal_theme }),
|
2023-11-18 17:08:22 +01:00
|
|
|
value: theme,
|
|
|
|
}))
|
2023-07-26 04:09:10 +02:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
2023-08-06 16:27:24 +02:00
|
|
|
<div>
|
|
|
|
<PageTitle :text="$t('footerlink_edit')" />
|
2023-07-26 04:09:10 +02:00
|
|
|
|
2023-11-25 16:30:49 +01:00
|
|
|
<div class="lg:flex lg:justify-between">
|
|
|
|
<section
|
|
|
|
class="lg:w-1/2 lg:me-20 h-full card card-body border border-neutral my-10"
|
|
|
|
>
|
|
|
|
<h2 class="text-3xl mb-3">{{ t('edit_personal_settings') }}</h2>
|
2023-11-18 17:08:22 +01:00
|
|
|
|
2023-11-25 16:30:49 +01:00
|
|
|
<UserInfoForm />
|
|
|
|
</section>
|
2023-11-18 17:08:22 +01:00
|
|
|
|
2023-11-25 16:30:49 +01:00
|
|
|
<section class="lg:w-1/2 card card-body border border-neutral my-10">
|
|
|
|
<h2 class="text-3xl mb-3">{{ $t('change_password') }}</h2>
|
2023-11-18 17:08:22 +01:00
|
|
|
|
2023-11-25 16:30:49 +01:00
|
|
|
<UserPasswordForm />
|
|
|
|
</section>
|
|
|
|
</div>
|
2023-11-23 17:18:07 +01:00
|
|
|
|
2023-11-25 16:30:49 +01:00
|
|
|
<section class="card card-body border border-neutral my-10">
|
|
|
|
<h2 class="text-3xl mb-3">{{ t('edit_browser_settings') }}</h2>
|
2023-11-23 17:18:07 +01:00
|
|
|
|
2023-11-25 16:30:49 +01:00
|
|
|
<form novalidate @submit.prevent>
|
2023-11-23 17:18:07 +01:00
|
|
|
<div role="group" class="flex align mb-3">
|
|
|
|
<!-- eslint-disable-next-line vuejs-accessibility/label-has-for -->
|
|
|
|
<label for="language" class="label me-3">{{ t('language') }}</label>
|
2023-11-25 20:14:12 +01:00
|
|
|
<select
|
|
|
|
id="language"
|
|
|
|
v-model="preferedLocale"
|
|
|
|
class="select select-bordered"
|
|
|
|
>
|
2023-11-23 17:18:07 +01:00
|
|
|
<option disabled selected>{{ t('language') }}</option>
|
|
|
|
<option
|
|
|
|
v-for="option in localesAsOptions"
|
|
|
|
:key="option.value"
|
|
|
|
:value="option.value"
|
|
|
|
>
|
|
|
|
{{ option.text }}
|
|
|
|
</option>
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div role="group" class="flex align">
|
|
|
|
<!-- eslint-disable-next-line vuejs-accessibility/label-has-for -->
|
|
|
|
<label for="theme" class="label me-3">{{ t('theme') }}</label>
|
|
|
|
<select
|
|
|
|
id="theme"
|
2023-11-25 21:28:41 +01:00
|
|
|
v-model="preferedTheme"
|
2023-11-23 17:18:07 +01:00
|
|
|
class="select select-bordered"
|
|
|
|
>
|
|
|
|
<option disabled selected>{{ t('theme') }}</option>
|
|
|
|
<option
|
|
|
|
v-for="option in themesAsOptions"
|
|
|
|
:key="option.value"
|
|
|
|
:value="option.value"
|
|
|
|
>
|
|
|
|
{{ option.text }}
|
|
|
|
</option>
|
|
|
|
</select>
|
|
|
|
</div>
|
2024-02-14 14:09:07 +01:00
|
|
|
|
|
|
|
<fieldset class="theme-override mt-8">
|
|
|
|
<legend class="text-xl mb-6">{{ $t('theming.override') }}</legend>
|
|
|
|
|
|
|
|
<div
|
|
|
|
v-for="(_, colorName) in colors"
|
|
|
|
:key="colorName"
|
|
|
|
class="flex flex-wrap mb-2"
|
|
|
|
>
|
|
|
|
<FormField
|
|
|
|
:name="`color-picker-${colorName}`"
|
|
|
|
:label="
|
|
|
|
$t('theming.color_picker', {
|
|
|
|
colorName: $t(`theming.colors.${colorName}`),
|
|
|
|
})
|
|
|
|
"
|
|
|
|
sr-hide-label
|
|
|
|
>
|
|
|
|
<!-- eslint-disable-next-line vuejs-accessibility/form-control-has-label -->
|
|
|
|
<input
|
|
|
|
:id="`color-picker-${colorName}`"
|
|
|
|
v-model="colors[colorName]"
|
|
|
|
type="color"
|
|
|
|
class="inline-block w-8 h-8 -mr-8 cursor-pointer"
|
|
|
|
/>
|
|
|
|
<div
|
|
|
|
:class="'bg-' + colorName"
|
|
|
|
class="inline-block w-8 h-8 pointer-events-none border border-base-300"
|
|
|
|
/>
|
|
|
|
</FormField>
|
|
|
|
|
|
|
|
<FormField
|
|
|
|
:name="`color-hex-${colorName}`"
|
|
|
|
:label="
|
|
|
|
$t('theming.color_hex', {
|
|
|
|
colorName: $t(`theming.colors.${colorName}`),
|
|
|
|
})
|
|
|
|
"
|
|
|
|
sr-hide-label
|
|
|
|
>
|
|
|
|
<input
|
|
|
|
:id="`color-hex-${colorName}`"
|
|
|
|
v-model="colors[colorName]"
|
|
|
|
size="7"
|
|
|
|
class="input input-bordered px-2 font-mono ml-3"
|
|
|
|
/>
|
|
|
|
</FormField>
|
|
|
|
|
|
|
|
<span class="ml-3" aria-hidden>
|
|
|
|
{{ $t(`theming.colors.${colorName}`) }}
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div v-for="(_, sizeName) in sizes" :key="sizeName" class="flex mb-2">
|
|
|
|
<FormField
|
|
|
|
:name="`size-${sizeName}`"
|
|
|
|
:label="
|
|
|
|
$t('theming.size', {
|
|
|
|
sizeName: $t(`theming.sizes.${sizeName}`),
|
|
|
|
})
|
|
|
|
"
|
|
|
|
sr-hide-label
|
|
|
|
>
|
|
|
|
<!-- eslint-disable-next-line vuejs-accessibility/form-control-has-label -->
|
|
|
|
<input
|
|
|
|
:id="`size-${sizeName}`"
|
|
|
|
v-model="sizes[sizeName]"
|
|
|
|
type="number"
|
|
|
|
size="6"
|
|
|
|
class="input input-bordered inline-block pe-1"
|
|
|
|
/>
|
|
|
|
<span class="ml-3" aria-hidden>
|
|
|
|
{{ $t(`theming.sizes.${sizeName}`) }}
|
|
|
|
</span>
|
|
|
|
</FormField>
|
|
|
|
</div>
|
|
|
|
</fieldset>
|
2023-11-23 17:18:07 +01:00
|
|
|
</form>
|
|
|
|
</section>
|
2023-08-06 16:27:24 +02:00
|
|
|
</div>
|
2023-07-26 04:09:10 +02:00
|
|
|
</template>
|
2024-02-14 14:09:07 +01:00
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
.theme-override input.input {
|
|
|
|
min-height: 2rem;
|
|
|
|
height: 2rem;
|
|
|
|
}
|
|
|
|
</style>
|