This commit is contained in:
Bilou 2023-03-31 18:45:37 +02:00
parent cd16938e20
commit 9fb564ea5a
4 changed files with 9 additions and 23 deletions

View File

@ -1,16 +1,8 @@
<app> <app>
<div class="container"> <div class="container">
<router> <router>
<div if={state.showNotFound} class="row"> <div>
<div class="column column-60"> <home />
<not-found />
</div>
</div>
<div if={!state.showNotFound}>
<route each={page in state.pages} path={page.path}>
<main is={page.componentName} />
</route>
</div> </div>
</router> </router>
</div> </div>
@ -31,11 +23,13 @@
'./pages/home.riot' './pages/home.riot'
)), )),
}, },
state: { state: {
pages, pages,
showNotFound: false, showNotFound: false,
activePage: null activePage: null
}, },
onBeforeMount({ isServer }) { onBeforeMount({ isServer }) {
this.anyRouteStream = route('(.*)') this.anyRouteStream = route('(.*)')
this.anyRouteStream.on.value(this.onAnyRoute) this.anyRouteStream.on.value(this.onAnyRoute)

View File

@ -2,8 +2,6 @@ import log from "./log"
export default class Model { export default class Model {
constructor() { constructor() {
localStorage.clear()
this.state = { this.state = {
api: { api: {
link: "https://data.enseignementsup-recherche.gouv.fr/api/records/1.0/search/?dataset=fr-esr-parcoursup&q=&lang=fr&sort=tri", link: "https://data.enseignementsup-recherche.gouv.fr/api/records/1.0/search/?dataset=fr-esr-parcoursup&q=&lang=fr&sort=tri",
@ -123,8 +121,6 @@ export default class Model {
`&facet=${encodeURIComponent(this.state.api.facet.filiaire)}` + `&facet=${encodeURIComponent(this.state.api.facet.filiaire)}` +
`&apikey=${this.state.api.apikey}` `&apikey=${this.state.api.apikey}`
console.log(this.state.api.apikey)
return fetch(link) return fetch(link)
.then((res) => res.json()) .then((res) => res.json())
.then((data) => { .then((data) => {
@ -250,7 +246,7 @@ export default class Model {
* (Bilal prends la responsabilite de ce massacre) * (Bilal prends la responsabilite de ce massacre)
* */ * */
if(this.state.page.tcat === "Formation d'ingénieur Bac + 5") { if(this.state.page.tcat === "Formation d'ingénieur Bac + 5") {
link = `https://data.enseignementsup-recherche.gouv.fr/explore/embed/dataset/fr-esr-parcoursup/map/?timezone=Europe%2FBerlin&sort=tri&facet=fili&facet=fili&facet=form_lib_voe_acc&facet=fil_lib_voe_acc&refine.fili=Ecole%20d%27Ing%C3%A9nieur&refine.form_lib_voe_acc=Formations%20%20des%20%C3%A9coles%20d%27ing%C3%A9nieurs&refine.fil_lib_voe_acc=Formation%20d%27ing%C3%A9nieur%20Bac%20%2B%205` + link = `https://data.enseignementsup-recherche.gouv.fr/api/records/1.0/search/?dataset=fr-esr-parcoursup&q=&lang=fr&sort=tri&rows=10000&facet=fili&facet=form_lib_voe_acc&facet=fil_lib_voe_acc&refine.fili=Ecole%20d%27Ing%C3%A9nieur&refine.form_lib_voe_acc=Formations%20%20des%20%C3%A9coles%20d%27ing%C3%A9nieurs&refine.fil_lib_voe_acc=Formation%20d%27ing%C3%A9nieur%20Bac%20%2B%205` +
`&apikey=${this.state.api.apikey}` `&apikey=${this.state.api.apikey}`
} else if(this.state.page.tcat === "Formation Bac + 3") { } else if(this.state.page.tcat === "Formation Bac + 3") {
link = `https://data.enseignementsup-recherche.gouv.fr/api/records/1.0/search/?dataset=fr-esr-parcoursup&q=&lang=fr&sort=tri&rows=10000&facet=fili&facet=form_lib_voe_acc&facet=fil_lib_voe_acc&refine.fili=Ecole%20d%27Ing%C3%A9nieur&refine.form_lib_voe_acc=Formations%20%20des%20%C3%A9coles%20d%27ing%C3%A9nieurs&refine.fil_lib_voe_acc=Formation%20Bac%20%2B%203` + link = `https://data.enseignementsup-recherche.gouv.fr/api/records/1.0/search/?dataset=fr-esr-parcoursup&q=&lang=fr&sort=tri&rows=10000&facet=fili&facet=form_lib_voe_acc&facet=fil_lib_voe_acc&refine.fili=Ecole%20d%27Ing%C3%A9nieur&refine.form_lib_voe_acc=Formations%20%20des%20%C3%A9coles%20d%27ing%C3%A9nieurs&refine.fil_lib_voe_acc=Formation%20Bac%20%2B%203` +
@ -301,16 +297,14 @@ export default class Model {
`&location=6,48.04137,1.74683&basemap=e69ab1` + `&location=6,48.04137,1.74683&basemap=e69ab1` +
`&apikey=${this.state.api.apikey}` `&apikey=${this.state.api.apikey}`
console.log(link)
/** /**
* (Bilal prends la responsabilite de ce massacre) * (Bilal prends la responsabilite de ce massacre)
* */ * */
if(this.state.page.tcat === "Formation d'ingénieur Bac + 5") { if(this.state.page.tcat === "Formation d'ingénieur Bac + 5") {
link = `https://data.enseignementsup-recherche.gouv.fr/api/records/1.0/search/?dataset=fr-esr-parcoursup&q=&lang=fr&sort=tri&rows=10000&facet=fili&facet=form_lib_voe_acc&facet=fil_lib_voe_acc&refine.fili=Ecole%20d%27Ing%C3%A9nieur&refine.form_lib_voe_acc=Formations%20%20des%20%C3%A9coles%20d%27ing%C3%A9nieurs&refine.fil_lib_voe_acc=Formation%20d%27ing%C3%A9nieur%20Bac%20%2B%205&location=6,48.04137,1.74683&basemap=e69ab1` + link = `https://data.enseignementsup-recherche.gouv.fr/explore/embed/dataset/fr-esr-parcoursup/map/?timezone=Europe%2FBerlin&sort=tri&facet=form_lib_voe_acc&facet=fil_lib_voe_acc&refine.fili=Ecole%20d%27Ing%C3%A9nieur&refine.form_lib_voe_acc=Formations%20%20des%20%C3%A9coles%20d%27ing%C3%A9nieurs&refine.fil_lib_voe_acc=Formation%20d%27ing%C3%A9nieur%20Bac%20%2B%205&location=6,48.04137,1.74683&basemap=e69ab1` +
`&apikey=${this.state.api.apikey}` `&apikey=${this.state.api.apikey}`
} else if(this.state.page.tcat === "Formation Bac + 3") { } else if(this.state.page.tcat === "Formation Bac + 3") {
link = `https://data.enseignementsup-recherche.gouv.fr/explore/embed/dataset/fr-esr-parcoursup/map/?timezone=Europe%2FBerlin&sort=tri&facet=fili&facet=form_lib_voe_acc&facet=fil_lib_voe_acc&refine.fili=Ecole%20d%27Ing%C3%A9nieur&refine.form_lib_voe_acc=Formations%20%20des%20%C3%A9coles%20d%27ing%C3%A9nieurs&refine.fil_lib_voe_acc=Formation%20Bac%20%2B%203&location=6,47.0088,2.09656&basemap=e69ab1&location=6,48.04137,1.74683&basemap=e69ab1` + link = `https://data.enseignementsup-recherche.gouv.fr/explore/embed/dataset/fr-esr-parcoursup/map/?timezone=Europe%2FBerlin&sort=tri&refine.fili=Ecole%20d%27Ing%C3%A9nieur&refine.form_lib_voe_acc=Formations%20%20des%20%C3%A9coles%20d%27ing%C3%A9nieurs&refine.fil_lib_voe_acc=Formation%20Bac%20%2B%203&location=6,48.04137,1.74683&basemap=e69ab1` +
`&apikey=${this.state.api.apikey}` `&apikey=${this.state.api.apikey}`
} }

View File

@ -307,8 +307,6 @@ export default class View {
const nmap = document.createElement("map") const nmap = document.createElement("map")
console.log(link)
riot.mount(nmap, { riot.mount(nmap, {
link: link link: link
}, "map") }, "map")

View File

@ -9,7 +9,7 @@
#map-container #map-container
#map-map { #map-map {
width: 100%; width: 100%;
height: 25vw; height: 45vw;
} }
</style> </style>