diff --git a/parcoursup/app.riot b/parcoursup/app.riot
index ecf46dc..7ba92e0 100644
--- a/parcoursup/app.riot
+++ b/parcoursup/app.riot
@@ -3,6 +3,8 @@
Mini projet Parcoursup
Recherche de formations Parcoursup avec Riot
+ { state.selectedFormations.length } formation(s) sélectionnée(s)
+
@@ -11,11 +13,22 @@
results={ state.results }
hasSearched={ state.hasSearched }
loading={ state.loading }
- ondetail={ showDetail }>
+ ondetail={ showDetail }
+ onselect={ addToSelection }>
+
+ 0 }>
+
Formations sélectionnées
+
+
+
+ { f.nom } — { f.ville } — taux : { f.tauxAcces }%
+
+
+
@@ -32,7 +45,7 @@
loading: false,
hasSearched: false,
results: [],
- selected: null
+ selected: null,
selectedFormations: []
},
@@ -80,17 +93,17 @@
let exists = false
- for (let i = 0; i < selection.length; i++) {
- if (selection[i].id === formation.id) {
- exists = true
- }
- }
+ for (let i = 0; i < selection.length; i++) {
+ if (selection[i].id === formation.id) {
+ exists = true
+ }
+ }
- if (!exists) {
- selection.push(formation)
- this.update({ selectedFormations: selection })
- }
-},
+ if (!exists) {
+ selection.push(formation)
+ this.update({ selectedFormations: selection })
+ }
+ },
backToList() {
this.update({
diff --git a/parcoursup/components/result-list.riot b/parcoursup/components/result-list.riot
index 9d12a38..8b66167 100644
--- a/parcoursup/components/result-list.riot
+++ b/parcoursup/components/result-list.riot
@@ -14,7 +14,9 @@
Ville : { f.ville } ({ f.departement })
Filière : { f.filiere }
Taux d'accès : { f.tauxAcces }%
+
+
\ No newline at end of file