fix width if no voter

This commit is contained in:
2025-06-01 12:12:59 +02:00
parent 3a2b20a4c4
commit b126226e61
4 changed files with 27 additions and 4 deletions
+17
View File
@@ -0,0 +1,17 @@
FROM node:lts-alpine AS build-stage
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN n
RUN npx nuxt build
FROM node:lts-alpine AS production-stage
WORKDIR /app
COPY --from=build-stage /app/.output/ /app
COPY --from=build-stage /app/node_modules/ /app/node_modules
EXPOSE 3000
CMD ["node", "server/index.mjs"]
+3 -2
View File
@@ -21,7 +21,7 @@
réaliser la distribution des œufs, réaliser la distribution des œufs,
</li> </li>
<li> <li>
être Référent d’un produit. être Référent d’un resultsproduit.
</li> </li>
<li> <li>
être Référent du local de distribution (si officiellement créé), Référent Impression, être Référent du local de distribution (si officiellement créé), Référent Impression,
@@ -35,7 +35,8 @@
</ul> </ul>
<slot> <slot>
<component :is="questionComponent" question-id="1" :results="results" /> <component :is="questionComponent" question-id="1" :results="results" :values="['oui', 'non']"
:colors="['#acab', '#caba']" />
</slot> </slot>
</div> </div>
+2 -2
View File
@@ -1,7 +1,7 @@
<template> <template>
<div class="emphased"> <div class="emphased">
<div v-for="(amount, val) in filtered_results" :id="`${questionId}-${val}`" :key="val" <div v-for="(amount, val) in filtered_results" :id="`${questionId}-${val}`" :key="val"
:style="{ width: `${(amount / total) * 100}%`, background: colors[values.indexOf(String(val))] }"> :style="{ width: (total ? `${(amount / total) * 100}%` : '100%'), background: colors[values.indexOf(String(val))] }">
<span>({{ amount }}){{ val }}</span> <span>({{ amount }}){{ val }}</span>
</div> </div>
</div> </div>
@@ -40,7 +40,7 @@ const filtered_results = computed(() => {
}) })
const total = computed(() => Object.values(filtered_results.value).reduce((acc, v) => v + acc, 0) ?? 1) const total = computed(() => (Object.values(filtered_results.value).reduce((acc, v) => v + acc, 0) || 0))
</script> </script>
+5
View File
@@ -7,5 +7,10 @@ export default defineNuxtConfig({
public: { public: {
apiBase: '/api' apiBase: '/api'
} }
},
nitro:{
prerender:{
ignore:["/poll"]
}
} }
}) })