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,66 @@
|
||||
<script setup lang="ts">
|
||||
// Open vote card — miniature participation gauge + link to the vote room.
|
||||
// The gauge shows who already spoke, never a result (results live in the room).
|
||||
import type { Decision, VoteSession } from '~/types/domain'
|
||||
import { ROUTE_ICONS } from '~/lexicon'
|
||||
import { useCollectiveStore } from '~/stores/collective'
|
||||
import { useDecisionsStore } from '~/stores/decisions'
|
||||
|
||||
const props = defineProps<{ session: VoteSession; decision?: Decision }>()
|
||||
|
||||
const col = useCollectiveStore()
|
||||
const decisions = useDecisionsStore()
|
||||
|
||||
const voted = computed(() => decisions.activeVotes(props.session.id).length)
|
||||
const total = computed(() => Math.max(props.session.corpusSize, 1))
|
||||
const pct = computed(() => Math.min(100, Math.round((voted.value / total.value) * 100)))
|
||||
const iVoted = computed(() =>
|
||||
decisions.activeVotes(props.session.id).some(v => v.voterId === col.me?.id),
|
||||
)
|
||||
const title = computed(() => props.decision?.title ?? 'Décision en vote')
|
||||
const roomLink = computed(() =>
|
||||
props.decision ? `/decisions/${props.decision.id}/vote` : undefined,
|
||||
)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<!-- ld-v2 -->
|
||||
<FeedItemCard
|
||||
:title="title"
|
||||
:icon="ROUTE_ICONS.collective"
|
||||
tint="var(--route-collective)"
|
||||
:to="roomLink"
|
||||
>
|
||||
<template #meta>
|
||||
<LdCountdown :ends-at="session.closesAt" />
|
||||
<span>{{ voted }} / {{ total }} se sont prononcés</span>
|
||||
</template>
|
||||
|
||||
<div class="fv-gauge" role="img" :aria-label="`Participation : ${pct} %`">
|
||||
<div class="fv-gauge__fill" :style="{ width: pct + '%' }" />
|
||||
</div>
|
||||
|
||||
<template #actions>
|
||||
<NuxtLink v-if="roomLink" :to="roomLink" class="ld-btn fv-btn">
|
||||
<UIcon name="i-lucide-door-open" />
|
||||
<span>{{ iVoted ? 'Revoir mon vote' : 'Entrer dans la salle' }}</span>
|
||||
</NuxtLink>
|
||||
</template>
|
||||
</FeedItemCard>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.fv-gauge {
|
||||
height: 6px;
|
||||
border-radius: 3px;
|
||||
background: var(--mood-status-vote-bg);
|
||||
overflow: hidden;
|
||||
}
|
||||
.fv-gauge__fill {
|
||||
height: 100%;
|
||||
border-radius: 3px;
|
||||
background: var(--mood-status-vote);
|
||||
transition: width 0.3s ease;
|
||||
}
|
||||
.fv-btn { font-size: 0.875rem; padding: 0.4rem 1rem; text-decoration: none; }
|
||||
</style>
|
||||
Reference in New Issue
Block a user