LaurentTRIPIED commited on
Commit
dd2c0fd
1 Parent(s): cab8b94
Files changed (1) hide show
  1. ActionsRSE.py +4 -9
ActionsRSE.py CHANGED
@@ -7,25 +7,20 @@ def display_actions_rse():
7
  data, total_hits = data_manager.get_data()
8
 
9
  if total_hits > 0:
10
- # Correction des clés pour correspondre à celles des données
11
- noms_entreprises = sorted({record.get("nom_courant_denomination") for record in data if record.get("nom_courant_denomination")})
12
  secteurs = sorted({record.get("libelle_section_naf") for record in data if record.get("libelle_section_naf")})
13
-
14
- # Interface utilisateur pour les filtres - Transformation en choix unique
15
- entreprise_selectionnee = st.selectbox("Filtre par nom d'entreprise :", ["Tous"] + noms_entreprises)
16
  secteur_selectionne = st.selectbox("Filtre par secteur d'activité :", ["Tous"] + secteurs)
17
 
18
- # Filtrage des actions RSE
19
  actions_filtrees = [
20
  record for record in data
21
- if (record.get("nom_courant_denomination") == entreprise_selectionnee or entreprise_selectionnee == "Tous")
22
- and (record.get("libelle_section_naf") == secteur_selectionne or secteur_selectionne == "Tous")
23
  ]
24
 
25
  # Affichage des actions RSE filtrées
26
  if actions_filtrees:
27
  for action in actions_filtrees:
28
- st.write(f"Entreprise: {action.get('nom_courant_denomination')}, Action: {action.get('action_rse')}")
 
29
  else:
30
  st.write("Aucune action RSE correspondante trouvée.")
31
  else:
 
7
  data, total_hits = data_manager.get_data()
8
 
9
  if total_hits > 0:
 
 
10
  secteurs = sorted({record.get("libelle_section_naf") for record in data if record.get("libelle_section_naf")})
 
 
 
11
  secteur_selectionne = st.selectbox("Filtre par secteur d'activité :", ["Tous"] + secteurs)
12
 
13
+ # Filtrage des actions RSE basé uniquement sur le secteur sélectionné
14
  actions_filtrees = [
15
  record for record in data
16
+ if record.get("libelle_section_naf") == secteur_selectionne or secteur_selectionne == "Tous"
 
17
  ]
18
 
19
  # Affichage des actions RSE filtrées
20
  if actions_filtrees:
21
  for action in actions_filtrees:
22
+ # Utilisation de Markdown pour l'affichage enrichi, incluant le gras
23
+ st.markdown(f":green_heart: **Entreprise**: {action.get('nom_courant_denomination')}\n\n**Action**: {action.get('action_rse')}", unsafe_allow_html=True)
24
  else:
25
  st.write("Aucune action RSE correspondante trouvée.")
26
  else: