2021-10-17 21:01:14 +02:00
|
|
|
<template>
|
|
|
|
<div id="user-preferences" class="description-list">
|
|
|
|
<dl>
|
2021-10-20 17:38:25 +02:00
|
|
|
<dt>{{ $t('user.PROFILE.LANGUAGE') }}:</dt>
|
2021-10-17 21:01:14 +02:00
|
|
|
<dd>{{ language }}</dd>
|
2021-10-20 17:38:25 +02:00
|
|
|
<dt>{{ $t('user.PROFILE.TIMEZONE') }}:</dt>
|
2021-10-17 21:01:14 +02:00
|
|
|
<dd>{{ timezone }}</dd>
|
2021-10-20 17:38:25 +02:00
|
|
|
<dt>{{ $t('user.PROFILE.FIRST_DAY_OF_WEEK') }}:</dt>
|
|
|
|
<dd>{{ $t(`user.PROFILE.${fistDayOfWeek}`) }}</dd>
|
2021-11-13 20:04:47 +01:00
|
|
|
<dt>{{ $t('user.PROFILE.UNITS.LABEL') }}:</dt>
|
|
|
|
<dd>
|
|
|
|
{{
|
|
|
|
$t(
|
|
|
|
`user.PROFILE.UNITS.${user.imperial_units ? 'IMPERIAL' : 'METRIC'}`
|
|
|
|
)
|
|
|
|
}}
|
|
|
|
</dd>
|
2021-10-17 21:01:14 +02:00
|
|
|
</dl>
|
|
|
|
<div class="profile-buttons">
|
|
|
|
<button @click="$router.push('/profile/edit/preferences')">
|
2021-10-20 17:38:25 +02:00
|
|
|
{{ $t('user.PROFILE.EDIT_PREFERENCES') }}
|
2021-10-17 21:01:14 +02:00
|
|
|
</button>
|
2021-10-20 17:38:25 +02:00
|
|
|
<button @click="$router.push('/')">{{ $t('common.HOME') }}</button>
|
2021-10-17 21:01:14 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
2021-11-10 21:19:27 +01:00
|
|
|
<script setup lang="ts">
|
|
|
|
import { computed } from 'vue'
|
2021-10-17 21:01:14 +02:00
|
|
|
|
2021-10-30 12:01:55 +02:00
|
|
|
import { IUserProfile } from '@/types/user'
|
2021-10-31 19:48:49 +01:00
|
|
|
import { languageLabels } from '@/utils/locales'
|
2021-10-17 21:01:14 +02:00
|
|
|
|
2021-11-10 21:19:27 +01:00
|
|
|
interface Props {
|
|
|
|
user: IUserProfile
|
|
|
|
}
|
|
|
|
const props = defineProps<Props>()
|
|
|
|
|
|
|
|
const language = computed(() =>
|
|
|
|
props.user.language
|
|
|
|
? languageLabels[props.user.language]
|
|
|
|
: languageLabels['en']
|
|
|
|
)
|
|
|
|
const fistDayOfWeek = computed(() => (props.user.weekm ? 'MONDAY' : 'SUNDAY'))
|
|
|
|
const timezone = computed(() =>
|
|
|
|
props.user.timezone ? props.user.timezone : 'Europe/Paris'
|
|
|
|
)
|
2021-10-17 21:01:14 +02:00
|
|
|
</script>
|