diff --git a/.gitignore b/.gitignore index 25d2ccb..3086334 100644 --- a/.gitignore +++ b/.gitignore @@ -37,3 +37,4 @@ public/*.json html_cache/* /html_cache/ +activate \ No newline at end of file diff --git a/src/Controller/WikiController.php b/src/Controller/WikiController.php index 843d794..75363d3 100644 --- a/src/Controller/WikiController.php +++ b/src/Controller/WikiController.php @@ -137,14 +137,14 @@ class WikiController extends AbstractController $alignedSections = []; // First, process common sections (they already have both en and fr) -// if (isset($sectionComparison['common']) && is_array($sectionComparison['common'])) { -// foreach ($sectionComparison['common'] as $section) { -// $alignedSections[] = [ -// 'en' => $section['en'], -// 'fr' => $section['fr'] -// ]; -// } -// } + if (isset($sectionComparison['common']) && is_array($sectionComparison['common'])) { + foreach ($sectionComparison['common'] as $section) { + $alignedSections[] = [ + 'en' => $section['en'], + 'fr' => $section['fr'] + ]; + } + } // Then, process English-only sections and add empty placeholders for French if (isset($sectionComparison['en_only']) && is_array($sectionComparison['en_only'])) { @@ -162,8 +162,8 @@ class WikiController extends AbstractController ]; } } -// -// // Finally, process French-only sections (these will be shown at the end) + + // Finally, process French-only sections (these will be shown at the end) if (isset($sectionComparison['fr_only']) && is_array($sectionComparison['fr_only'])) { foreach ($sectionComparison['fr_only'] as $section) { $alignedSections[] = [ @@ -1040,7 +1040,8 @@ EOT; $globalMetrics = $entry['global_metrics']; // Format date for display - $formattedDate = (new \DateTime($date))->format('Y-m-d'); + $formattedDate = is_string($date) && !empty($date) && $date !== '0' ? + (new \DateTime($date))->format('Y-m-d') : 'N/A'; $metrics['dates'][] = $formattedDate; // Get average staleness score @@ -1061,7 +1062,8 @@ EOT; // Process history entries foreach ($historyEntries as $date => $entry) { // Format date for display - $formattedDate = (new \DateTime($date))->format('Y-m-d'); + $formattedDate = is_string($date) && !empty($date) && $date !== '0' ? + (new \DateTime($date))->format('Y-m-d') : 'N/A'; // If date already exists in metrics, use the same index $dateIndex = array_search($formattedDate, $metrics['dates']); diff --git a/templates/admin/wiki.html.twig b/templates/admin/wiki.html.twig index 076b08b..d71ef4c 100644 --- a/templates/admin/wiki.html.twig +++ b/templates/admin/wiki.html.twig @@ -13,12 +13,74 @@
++ Ces pages sont celles qui ont le plus besoin d'une mise à jour +
+