ajout de la sélection de formations et correction des composants riot

This commit is contained in:
2026-03-18 13:54:33 +01:00
parent 0dc766427b
commit 32145447c2
2 changed files with 27 additions and 12 deletions
+15 -2
View File
@@ -3,6 +3,8 @@
<h1>Mini projet Parcoursup</h1>
<p class="subtitle">Recherche de formations Parcoursup avec Riot</p>
<p><b>{ state.selectedFormations.length }</b> formation(s) sélectionnée(s)</p>
<div if={ !state.selected }>
<search-bar onsearch={ launchSearch }></search-bar>
@@ -11,11 +13,22 @@
results={ state.results }
hasSearched={ state.hasSearched }
loading={ state.loading }
ondetail={ showDetail }>
ondetail={ showDetail }
onselect={ addToSelection }>
</result-list>
<map-view results={ state.results }></map-view>
</div>
<div class="detail-card" if={ state.selectedFormations.length > 0 }>
<h3>Formations sélectionnées</h3>
<div each={ f in state.selectedFormations }>
<p>
<b>{ f.nom }</b> — { f.ville } — taux : { f.tauxAcces }%
</p>
</div>
</div>
</div>
<div if={ state.selected }>
@@ -32,7 +45,7 @@
loading: false,
hasSearched: false,
results: [],
selected: null
selected: null,
selectedFormations: []
},
+2
View File
@@ -14,7 +14,9 @@
<p><b>Ville :</b> { f.ville } ({ f.departement })</p>
<p><b>Filière :</b> { f.filiere }</p>
<p><b>Taux d'accès :</b> { f.tauxAcces }%</p>
<button onclick={ () => props.ondetail(i) }>Voir détail</button>
<button onclick={ () => props.onselect(i) }>Ajouter à la sélection</button>
</div>
</div>
</result-list>