implement user preference for elevation plots starting at zero;
add docker make command to downgrade db; add (google-powered) translations for the new labels
This commit is contained in:
@ -19,6 +19,8 @@
|
||||
</dd>
|
||||
<dt>{{ $t('user.PROFILE.ASCENT_DATA') }}:</dt>
|
||||
<dd>{{ $t(`common.${display_ascent}`) }}</dd>
|
||||
<dt>{{ $t('user.PROFILE.START_ELEVATION_AT_ZERO') }}:</dt>
|
||||
<dd>{{ $t(`common.${startElevationAtZero}`) }}</dd>
|
||||
</dl>
|
||||
<div class="profile-buttons">
|
||||
<button @click="$router.push('/profile/edit/preferences')">
|
||||
@ -54,6 +56,7 @@
|
||||
: languageLabels['en']
|
||||
)
|
||||
const fistDayOfWeek = computed(() => (props.user.weekm ? 'MONDAY' : 'SUNDAY'))
|
||||
const startElevationAtZero = computed(() => (props.user.start_elevation_at_zero ? 'TRUE' : 'FALSE'))
|
||||
const timezone = computed(() =>
|
||||
props.user.timezone ? props.user.timezone : 'Europe/Paris'
|
||||
)
|
||||
|
@ -99,6 +99,26 @@
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-items form-checkboxes">
|
||||
<span class="checkboxes-label">
|
||||
{{ $t('user.PROFILE.START_ELEVATION_AT_ZERO') }}
|
||||
</span>
|
||||
<div class="checkboxes">
|
||||
<label v-for="status in startElevationAtZeroData" :key="status.label">
|
||||
<input
|
||||
type="radio"
|
||||
:id="status.label"
|
||||
:name="status.label"
|
||||
:checked="status.value === userForm.start_elevation_at_zero"
|
||||
:disabled="loading"
|
||||
@input="updateStartElevationAtZero(status.value)"
|
||||
/>
|
||||
<span class="checkbox-label">
|
||||
{{ $t(`common.${status.label}`) }}
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-buttons">
|
||||
<button class="confirm" type="submit">
|
||||
{{ $t('buttons.SUBMIT') }}
|
||||
@ -170,6 +190,16 @@
|
||||
value: false,
|
||||
},
|
||||
]
|
||||
const startElevationAtZeroData = [
|
||||
{
|
||||
label: 'TRUE',
|
||||
value: true
|
||||
},
|
||||
{
|
||||
label: 'FALSE',
|
||||
value: false
|
||||
}
|
||||
]
|
||||
const loading = computed(
|
||||
() => store.getters[AUTH_USER_STORE.GETTERS.USER_LOADING]
|
||||
)
|
||||
@ -192,6 +222,7 @@
|
||||
|
||||
function updateUserForm(user: IAuthUserProfile) {
|
||||
userForm.display_ascent = user.display_ascent
|
||||
userForm.start_elevation_at_zero = user.start_elevation_at_zero ? user.start_elevation_at_zero : false
|
||||
userForm.imperial_units = user.imperial_units ? user.imperial_units : false
|
||||
userForm.language = user.language ? user.language : 'en'
|
||||
userForm.timezone = user.timezone ? user.timezone : 'Europe/Paris'
|
||||
@ -204,6 +235,9 @@
|
||||
function updateTZ(value: string) {
|
||||
userForm.timezone = value
|
||||
}
|
||||
function updateStartElevationAtZero(value: boolean) {
|
||||
userForm.start_elevation_at_zero = value
|
||||
}
|
||||
function updateAscentDisplay(value: boolean) {
|
||||
userForm.display_ascent = value
|
||||
}
|
||||
|
@ -78,7 +78,7 @@
|
||||
const { t } = useI18n()
|
||||
|
||||
const displayDistance = ref(true)
|
||||
const beginElevationAtZero = ref(true)
|
||||
const beginElevationAtZero = ref(props.authUser.start_elevation_at_zero)
|
||||
const datasets: ComputedRef<IWorkoutChartData> = computed(() =>
|
||||
getDatasets(props.workoutData.chartData, t, props.authUser.imperial_units)
|
||||
)
|
||||
|
Reference in New Issue
Block a user