fix: gestion route /team dans strategie-script.js et amélioration détection liens
- 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)
This commit is contained in:
@@ -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'à </li>
|
||||
@@ -262,8 +263,13 @@ try:
|
||||
|
||||
# Si on est dans un bloc Équipe à supprimer, ignorer jusqu'à </li>
|
||||
if skip_team_link:
|
||||
# Vérifier si on a atteint la fin du <li>
|
||||
if '</li>' in line:
|
||||
skip_team_link = False
|
||||
# Vérifier aussi si on trouve un nouveau <li> sans avoir fermé le précédent (cas mal formaté)
|
||||
elif '<li' in line and '</li>' not in line:
|
||||
# On est dans un nouveau <li>, donc le précédent était mal formaté, continuer
|
||||
pass
|
||||
i += 1
|
||||
continue
|
||||
|
||||
|
||||
@@ -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 = `
|
||||
<div style="width: 100vw; height: 100vh; margin: 0; padding: 0; overflow: hidden; position: fixed; top: 0; left: 0; z-index: 9999; background: #1a4d3a;">
|
||||
<iframe
|
||||
src="/team.html"
|
||||
style="width: 100%; height: 100%; border: none; margin: 0; padding: 0; display: block;"
|
||||
title="Équipe & Technologies"
|
||||
/>
|
||||
</div>
|
||||
`;
|
||||
|
||||
// Mettre à jour l'URL sans recharger la page
|
||||
window.history.pushState({page: 'team'}, 'Équipe & Technologies', '/team');
|
||||
}
|
||||
|
||||
function showPage(pageId) {
|
||||
|
||||
Reference in New Issue
Block a user