Client - add password reset + refacto
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div id="timeline">
|
||||
<div class="section-title">{{ t('workouts.LATEST_WORKOUTS') }}</div>
|
||||
<div class="section-title">{{ $t('workouts.LATEST_WORKOUTS') }}</div>
|
||||
<div v-if="user.nb_workouts > 0 && workouts.length === 0">
|
||||
<WorkoutCard
|
||||
v-for="index in [...Array(initWorkoutsCount).keys()]"
|
||||
@ -23,7 +23,7 @@
|
||||
<NoWorkouts v-if="workouts.length === 0" />
|
||||
<div v-if="moreWorkoutsExist" class="more-workouts">
|
||||
<button @click="loadMoreWorkouts">
|
||||
{{ t('workouts.LOAD_MORE_WORKOUT') }}
|
||||
{{ $t('workouts.LOAD_MORE_WORKOUT') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@ -39,7 +39,6 @@
|
||||
ref,
|
||||
onBeforeMount,
|
||||
} from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
import WorkoutCard from '@/components/Workout/WorkoutCard.vue'
|
||||
import NoWorkouts from '@/components/Workouts/NoWorkouts.vue'
|
||||
@ -67,7 +66,6 @@
|
||||
},
|
||||
setup(props) {
|
||||
const store = useStore()
|
||||
const { t } = useI18n()
|
||||
|
||||
let page = ref(1)
|
||||
const per_page = 5
|
||||
@ -103,7 +101,6 @@
|
||||
moreWorkoutsExist,
|
||||
per_page,
|
||||
workouts,
|
||||
t,
|
||||
loadMoreWorkouts,
|
||||
}
|
||||
},
|
||||
|
@ -25,7 +25,7 @@
|
||||
import { defineComponent, PropType } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
import SportImage from '@/components/Common/SportImage/index.vue'
|
||||
import SportImage from '@/components/Common/Images/SportImage/index.vue'
|
||||
import { IWorkout } from '@/types/workouts'
|
||||
|
||||
export default defineComponent({
|
||||
|
@ -18,7 +18,6 @@
|
||||
<script lang="ts">
|
||||
import { endOfMonth, startOfMonth } from 'date-fns'
|
||||
import { PropType, defineComponent } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
import Card from '@/components/Common/Card.vue'
|
||||
import StatChart from '@/components/Common/StatsChart/index.vue'
|
||||
@ -42,7 +41,6 @@
|
||||
},
|
||||
},
|
||||
setup(props) {
|
||||
const { t } = useI18n()
|
||||
const date = new Date()
|
||||
return {
|
||||
chartParams: {
|
||||
@ -51,7 +49,6 @@
|
||||
end: endOfMonth(date),
|
||||
},
|
||||
selectedSportIds: props.sports.map((sport) => sport.id),
|
||||
t,
|
||||
}
|
||||
},
|
||||
})
|
||||
|
@ -31,7 +31,7 @@
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
import Card from '@/components/Common/Card.vue'
|
||||
import SportImage from '@/components/Common/SportImage/index.vue'
|
||||
import SportImage from '@/components/Common/Images/SportImage/index.vue'
|
||||
import { IRecord } from '@/types/workouts'
|
||||
|
||||
export default defineComponent({
|
||||
|
@ -2,11 +2,11 @@
|
||||
<div class="user-records-section">
|
||||
<div class="section-title">
|
||||
<i class="fa fa-trophy custom-fa-small" aria-hidden="true" />
|
||||
{{ t('workouts.RECORD', 2) }}
|
||||
{{ $t('workouts.RECORD', 2) }}
|
||||
</div>
|
||||
<div class="user-records">
|
||||
<div v-if="Object.keys(recordsBySport).length === 0" class="no-records">
|
||||
{{ t('workouts.NO_RECORDS') }}
|
||||
{{ $t('workouts.NO_RECORDS') }}
|
||||
</div>
|
||||
<RecordsCard
|
||||
v-for="sportTranslatedLabel in Object.keys(recordsBySport).sort()"
|
||||
@ -52,7 +52,7 @@
|
||||
props.user.timezone
|
||||
)
|
||||
)
|
||||
return { recordsBySport, t }
|
||||
return { recordsBySport }
|
||||
},
|
||||
})
|
||||
</script>
|
||||
|
@ -3,12 +3,12 @@
|
||||
<UserStatCard
|
||||
icon="calendar"
|
||||
:value="user.nb_workouts"
|
||||
:text="t('workouts.WORKOUT', user.nb_workouts)"
|
||||
:text="$t('workouts.WORKOUT', user.nb_workouts)"
|
||||
/>
|
||||
<UserStatCard
|
||||
icon="road"
|
||||
:value="Number(user.total_distance).toFixed(2)"
|
||||
:text="t('workouts.KM')"
|
||||
:text="$t('workouts.KM')"
|
||||
/>
|
||||
<UserStatCard
|
||||
icon="clock-o"
|
||||
@ -18,7 +18,7 @@
|
||||
<UserStatCard
|
||||
icon="tags"
|
||||
:value="user.nb_sports"
|
||||
:text="t('workouts.SPORT', user.nb_sports)"
|
||||
:text="$t('workouts.SPORT', user.nb_sports)"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
@ -63,10 +63,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
t,
|
||||
total_duration: computed(() => get_duration(total_duration)),
|
||||
}
|
||||
return { total_duration: computed(() => get_duration(total_duration)) }
|
||||
},
|
||||
})
|
||||
</script>
|
||||
|
Reference in New Issue
Block a user