Major rework of the citizen-facing page: - Chart + sidebar layout (auth/vote/countdown in right sidebar) - DisplaySettings component (font size, chart density, color palettes) - Adaptive CSS with clamp() throughout, responsive breakpoints at 480/768/1024 - Baseline charts zoomed on first tier for small consumption detail - Marginal price chart with dual Y-axes (foyers left, €/m³ right) - Key metrics banner (5 columns: recettes, palier, prix palier, prix médian, mon prix) - Client-side p0/impacts computation, draggable median price bar - Household dots toggle, vote overlay curves - Auth returns volume_m3, vote captures submitted_at - Cleaned header nav (removed Accueil/Super Admin for public visitors) - Terminology: foyer for bills, électeur for votes - 600m³ added to impact reference volumes - Realistic seed votes (50 votes, 3 profiles) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
111 lines
2.4 KiB
Vue
111 lines
2.4 KiB
Vue
<template>
|
|
<div class="app-layout">
|
|
<header class="app-header">
|
|
<div class="container header-inner">
|
|
<NuxtLink to="/" class="logo">SejeteralO</NuxtLink>
|
|
<div class="header-right">
|
|
<template v-if="authStore.isAuthenticated && authStore.isAdmin">
|
|
<NuxtLink
|
|
v-if="authStore.isSuperAdmin"
|
|
to="/admin"
|
|
class="header-link"
|
|
>
|
|
Administration
|
|
</NuxtLink>
|
|
<NuxtLink
|
|
v-else-if="authStore.communeSlug"
|
|
:to="`/admin/communes/${authStore.communeSlug}`"
|
|
class="header-link"
|
|
>
|
|
Gestion commune
|
|
</NuxtLink>
|
|
<button class="btn btn-secondary btn-sm" @click="logout">Deconnexion</button>
|
|
</template>
|
|
<DisplaySettings />
|
|
</div>
|
|
</div>
|
|
</header>
|
|
<main class="app-main container">
|
|
<slot />
|
|
</main>
|
|
<footer class="app-footer">
|
|
<div class="container">
|
|
SejeteralO — Outil de democratie participative pour la tarification de l'eau
|
|
</div>
|
|
</footer>
|
|
</div>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
const authStore = useAuthStore()
|
|
const router = useRouter()
|
|
|
|
function logout() {
|
|
authStore.logout()
|
|
router.push('/')
|
|
}
|
|
</script>
|
|
|
|
<style scoped>
|
|
.app-layout {
|
|
display: flex;
|
|
flex-direction: column;
|
|
min-height: 100vh;
|
|
}
|
|
|
|
.app-header {
|
|
background: var(--color-surface);
|
|
border-bottom: 1px solid var(--color-border);
|
|
padding: 0.75rem 0;
|
|
position: sticky;
|
|
top: 0;
|
|
z-index: 40;
|
|
}
|
|
|
|
.header-inner {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
}
|
|
|
|
.logo {
|
|
font-size: clamp(1.05rem, 3vw, 1.25rem);
|
|
font-weight: 700;
|
|
color: var(--color-primary);
|
|
}
|
|
.logo:hover { text-decoration: none; }
|
|
|
|
.header-right {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: clamp(0.5rem, 2vw, 1rem);
|
|
}
|
|
|
|
.header-link {
|
|
font-size: clamp(0.75rem, 2vw, 0.85rem);
|
|
white-space: nowrap;
|
|
color: var(--color-text-muted);
|
|
}
|
|
.header-link:hover { color: var(--color-primary); text-decoration: none; }
|
|
|
|
.btn-sm {
|
|
padding: 0.25rem 0.75rem;
|
|
font-size: 0.8rem;
|
|
}
|
|
|
|
.app-main {
|
|
flex: 1;
|
|
padding-top: clamp(1rem, 3vw, 2rem);
|
|
padding-bottom: clamp(1rem, 3vw, 2rem);
|
|
}
|
|
|
|
.app-footer {
|
|
background: var(--color-surface);
|
|
border-top: 1px solid var(--color-border);
|
|
padding: 1rem 0;
|
|
text-align: center;
|
|
font-size: 0.75rem;
|
|
color: var(--color-text-muted);
|
|
}
|
|
</style>
|