From 403cfd4b8518e551ede5c56804a3b38d969f0042 Mon Sep 17 00:00:00 2001
From: Rayane Belguebli <rayane.belguebli.etu@univ-lille.fr>
Date: Tue, 25 Feb 2025 16:12:08 +0100
Subject: [PATCH] =?UTF-8?q?reformatage=20du=20tableau=20de=20code=20apog?=
 =?UTF-8?q?=C3=A9e=20qui=20affiche=20le=20code,=20la=20table=20et=20le=20t?=
 =?UTF-8?q?itre?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 app/scodoc/sco_formsemestre_status.py | 28 ++++++++++++++-------------
 1 file changed, 15 insertions(+), 13 deletions(-)

diff --git a/app/scodoc/sco_formsemestre_status.py b/app/scodoc/sco_formsemestre_status.py
index 05d5f74f..eebf29a1 100755
--- a/app/scodoc/sco_formsemestre_status.py
+++ b/app/scodoc/sco_formsemestre_status.py
@@ -1057,14 +1057,17 @@ def formsemestre_status_head(formsemestre_id: int = None, page_title: str = None
     return "".join(H)
 
 queries = [
-    (text("SELECT elt_sem_apo, elt_annee_apo, elt_passage_apo FROM notes_formsemestre WHERE elt_sem_apo IS NOT NULL OR elt_annee_apo IS NOT NULL OR elt_passage_apo IS NOT NULL"), "notes_formsemestre"),
-    (text("SELECT etape_apo FROM notes_formsemestre_etapes WHERE etape_apo IS NOT NULL"), "notes_formsemestre_etapes"),
-    (text("SELECT code_apogee FROM notes_modules WHERE code_apogee IS NOT NULL"), "notes_modules"),
-    (text("SELECT code_apogee FROM notes_moduleimpl WHERE code_apogee IS NOT NULL"), "notes_moduleimpl"),
-    (text("SELECT code_apogee, titre FROM notes_ue WHERE code_apogee IS NOT NULL"), "notes_ue"),
-    (text("SELECT code_apogee_rcue, titre FROM notes_ue WHERE code_apogee_rcue IS NOT NULL"), "notes_ue")
+    (text("SELECT elt_sem_apo, titre FROM notes_formsemestre WHERE elt_sem_apo IS NOT NULL"), "SEMESTRE"),
+    (text("SELECT elt_annee_apo, titre FROM notes_formsemestre WHERE elt_annee_apo IS NOT NULL"), "ANNEE"),
+    (text("SELECT elt_passage_apo, titre FROM notes_formsemestre WHERE elt_passage_apo IS NOT NULL"), "PASSAGE"),
+    #(text("SELECT etape_apo FROM notes_formsemestre_etapes WHERE etape_apo IS NOT NULL"), "ETAPES"),
+    (text("SELECT code_apogee, titre FROM notes_modules WHERE code_apogee IS NOT NULL"), "MODULE"),
+    #(text("SELECT code_apogee FROM notes_moduleimpl WHERE code_apogee IS NOT NULL"), "MODULE IMP"),
+    (text("SELECT code_apogee, titre FROM notes_ue WHERE code_apogee IS NOT NULL"), "UE"),
+    (text("SELECT code_apogee_rcue, titre FROM notes_ue WHERE code_apogee_rcue IS NOT NULL"), "UE")
 ]
 
+
 def get_code_apo_results():
     results = []
     for query, table_name in queries:
@@ -1080,7 +1083,7 @@ def generate_html_table():
             <tr>
                 <th>Code Apogée</th>
                 <th>Table</th>
-                <th>Valeurs</th>
+                <th>Titre</th>
             </tr>
         </thead>
         <tbody>
@@ -1088,14 +1091,12 @@ def generate_html_table():
 
     for table_name, rows in results:
         for row in rows:
+            code_apogee, titre = row
             html_content += f"""
             <tr class="formsemestre_status_ue">
-                <td colspan="5">
-                    <span class="status_module_ue">{row}</span>
-                </td>
-                <td colspan="5">
-                    <span class="status_module_ue">{table_name}</span>
-                </td>
+                <td>{code_apogee}</td>
+                <td>{table_name}</td>
+                <td>{titre}</td>
             </tr>
             """
     html_content += """
@@ -1104,6 +1105,7 @@ def generate_html_table():
     """
     return html_content
 
+
 def formsemestre_status(formsemestre_id=None, check_parcours=True):
 
     """Tableau de bord semestre HTML"""
-- 
GitLab