- Systeme de themes adaptatifs : Peps (light chaud), Zen (light calme), Chagrine (dark violet), Grave (dark ambre) avec CSS custom properties - Dashboard d'accueil orienté onboarding avec cartes-portes et teaser boite a outils - SectionLayout reutilisable : liste + sidebar toolbox + status pills cliquables (En prepa / En vote / En vigueur / Clos) - ToolboxVignette : vignettes Contexte / Tutos / Choisir / Demarrer - Seed : Acte engagement certification + forgeron, Runtime Upgrade (decision on-chain), 3 modalites de vote (majoritaire, quadratique, permanent) - Backend adapte SQLite (Uuid portable, 204 fix, pool conditionnel) - Correction noms composants (pathPrefix: false), pinia/nuxt ^0.11 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
73 lines
1.5 KiB
Vue
73 lines
1.5 KiB
Vue
<script setup lang="ts">
|
|
import type { DecisionCreate } from '~/stores/decisions'
|
|
|
|
const decisions = useDecisionsStore()
|
|
|
|
const formData = ref<DecisionCreate>({
|
|
title: '',
|
|
description: '',
|
|
context: '',
|
|
decision_type: 'other',
|
|
voting_protocol_id: null,
|
|
})
|
|
|
|
const submitting = ref(false)
|
|
|
|
async function onSubmit() {
|
|
submitting.value = true
|
|
try {
|
|
const decision = await decisions.create(formData.value)
|
|
if (decision) {
|
|
navigateTo(`/decisions/${decision.id}`)
|
|
}
|
|
} catch {
|
|
// Error is handled by the store
|
|
} finally {
|
|
submitting.value = false
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<template>
|
|
<div class="space-y-6">
|
|
<!-- Back link -->
|
|
<div>
|
|
<UButton
|
|
to="/decisions"
|
|
variant="ghost"
|
|
color="neutral"
|
|
icon="i-lucide-arrow-left"
|
|
label="Retour aux decisions"
|
|
size="sm"
|
|
/>
|
|
</div>
|
|
|
|
<!-- Header -->
|
|
<div>
|
|
<h1 class="text-2xl font-bold text-gray-900 dark:text-white">
|
|
Nouvelle decision
|
|
</h1>
|
|
<p class="mt-1 text-sm text-gray-600 dark:text-gray-400">
|
|
Cadrage d'un nouveau processus de decision collectif
|
|
</p>
|
|
</div>
|
|
|
|
<!-- Error -->
|
|
<UCard v-if="decisions.error">
|
|
<div class="flex items-center gap-3 text-red-500">
|
|
<UIcon name="i-lucide-alert-circle" class="text-xl" />
|
|
<p>{{ decisions.error }}</p>
|
|
</div>
|
|
</UCard>
|
|
|
|
<!-- Form -->
|
|
<UCard>
|
|
<DecisionCadrage
|
|
v-model="formData"
|
|
:submitting="submitting"
|
|
@submit="onSubmit"
|
|
/>
|
|
</UCard>
|
|
</div>
|
|
</template>
|