i18n complet des pages + routine builder avancé (config par exo, réordonner, dupliquer)
Build & Deploy / build (push) Successful in 8s

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-19 04:48:26 +02:00
co-authored by Claude Opus 4.8
parent 2e9f0962a1
commit bd739d13cf
11 changed files with 398 additions and 53 deletions
+7 -6
View File
@@ -10,8 +10,9 @@ const saving = ref(false)
async function save() {
saving.value = true
try {
await api('/api/routines', { method: 'POST', body: { name: form.name, description: form.description } })
await navigateTo('/routines')
const res = await api<{ data: { id: number } }>('/api/routines', { method: 'POST', body: { name: form.name, description: form.description } })
// Redirige vers le builder pour ajouter les exercices.
await navigateTo(`/routines/${res.data.id}`)
} catch {
toast.add({ title: t('common.error'), color: 'error' })
saving.value = false
@@ -22,16 +23,16 @@ async function save() {
<template>
<div class="space-y-4 max-w-md mx-auto">
<UButton to="/routines" icon="i-lucide-arrow-left" color="neutral" variant="ghost" :label="t('common.back')" />
<h1 class="text-2xl font-black tracking-tight">Nouvelle routine</h1>
<h1 class="text-2xl font-black tracking-tight">{{ t('routines.newRoutine') }}</h1>
<form class="space-y-4" @submit.prevent="save">
<UFormField label="Nom">
<UFormField :label="t('routines.name')">
<UInput v-model="form.name" size="lg" class="w-full" required />
</UFormField>
<UFormField label="Description">
<UFormField :label="t('routines.description')">
<UTextarea v-model="form.description" class="w-full" :rows="3" />
</UFormField>
<UButton type="submit" block size="lg" color="primary" class="font-bold" :loading="saving" :label="t('common.save')" />
</form>
<p class="text-xs text-zinc-400 text-center">Tu pourras ajouter des exercices ensuite depuis la routine.</p>
<p class="text-xs text-zinc-400 text-center">{{ t('routines.addLater') }}</p>
</div>
</template>