From e357330cadcd27583d87e548642272c362621da0 Mon Sep 17 00:00:00 2001 From: syoul Date: Tue, 9 Dec 2025 12:10:31 +0100 Subject: [PATCH] =?UTF-8?q?fix:=20gestion=20route=20/team=20dans=20strateg?= =?UTF-8?q?ie-script.js=20et=20am=C3=A9lioration=20d=C3=A9tection=20liens?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Ajout de showTeamPage() dans strategie-script.js pour gérer /team - La route /team remplace maintenant le body par l'iframe team.html - Amélioration du script Python avec regex pour détecter tous les formats de liens - Gestion du popstate pour la route /team Cela corrige : - Les deux liens (détection améliorée avec regex) - L'affichage du radar au lieu des visualisations (remplacement du body par l'iframe) --- Dockerfile.business | 8 +++++++- public/strategie-script.js | 22 ++++++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/Dockerfile.business b/Dockerfile.business index e9971d3..4bc1e24 100644 --- a/Dockerfile.business +++ b/Dockerfile.business @@ -253,7 +253,8 @@ try: line = lines[i] # Détecter le début d'un lien Équipe (inclut /team, /team/, /team.html) - if ('href="/team' in line or "href='/team" in line) and not skip_team_link: + # Vérifier aussi si c'est dans un commentaire ou sur plusieurs lignes + if ('href="/team' in line or "href='/team" in line or 'href={"/team' in line or "href={'/team" in line) and not skip_team_link: skip_team_link = True team_links_removed += 1 # Ignorer cette ligne et les lignes suivantes jusqu'à @@ -262,8 +263,13 @@ try: # Si on est dans un bloc Équipe à supprimer, ignorer jusqu'à if skip_team_link: + # Vérifier si on a atteint la fin du
  • if '
  • ' in line: skip_team_link = False + # Vérifier aussi si on trouve un nouveau
  • sans avoir fermé le précédent (cas mal formaté) + elif '' not in line: + # On est dans un nouveau
  • , donc le précédent était mal formaté, continuer + pass i += 1 continue diff --git a/public/strategie-script.js b/public/strategie-script.js index c311d24..e9a22b5 100644 --- a/public/strategie-script.js +++ b/public/strategie-script.js @@ -794,6 +794,28 @@ Interface de pilotage pour les responsables sécurité des PME. else if (hash === '#business' || path === '/business') showPage('business'); else if (hash === '#dataviz' || path === '/dataviz') showPage('dataviz'); else if (hash === '#dataviz-details' || path === '/dataviz-details') showPage('dataviz-details'); + else if (path === '/team' || path === '/team/') showTeamPage(); + } + + function showTeamPage() { + // Sauvegarder le contenu original + if (!window.originalBodyContent) { + window.originalBodyContent = document.body.innerHTML; + } + + // Remplacer complètement le body par l'iframe team.html + document.body.innerHTML = ` +
    +