From 4cb0b46b4001a69c03b418d002a1df09c982462d Mon Sep 17 00:00:00 2001 From: camille Date: Fri, 27 Mar 2026 15:03:17 +0100 Subject: [PATCH] =?UTF-8?q?carte=20commenc=C3=A9e=20mais=20quelle=20galere?= =?UTF-8?q?=20npm=20install=20leaflet!?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- parcoursup-app/index.html | 6 +-- parcoursup-app/src/components/app.riot | 41 +++++++++++++++++++ .../src/components/carte-formations.riot | 34 +++++++++++++++ parcoursup-app/src/main.js | 29 ++----------- 4 files changed, 79 insertions(+), 31 deletions(-) create mode 100644 parcoursup-app/src/components/app.riot create mode 100644 parcoursup-app/src/components/carte-formations.riot diff --git a/parcoursup-app/index.html b/parcoursup-app/index.html index 63c5c35..b3fc109 100644 --- a/parcoursup-app/index.html +++ b/parcoursup-app/index.html @@ -6,11 +6,7 @@ Parcoursup but coded by an idiot -

Explorateur de formations

- - -
- +
\ No newline at end of file diff --git a/parcoursup-app/src/components/app.riot b/parcoursup-app/src/components/app.riot new file mode 100644 index 0000000..b6e30ba --- /dev/null +++ b/parcoursup-app/src/components/app.riot @@ -0,0 +1,41 @@ + +

Explorateur de formations

+ + + + + +
Chargement...
+ +
+ +
+ + +
\ No newline at end of file diff --git a/parcoursup-app/src/components/carte-formations.riot b/parcoursup-app/src/components/carte-formations.riot new file mode 100644 index 0000000..d6533f9 --- /dev/null +++ b/parcoursup-app/src/components/carte-formations.riot @@ -0,0 +1,34 @@ + +
+ + +
\ No newline at end of file diff --git a/parcoursup-app/src/main.js b/parcoursup-app/src/main.js index 8dc24d4..e920851 100644 --- a/parcoursup-app/src/main.js +++ b/parcoursup-app/src/main.js @@ -1,27 +1,4 @@ -import * as riot from 'riot' -import LigneResultat from './components/ligne-resultat.riot' -import { recupereFormations } from './api/parcoursup.js' +import { component } from 'riot' +import App from './components/app.riot' - -riot.register('ligne-resultat', LigneResultat) - -const bouton = document.getElementById("entrerRequete") -const champRecherche = document.getElementById("requete") -const divResultats = document.getElementById("affichageResultats") - -bouton.addEventListener("click", async () => { - const motCle = champRecherche.value - divResultats.innerHTML = "Chargement..." - - const formations = await recupereFormations(motCle) - - divResultats.innerHTML = "" - - formations.forEach(f => { - const listeFormations = riot.mount( - document.createElement('ligne-resultat'), - { formation: f } - ) - divResultats.appendChild(listeFormations[0].root) - }) -}) \ No newline at end of file +component(App)(document.getElementById('app')) \ No newline at end of file