From 339cf97df11123cd1d274fbcebc9b8170ac99e01 Mon Sep 17 00:00:00 2001 From: Showdown76py Date: Thu, 19 Nov 2026 01:24:02 +0100 Subject: [PATCH] =?UTF-8?q?Export:=20icon=20button=20at=20the=20right=20of?= =?UTF-8?q?=20each=20closed=20question=20opens=20the=20export=20dialog=20o?= =?UTF-8?q?n=20it;=20templates=20reordered=20liste,=20barres,=20compact,?= =?UTF-8?q?=20proc=C3=A8s-verbal,=20markdown,=20csv?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- static/css/admin.css | 2 ++ static/js/admin.js | 7 ++++++- static/js/common.js | 1 + static/js/export.js | 4 ++-- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/static/css/admin.css b/static/css/admin.css index 42e3c6b..91cffb0 100644 --- a/static/css/admin.css +++ b/static/css/admin.css @@ -85,3 +85,5 @@ .share-q { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; font-weight: 500; cursor: pointer; } .share-q input { margin-top: 3px; flex: none; } .share-none { margin: 8px 0; font-size: .85rem; } + +.q .copy-btn { margin-left: auto; padding: 7px 9px; border-radius: 10px; border: 1.5px solid var(--line); color: var(--ink-2); } diff --git a/static/js/admin.js b/static/js/admin.js index d1a4896..3e49be0 100644 --- a/static/js/admin.js +++ b/static/js/admin.js @@ -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")); diff --git a/static/js/common.js b/static/js/common.js index d4c1dfc..7a70e48 100644 --- a/static/js/common.js +++ b/static/js/common.js @@ -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) { diff --git a/static/js/export.js b/static/js/export.js index d188acb..0147654 100644 --- a/static/js/export.js +++ b/static/js/export.js @@ -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 }, ];