Client - improve semantic

This commit is contained in:
Sam 2023-07-13 16:18:03 +02:00
parent e260a1a408
commit 14e66aee04
11 changed files with 93 additions and 73 deletions

View File

@ -1,24 +1,26 @@
<template> <template>
<div id="top" /> <div id="top" />
<NavBar @menuInteraction="updateHideScrollBar" /> <NavBar @menuInteraction="updateHideScrollBar" />
<div v-if="appLoading" class="app-container"> <main>
<div class="app-loading"> <div v-if="appLoading" class="app-container">
<Loader /> <div class="app-loading">
<Loader />
</div>
</div> </div>
</div> <div v-else class="app-container" :class="{ 'hide-scroll': hideScrollBar }">
<div v-else class="app-container" :class="{ 'hide-scroll': hideScrollBar }"> <router-view v-if="appConfig" />
<router-view v-if="appConfig" /> <NoConfig v-else />
<NoConfig v-else />
</div>
<div class="container scroll">
<div
class="scroll-button"
:class="{ 'display-button': displayScrollButton }"
@click="scrollToTop"
>
<i class="fa fa-chevron-up" aria-hidden="true"></i>
</div> </div>
</div> <div class="container scroll">
<div
class="scroll-button"
:class="{ 'display-button': displayScrollButton }"
@click="scrollToTop"
>
<i class="fa fa-chevron-up" aria-hidden="true"></i>
</div>
</div>
</main>
<Footer <Footer
v-if="appConfig" v-if="appConfig"
:version="appConfig ? appConfig.version : ''" :version="appConfig ? appConfig.version : ''"

View File

@ -61,13 +61,15 @@
<span class="cell-heading"> <span class="cell-heading">
{{ $t('user.PROFILE.REGISTRATION_DATE') }} {{ $t('user.PROFILE.REGISTRATION_DATE') }}
</span> </span>
{{ <time>
formatDate( {{
user.created_at, formatDate(
authUser.timezone, user.created_at,
authUser.date_format authUser.timezone,
) authUser.date_format
}} )
}}
</time>
</td> </td>
<td class="text-center"> <td class="text-center">
<span class="cell-heading"> <span class="cell-heading">

View File

@ -22,7 +22,7 @@
params: { workoutId: record.workout_id }, params: { workoutId: record.workout_id },
}" }"
> >
{{ record.workout_date }} <time>{{ record.workout_date }}</time>
</router-link> </router-link>
</span> </span>
</div> </div>

View File

@ -1,5 +1,5 @@
<template> <template>
<div id="footer"> <footer id="footer">
<div class="footer-items"> <div class="footer-items">
<div class="footer-item"> <div class="footer-item">
<strong>FitTrackee</strong> <strong>FitTrackee</strong>
@ -22,7 +22,7 @@
</router-link> </router-link>
</div> </div>
</div> </div>
</div> </footer>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">

View File

@ -1,5 +1,5 @@
<template> <template>
<div id="nav"> <header id="nav">
<Modal <Modal
v-show="displayModal" v-show="displayModal"
:title="$t('common.CONFIRMATION')" :title="$t('common.CONFIRMATION')"
@ -89,7 +89,7 @@
</div> </div>
</div> </div>
</div> </div>
</div> </header>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">

View File

@ -4,19 +4,20 @@
{{ capitalize($t('privacy_policy.TITLE')) }} {{ capitalize($t('privacy_policy.TITLE')) }}
</h1> </h1>
<p class="last-update"> <p class="last-update">
{{ $t('privacy_policy.LAST_UPDATE')}}: {{ private_policy_date }} {{ $t('privacy_policy.LAST_UPDATE') }}:
<time>{{ privatePolicyDate }}</time>
</p> </p>
<template v-if="appConfig.privacy_policy"> <template v-if="appConfig.privacy_policy">
<div <div v-html="snarkdown(linkifyAndClean(appConfig.privacy_policy))" />
v-html="snarkdown(linkifyAndClean(appConfig.privacy_policy))"
/>
</template> </template>
<template v-else> <template v-else>
<template v-for="paragraph in paragraphs" :key="paragraph"> <template v-for="paragraph in paragraphs" :key="paragraph">
<h2> <h2>
{{ $t(`privacy_policy.CONTENT.${paragraph}.TITLE`)}} {{ $t(`privacy_policy.CONTENT.${paragraph}.TITLE`) }}
</h2> </h2>
<p v-html="snarkdown($t(`privacy_policy.CONTENT.${paragraph}.CONTENT`))" /> <p
v-html="snarkdown($t(`privacy_policy.CONTENT.${paragraph}.CONTENT`))"
/>
</template> </template>
</template> </template>
</div> </div>
@ -34,7 +35,7 @@
import { linkifyAndClean } from '@/utils/inputs' import { linkifyAndClean } from '@/utils/inputs'
const store = useStore() const store = useStore()
const fittrackee_private_policy_date = 'Sun, 26 Feb 2023 17:00:00 GMT' const fittrackeePrivatePolicyDate = 'Sun, 26 Feb 2023 17:00:00 GMT'
const appConfig: ComputedRef<TAppConfig> = computed( const appConfig: ComputedRef<TAppConfig> = computed(
() => store.getters[ROOT_STORE.GETTERS.APP_CONFIG] () => store.getters[ROOT_STORE.GETTERS.APP_CONFIG]
) )
@ -46,19 +47,24 @@
) )
const dateFormat = computed(() => getDateFormat()) const dateFormat = computed(() => getDateFormat())
const timezone = computed(() => getTimezone()) const timezone = computed(() => getTimezone())
const private_policy_date = computed(() => getPolicyDate()) const privatePolicyDate = computed(() => getPolicyDate())
const paragraphs = [ const paragraphs = [
'DATA_COLLECTED', 'INFORMATION_USAGE', 'INFORMATION_PROTECTION', 'DATA_COLLECTED',
'INFORMATION_DISCLOSURE', 'SITE_USAGE_BY_CHILDREN', 'YOUR_CONSENT', 'INFORMATION_USAGE',
'ACCOUNT_DELETION', 'CHANGES_TO_OUR_PRIVACY_POLICY' 'INFORMATION_PROTECTION',
'INFORMATION_DISCLOSURE',
'SITE_USAGE_BY_CHILDREN',
'YOUR_CONSENT',
'ACCOUNT_DELETION',
'CHANGES_TO_OUR_PRIVACY_POLICY',
] ]
function getTimezone() { function getTimezone() {
return authUser.value.timezone return authUser.value.timezone
? authUser.value.timezone ? authUser.value.timezone
: Intl.DateTimeFormat().resolvedOptions().timeZone : Intl.DateTimeFormat().resolvedOptions().timeZone
? Intl.DateTimeFormat().resolvedOptions().timeZone ? Intl.DateTimeFormat().resolvedOptions().timeZone
: 'Europe/Paris' : 'Europe/Paris'
} }
function getDateFormat() { function getDateFormat() {
return dateStringFormats[language.value] return dateStringFormats[language.value]
@ -66,14 +72,13 @@
function getPolicyDate() { function getPolicyDate() {
return formatDate( return formatDate(
appConfig.value.privacy_policy && appConfig.value.privacy_policy_date appConfig.value.privacy_policy && appConfig.value.privacy_policy_date
? `${appConfig.value.privacy_policy_date}` ? `${appConfig.value.privacy_policy_date}`
: fittrackee_private_policy_date, : fittrackeePrivatePolicyDate,
timezone.value, timezone.value,
dateFormat.value, dateFormat.value,
false, false
) )
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

View File

@ -58,13 +58,17 @@
<div v-else> <div v-else>
<dl> <dl>
<dt>{{ $t('user.PROFILE.REGISTRATION_DATE') }}:</dt> <dt>{{ $t('user.PROFILE.REGISTRATION_DATE') }}:</dt>
<dd>{{ registrationDate }}</dd> <dd>
<time>{{ registrationDate }}</time>
</dd>
<dt>{{ $t('user.PROFILE.FIRST_NAME') }}:</dt> <dt>{{ $t('user.PROFILE.FIRST_NAME') }}:</dt>
<dd>{{ user.first_name }}</dd> <dd>{{ user.first_name }}</dd>
<dt>{{ $t('user.PROFILE.LAST_NAME') }}:</dt> <dt>{{ $t('user.PROFILE.LAST_NAME') }}:</dt>
<dd>{{ user.last_name }}</dd> <dd>{{ user.last_name }}</dd>
<dt>{{ $t('user.PROFILE.BIRTH_DATE') }}:</dt> <dt>{{ $t('user.PROFILE.BIRTH_DATE') }}:</dt>
<dd>{{ birthDate }}</dd> <dd>
<time v-if="birthDate">{{ birthDate }}</time>
</dd>
<dt>{{ $t('user.PROFILE.LOCATION') }}:</dt> <dt>{{ $t('user.PROFILE.LOCATION') }}:</dt>
<dd>{{ user.location }}</dd> <dd>{{ user.location }}</dd>
<dt>{{ $t('user.PROFILE.BIO') }}:</dt> <dt>{{ $t('user.PROFILE.BIO') }}:</dt>

View File

@ -49,13 +49,15 @@
</dd> </dd>
<dt>{{ capitalize($t('oauth2.APP.ISSUE_AT')) }}:</dt> <dt>{{ capitalize($t('oauth2.APP.ISSUE_AT')) }}:</dt>
<dd> <dd>
{{ <time>
formatDate( {{
client.issued_at, formatDate(
authUser.timezone, client.issued_at,
authUser.date_format authUser.timezone,
) authUser.date_format
}} )
}}
</time>
</dd> </dd>
<dt>{{ $t('oauth2.APP.NAME') }}:</dt> <dt>{{ $t('oauth2.APP.NAME') }}:</dt>
<dd>{{ client.name }}</dd> <dd>{{ client.name }}</dd>

View File

@ -8,13 +8,15 @@
</router-link> </router-link>
<span class="app-issued-at"> <span class="app-issued-at">
{{ $t('oauth2.APP.ISSUE_AT') }} {{ $t('oauth2.APP.ISSUE_AT') }}
{{ <time>
formatDate( {{
client.issued_at, formatDate(
authUser.timezone, client.issued_at,
authUser.date_format authUser.timezone,
) authUser.date_format
}} )
}}
</time>
</span> </span>
</li> </li>
</ul> </ul>

View File

@ -61,8 +61,9 @@
</span> </span>
</div> </div>
<div class="workout-date"> <div class="workout-date">
{{ workoutObject.workoutDate }} - <time>
{{ workoutObject.workoutTime }} {{ workoutObject.workoutDate }} - {{ workoutObject.workoutTime }}
</time>
<span class="workout-link"> <span class="workout-link">
<router-link <router-link
v-if="workoutObject.type === 'SEGMENT'" v-if="workoutObject.type === 'SEGMENT'"

View File

@ -83,13 +83,15 @@
<span class="cell-heading"> <span class="cell-heading">
{{ $t('workouts.DATE') }} {{ $t('workouts.DATE') }}
</span> </span>
{{ <time>
formatDate( {{
workout.workout_date, formatDate(
user.timezone, workout.workout_date,
user.date_format user.timezone,
) user.date_format
}} )
}}
</time>
</td> </td>
<td class="text-right"> <td class="text-right">
<span class="cell-heading"> <span class="cell-heading">