Export: icon button at the right of each closed question opens the export dialog on it; templates reordered liste, barres, compact, procès-verbal, markdown, csv

This commit is contained in:
2026-11-19 01:24:02 +01:00
parent 98d8199ffd
commit 339cf97df1
4 changed files with 11 additions and 3 deletions
+6 -1
View File
@@ -130,8 +130,13 @@ function questionCard(q) {
if (!q.shown) actions.push(act("Rouvrir le vote", "reopen"));
}
if (q.state !== "draft") actions.push(h("button", { class: "small", type: "button", onclick: () => editExtra(q) }, "Votes en plus"));
if (q.state === "closed") actions.push(h("button", { class: "small", type: "button", onclick: () => openExport(q.id) }, "Exporter"));
if (q.state !== "draft" && !focused) actions.push(act([icon("screen", 15), "Afficher à l'écran"], "focus"));
if (q.state === "closed") {
actions.push(h("button", {
class: "small copy-btn", type: "button", title: "Exporter les résultats", "aria-label": "Exporter les résultats",
onclick: () => openExport(q.id),
}, icon("copy", 16)));
}
const badges = [h("span", { class: `badge ${q.state}` }, STATE_LABEL[q.state])];
if (q.results_public) badges.push(h("span", { class: "badge public" }, "Publiés"));
+1
View File
@@ -164,6 +164,7 @@ const ICONS = {
swap: ["M4 9h13l-3.5-3.5", "M20 15H7l3.5 3.5"],
camera: ["M3 8.5A2.5 2.5 0 0 1 5.5 6h2L9 4h6l1.5 2h2A2.5 2.5 0 0 1 21 8.5v9a2.5 2.5 0 0 1-2.5 2.5h-13A2.5 2.5 0 0 1 3 17.5z",
"M12 9.5a3.5 3.5 0 1 0 0 7a3.5 3.5 0 1 0 0-7"],
copy: ["M9 9h10v10H9z", "M5 15V5h10"],
};
export function icon(name, size = 16) {
+2 -2
View File
@@ -133,10 +133,10 @@ function csv(poll, voters, qs) {
}
export const FORMATS = [
{ id: "pv", label: "Procès-verbal", ext: "txt", mime: "text/plain", build: minutes },
{ id: "compact", label: "Compact", ext: "txt", mime: "text/plain", build: compact },
{ id: "list", label: "Liste", ext: "txt", mime: "text/plain", build: list },
{ id: "bars", label: "Barres", ext: "txt", mime: "text/plain", build: bars },
{ id: "compact", label: "Compact", ext: "txt", mime: "text/plain", build: compact },
{ id: "pv", label: "Procès-verbal", ext: "txt", mime: "text/plain", build: minutes },
{ id: "md", label: "Markdown", ext: "md", mime: "text/markdown", build: markdown },
{ id: "csv", label: "CSV", ext: "csv", mime: "text/csv", build: csv },
];