- Aujourd'hui (Fil 13 sections + capture sticky) + Le chemin (tunnel 2 gestes, Q0 inline, 3 chips, dérogation asymétrique, alternatives réglage/consignation) - Registre + fiche décision (timeline, périmètre premier/second lieu auditable, affluence non-ignorable, S'instruire condensé, éléments + cartographie de clôture, épreuve du réel, Remettre en question, PV A4, gravure) - Salle de vote 5 modalités (consentement, nuancé+histogramme, binaire hérité avec jauge inertielle, Réglage collectif complet — faisceau, médiane basse, Pour moi, Explorer, cristallisation-geste —, élection à départage humain) - Textes (Pacte en clair, document vivant, diff, vue projetée, Atelier des formules porté du v1 sur le moteur unique) + Mandats (faits comptés, feux de la rampe, wizard 3 étapes) + Observatoire (consigner→observer→protocoliser) - Onboarding 7 gabarits + Données locales (export/import, attributs, atelier) - voting→framing gardé (Reformuler d'un réglage figé non cristallisé) - Pages v1 supprimées (login, documents, mandates, protocols, sanctuary, tools, decisions/new) — 342 tests verts, build zéro erreur Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
67 lines
2.1 KiB
Vue
67 lines
2.1 KiB
Vue
<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>
|