v3 : socle Rust (moteur pur, accès trustinWallet, serveur) ; maquette Nuxt rangée dans maquette/
- crates/ld-engine : formule inertielle (parité avec la maquette, garde C), coquille / changement de fond, assistant d'édition à règles, composition d'un document sous vote permanent (adoptions, aperçus, rivales). - crates/trustin-access : qui voit, qui ouvre, qui gère les accès. - crates/ld-server : API axum + SQLite, connexion Ğ1 (client OAuth2 de connect.monnaie-libre.fr), invitations, entrée en vigueur automatique, signalements de contradiction, traductions éditoriales, publication git, taille de la toile lue sur la chaîne. - seeds/acte-engagement-certification.json : 33 articles, fr + en + es ; en vigueur : préambule, E1, E2 (seed a minima). - maquette/ : frontend, backend et docker v2 déplacés tels quels. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,78 @@
|
||||
<script setup lang="ts">
|
||||
// Advice request card — three inline positions, one tap each.
|
||||
import type { Advice, Decision } from '~/types/domain'
|
||||
import { ROUTE_ICONS } from '~/lexicon'
|
||||
import { useCollectiveStore } from '~/stores/collective'
|
||||
import { useDecisionsStore } from '~/stores/decisions'
|
||||
|
||||
const props = defineProps<{ decision: Decision }>()
|
||||
|
||||
const col = useCollectiveStore()
|
||||
const decisions = useDecisionsStore()
|
||||
const error = ref('')
|
||||
|
||||
const POSITIONS: { value: Advice['position']; label: string; icon: string }[] = [
|
||||
{ value: 'favorable', label: 'Favorable', icon: 'i-lucide-thumbs-up' },
|
||||
{ value: 'reserved', label: 'Réservé', icon: 'i-lucide-minus' },
|
||||
{ value: 'unfavorable', label: 'Défavorable', icon: 'i-lucide-thumbs-down' },
|
||||
]
|
||||
|
||||
const mine = computed(() =>
|
||||
col.advices.find(a => a.decisionId === props.decision.id && a.personId === col.me?.id),
|
||||
)
|
||||
const mineLabel = computed(
|
||||
() => POSITIONS.find(p => p.value === mine.value?.position)?.label ?? '',
|
||||
)
|
||||
|
||||
function give(position: Advice['position']) {
|
||||
const res = decisions.adviseOn(props.decision.id, position)
|
||||
error.value = 'ok' in res ? res.reason : ''
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<!-- ld-v2 -->
|
||||
<FeedItemCard
|
||||
:title="decision.title"
|
||||
:icon="ROUTE_ICONS.advice"
|
||||
tint="var(--route-advice)"
|
||||
:to="`/decisions/${decision.id}`"
|
||||
>
|
||||
<template #meta>
|
||||
<LdCountdown :ends-at="decision.windowEndsAt" :suspended-at="decision.windowSuspendedAt" />
|
||||
</template>
|
||||
|
||||
<p v-if="error" class="fa-error">{{ error }}</p>
|
||||
|
||||
<template #actions>
|
||||
<span v-if="mine" class="fa-done">
|
||||
<UIcon name="i-lucide-check" /> Ton avis est déposé — {{ mineLabel }}
|
||||
</span>
|
||||
<template v-else>
|
||||
<button
|
||||
v-for="p in POSITIONS"
|
||||
:key="p.value"
|
||||
class="ld-btn ld-btn--ghost fa-btn"
|
||||
type="button"
|
||||
@click="give(p.value)"
|
||||
>
|
||||
<UIcon :name="p.icon" />
|
||||
<span>{{ p.label }}</span>
|
||||
</button>
|
||||
</template>
|
||||
</template>
|
||||
</FeedItemCard>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.fa-error { margin: 0; font-size: 0.8125rem; color: var(--mood-error); }
|
||||
.fa-done {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0.35rem;
|
||||
font-size: 0.875rem;
|
||||
font-weight: 600;
|
||||
color: var(--mood-status-vigueur);
|
||||
}
|
||||
.fa-btn { font-size: 0.875rem; padding: 0.4rem 0.875rem; }
|
||||
</style>
|
||||
Reference in New Issue
Block a user