From 55569366f4ffc58e2f8e48666ed8cc6fe3d03439 Mon Sep 17 00:00:00 2001 From: Allison Date: Tue, 28 Apr 2026 08:57:36 -0400 Subject: [PATCH] =?UTF-8?q?feat(legal):=20B-2.9=206=20pages=20l=C3=A9gales?= =?UTF-8?q?=20(CGU,=20Loi=2025,=20cookies,=20remboursement,=20accessibilit?= =?UTF-8?q?=C3=A9,=20mentions)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - src/legal/__init__.py: define canonical LEGAL_VERSION='2026-04-27' constant (single source of truth — auth.py now imports it as SIGNUP_LEGAL_VERSION). - src/legal/routes.py: add /legal/ + /legal/ index routes; markdown rendered from src/legal/content/*.md with toc, tables, fenced_code, attr_list extensions. - src/legal/content/: 6 French (Québec) markdown documents — DictIA Inc. / InnovA AI S.E.N.C. branding, Loi 25-compliant 12-section privacy policy, WCAG 2.2 AA accessibility statement, AGPL-3.0 attribution. All marked DRAFT v1.0 pending legal review by Allison Rioux. - templates/legal/_layout.html + index.html: extends marketing/base.html; inline .legal-content typographic styles (no CSS rebuild required). - .gitignore: allow-rule for src/legal/content/*.md so markdown is tracked despite the global *.md ignore. - tests/test_legal_pages.py: 9 tests covering 200 responses, DictIA branding, rprp@dictia.ca presence, 12 mandatory Loi 25 sections, public indexability (no X-Robots-Tag noindex), shared layout, marketing/base.html extension, DRAFT callout, and LEGAL_VERSION/SIGNUP_LEGAL_VERSION equivalence. - tests/_run_legal_pages_windows.py: manual driver (Windows fcntl stub). - static/css/marketing.css: regenerated by `npm run build:css` to include new utility classes referenced from templates/legal/*.html. Tests: 9/9 pass. No off-limits files modified beyond the 2-line auth.py constant move spec'd in B-2.9. No schema changes; markdown==3.5.1 already pinned in requirements.txt (B-1.1). Pages publicly indexable by design (Loi 25 transparency). Co-Authored-By: Claude Opus 4.7 (1M context) --- .gitignore | 1 + src/api/auth.py | 7 +- src/legal/__init__.py | 13 ++- src/legal/content/accessibilite.md | 66 +++++++++++ src/legal/content/conditions.md | 107 +++++++++++++++++ src/legal/content/confidentialite.md | 120 ++++++++++++++++++++ src/legal/content/cookies.md | 62 ++++++++++ src/legal/content/mentions.md | 66 +++++++++++ src/legal/content/remboursement.md | 59 ++++++++++ src/legal/routes.py | 84 ++++++++++++++ static/css/marketing.css | 56 +++++++++ templates/legal/_layout.html | 134 ++++++++++++++++++++++ templates/legal/index.html | 27 +++++ tests/_run_legal_pages_windows.py | 74 ++++++++++++ tests/test_legal_pages.py | 164 +++++++++++++++++++++++++++ 15 files changed, 1034 insertions(+), 6 deletions(-) create mode 100644 src/legal/content/accessibilite.md create mode 100644 src/legal/content/conditions.md create mode 100644 src/legal/content/confidentialite.md create mode 100644 src/legal/content/cookies.md create mode 100644 src/legal/content/mentions.md create mode 100644 src/legal/content/remboursement.md create mode 100644 src/legal/routes.py create mode 100644 templates/legal/_layout.html create mode 100644 templates/legal/index.html create mode 100644 tests/_run_legal_pages_windows.py create mode 100644 tests/test_legal_pages.py diff --git a/.gitignore b/.gitignore index 51b52c5..ccab9f9 100644 --- a/.gitignore +++ b/.gitignore @@ -27,6 +27,7 @@ changes.txt !deployment/**/*.md !client_docs/**/*.md !client_docs/*.md +!src/legal/content/*.md docker-compose.dev.yml docker-compose.lite.yml docker-compose.postgres.yml diff --git a/src/api/auth.py b/src/api/auth.py index d19ccc0..48e65c2 100644 --- a/src/api/auth.py +++ b/src/api/auth.py @@ -129,9 +129,10 @@ def csrf_exempt(f): # --- Constants --- -# B-2.9 will define the canonical LEGAL_VERSION constant in src/legal/__init__.py. -# Until then, use the ISO date of the current legal text revision as the placeholder. -SIGNUP_LEGAL_VERSION = '2026-04-27' +# Canonical LEGAL_VERSION lives in src/legal/__init__.py (B-2.9). Re-exported +# here under the historical name so existing call sites in this file +# (consent_log.version, signup view) keep working without touching them. +from src.legal import LEGAL_VERSION as SIGNUP_LEGAL_VERSION # noqa: E402 # --- Forms --- diff --git a/src/legal/__init__.py b/src/legal/__init__.py index ffa13c6..2ae60b4 100644 --- a/src/legal/__init__.py +++ b/src/legal/__init__.py @@ -2,12 +2,16 @@ Accessibilite, Mentions. Mounted at /legal/* prefix. Content rendered from markdown files in -src/legal/content/ (added in Task B-2.9). - -Routes added in Task B-2.9. +src/legal/content/ (B-2.9). All 6 pages publicly indexable (Loi 25 transparency). """ from flask import Blueprint +# Canonical version of all 6 legal documents. Bump when ANY of the markdown +# files in src/legal/content/ is updated. Stored on every ConsentLog row at +# signup time (src/api/auth.py uses this to stamp consent_log.version). +# Format: ISO date 'YYYY-MM-DD' of the document revision. +LEGAL_VERSION = '2026-04-27' + legal_bp = Blueprint( 'legal', __name__, @@ -15,3 +19,6 @@ legal_bp = Blueprint( template_folder='../../templates/legal', static_folder=None, ) + +# Register routes +from src.legal import routes # noqa: E402, F401 diff --git a/src/legal/content/accessibilite.md b/src/legal/content/accessibilite.md new file mode 100644 index 0000000..0e9d760 --- /dev/null +++ b/src/legal/content/accessibilite.md @@ -0,0 +1,66 @@ + + +## 1. Engagement DictIA pour l'accessibilité numérique + +DictIA Inc. (filiale d'InnovA AI S.E.N.C., 77 chemin de la Seigneurie, Inverness QC G0S 1K0) considère que l'accessibilité numérique est un droit fondamental. Notre mission de transcription IA conforme à la Loi 25 s'adresse à des professionnels exigeants, dont certains vivent avec un handicap visuel, auditif, moteur ou cognitif. Nous nous engageons à rendre nos interfaces utilisables par toutes et tous. + +## 2. Niveau de conformité visé + +Le niveau de conformité visé par DictIA est **WCAG 2.2 niveau AA** (*Web Content Accessibility Guidelines*, version 2.2, niveau AA — recommandation officielle du W3C). + +Ce standard couvre les quatre principes fondamentaux : perceptible, utilisable, compréhensible et robuste. + +## 3. Standards techniques appliqués + +L'équipe DictIA applique systématiquement les bonnes pratiques suivantes lors du développement : + +- **Sémantique HTML5** : utilisation appropriée des balises `
`, `