diff --git a/frontend/app/pages/index.vue b/frontend/app/pages/index.vue index 6c92db8..55125b7 100644 --- a/frontend/app/pages/index.vue +++ b/frontend/app/pages/index.vue @@ -2,6 +2,7 @@ const documents = useDocumentsStore() const decisions = useDecisionsStore() const protocols = useProtocolsStore() +const mandates = useMandatesStore() const auth = useAuthStore() const loading = ref(true) @@ -13,6 +14,7 @@ onMounted(async () => { documents.fetchAll(), decisions.fetchAll(), protocols.fetchProtocols(), + mandates.fetchAll(), ]) } finally { @@ -20,52 +22,61 @@ onMounted(async () => { } }) -const entryCards = computed(() => [ - { - key: 'decisions', - title: 'Décisions structurantes', - icon: 'i-lucide-scale', - to: '/decisions', - count: decisions.activeDecisions.length, - countLabel: `${decisions.activeDecisions.length} en cours`, - totalLabel: `${decisions.list.length} au total`, - description: 'Processus de décision collectifs', - color: 'var(--mood-secondary, var(--mood-accent))', - }, - { - key: 'documents', - title: 'Documents de référence', - icon: 'i-lucide-book-open', - to: '/documents', - count: documents.activeDocuments.length, - countLabel: `${documents.activeDocuments.length} actif${documents.activeDocuments.length > 1 ? 's' : ''}`, - totalLabel: `${documents.list.length} au total`, - description: 'Textes fondateurs sous vote permanent', - color: 'var(--mood-accent)', - }, - { - key: 'mandats', - title: 'Mandats et nominations', - icon: 'i-lucide-user-check', - to: '/mandates', - count: null, - countLabel: null, - totalLabel: null, - description: 'Missions déléguées avec nomination en binôme', - color: 'var(--mood-success)', - }, - { - key: 'protocoles', - title: 'Protocoles et fonctionnement', - icon: 'i-lucide-settings', - to: '/protocols', - count: 2, - countLabel: '2 protocoles', - totalLabel: `${protocols.protocols.length} modalités de vote`, - description: 'Modalités de vote, formules, workflows', - color: 'var(--mood-tertiary, var(--mood-accent))', - }, -]) +const entryCards = computed(() => { + const decisionsTotal = decisions.list.length + const decisionsActive = decisions.activeDecisions.length + + const docsActive = documents.activeDocuments.length + const docsTotal = documents.list.length + + const mandatesActive = mandates.list.filter(m => ['active', 'voting'].includes(m.status)).length + const mandatesTotal = mandates.list.length + + const protocolsCount = protocols.protocols.length + + return [ + { + key: 'decisions', + title: 'Décisions', + icon: 'i-lucide-scale', + to: '/decisions', + count: decisionsTotal, + countLabel: decisionsActive > 0 ? `${decisionsActive} en cours` : `${decisionsTotal} au total`, + totalLabel: decisionsActive > 0 ? `${decisionsTotal} au total` : 'aucune en cours', + color: 'var(--mood-secondary, var(--mood-accent))', + }, + { + key: 'documents', + title: 'Documents', + icon: 'i-lucide-book-open', + to: '/documents', + count: docsActive || docsTotal, + countLabel: docsActive > 0 ? `${docsActive} actif${docsActive > 1 ? 's' : ''}` : `${docsTotal} au total`, + totalLabel: docsTotal > 0 ? `${docsTotal} document${docsTotal > 1 ? 's' : ''}` : 'textes fondateurs', + color: 'var(--mood-accent)', + }, + { + key: 'mandats', + title: 'Mandats', + icon: 'i-lucide-user-check', + to: '/mandates', + count: mandatesTotal || null, + countLabel: mandatesTotal > 0 ? `${mandatesActive} en cours` : null, + totalLabel: mandatesTotal > 0 ? `${mandatesTotal} mandats` : 'missions déléguées', + color: 'var(--mood-success)', + }, + { + key: 'protocoles', + title: 'Protocoles', + icon: 'i-lucide-settings', + to: '/protocols', + count: protocolsCount || null, + countLabel: protocolsCount > 0 ? `${protocolsCount} protocoles` : null, + totalLabel: 'modalités de vote', + color: 'var(--mood-tertiary, var(--mood-accent))', + }, + ] +}) const recentDecisions = computed(() => { return [...decisions.list] @@ -98,7 +109,7 @@ function formatDate(dateStr: string): string {

- ğ(Decision) + libreDecision

Décisions collectives pour la communauté Duniter / G1 @@ -127,7 +138,7 @@ function formatDate(dateStr: string): string { {{ card.totalLabel }} @@ -151,7 +162,7 @@ function formatDate(dateStr: string): string {

- +
@@ -166,7 +177,7 @@ function formatDate(dateStr: string): string { Vote WoT Inertie Smith - Nuance + Nuancé
@@ -236,17 +247,19 @@ function formatDate(dateStr: string): string { flex-direction: column; gap: 2rem; max-width: 56rem; + margin: 0 auto; } /* --- Welcome --- */ .dash__welcome { padding: 0.5rem 0; } + .dash__title { font-size: 1.75rem; - font-weight: 800; - color: var(--mood-accent); - letter-spacing: -0.03em; + font-weight: 700; + letter-spacing: -0.02em; + line-height: 1.1; } @media (min-width: 640px) { @@ -254,14 +267,18 @@ function formatDate(dateStr: string): string { font-size: 2.25rem; } } -.dash__title-g { + +.dash__title-libre { font-style: italic; -} -.dash__title-paren { - font-weight: 300; + font-weight: 400; color: var(--mood-text-muted); - opacity: 0.4; } + +.dash__title-decision { + font-weight: 700; + color: var(--mood-accent); +} + .dash__subtitle { margin-top: 0.375rem; font-size: 0.9375rem; @@ -284,7 +301,6 @@ function formatDate(dateStr: string): string { @media (min-width: 640px) { .dash__entries { - grid-template-columns: 1fr 1fr; gap: 1rem; } } @@ -331,17 +347,29 @@ function formatDate(dateStr: string): string { } .entry-card__title { - font-size: 1.25rem; - font-weight: 800; + font-size: 1rem; + font-weight: 700; color: var(--mood-text); margin: 0; } +@media (min-width: 640px) { + .entry-card__title { + font-size: 1.125rem; + } +} + .entry-card__count { - font-size: 1.5rem; - font-weight: 800; + font-size: 0.9375rem; + font-weight: 700; color: var(--card-color, var(--mood-accent)); - line-height: 1; + line-height: 1.2; +} + +@media (min-width: 640px) { + .entry-card__count { + font-size: 1.125rem; + } } .entry-card__total { @@ -350,7 +378,7 @@ function formatDate(dateStr: string): string { } .entry-card__desc { - font-size: 0.875rem; + font-size: 0.8125rem; color: var(--mood-text-muted); line-height: 1.4; } @@ -452,7 +480,7 @@ function formatDate(dateStr: string): string { transform: translateY(0); } -/* --- Toolbox card (5th block, distinct) --- */ +/* --- Toolbox card --- */ .dash__toolbox-card { display: block; text-decoration: none; @@ -495,8 +523,8 @@ function formatDate(dateStr: string): string { } .dash__toolbox-card-title { - font-size: 1.125rem; - font-weight: 800; + font-size: 1.0625rem; + font-weight: 700; color: var(--mood-text); margin: 0; } @@ -557,8 +585,8 @@ function formatDate(dateStr: string): string { align-items: center; gap: 0.5rem; color: var(--mood-text); - font-weight: 800; - font-size: 1.0625rem; + font-weight: 700; + font-size: 1rem; margin-bottom: 0.75rem; } .dash__activity-head h3 { margin: 0; }