From a47647e376013c3b5b51c58b94290bd7ac0832c2 Mon Sep 17 00:00:00 2001 From: martins Date: Mon, 27 Mar 2023 19:20:57 +0200 Subject: [PATCH] debut : ajout choix de la formation avec cache --- index.html | 27 +++++ js/model.js | 21 ++++ riot/app.riot | 18 ++++ riot/choixformation.riot | 211 +++++++++++++++++++++++++++++++++++++++ riot/suiviformation.riot | 25 +++++ 5 files changed, 302 insertions(+) create mode 100644 index.html create mode 100644 js/model.js create mode 100644 riot/app.riot create mode 100644 riot/choixformation.riot create mode 100644 riot/suiviformation.riot diff --git a/index.html b/index.html new file mode 100644 index 0000000..42a22bd --- /dev/null +++ b/index.html @@ -0,0 +1,27 @@ + + + + + + + + + + + + + S4WEB + + + + + + + \ No newline at end of file diff --git a/js/model.js b/js/model.js new file mode 100644 index 0000000..2848164 --- /dev/null +++ b/js/model.js @@ -0,0 +1,21 @@ + + +async function getFiliere(search){ + try { + let xhr=new XMLHttpRequest(); + xhr.open("get", `https://data.enseignementsup-recherche.gouv.fr/api/records/1.0/search/?dataset=fr-esr-parcoursup&sort=tri&facet=fili&timezone=Europe%2FBerlin&q=${search}`); + xhr.responseType = "json"; + + xhr.onload=() =>{ + if(xhr.status == 200){ + resolbe(xhr.response) + }else{ + PromiseRejectionEvent(xhr.statusText) + } + } + + xhr.onerror= () => PromiseRejectionEvent("Erreur Reseau"); + return xhr.send(); + } catch (error){} + return null; + } diff --git a/riot/app.riot b/riot/app.riot new file mode 100644 index 0000000..4ee83c0 --- /dev/null +++ b/riot/app.riot @@ -0,0 +1,18 @@ + + + + \ No newline at end of file diff --git a/riot/choixformation.riot b/riot/choixformation.riot new file mode 100644 index 0000000..5ee7568 --- /dev/null +++ b/riot/choixformation.riot @@ -0,0 +1,211 @@ + + + +
+ +
+ + + + +
+ +
+
+
+ + + +
+
+
+ +
+
+
+
+ +
\ No newline at end of file diff --git a/riot/suiviformation.riot b/riot/suiviformation.riot new file mode 100644 index 0000000..dc6a629 --- /dev/null +++ b/riot/suiviformation.riot @@ -0,0 +1,25 @@ + + + + +