$
This commit is contained in:
parent
cd16938e20
commit
9fb564ea5a
14
src/app.riot
14
src/app.riot
@ -1,16 +1,8 @@
|
||||
<app>
|
||||
<div class="container">
|
||||
<router>
|
||||
<div if={state.showNotFound} class="row">
|
||||
<div class="column column-60">
|
||||
<not-found />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div if={!state.showNotFound}>
|
||||
<route each={page in state.pages} path={page.path}>
|
||||
<main is={page.componentName} />
|
||||
</route>
|
||||
<div>
|
||||
<home />
|
||||
</div>
|
||||
</router>
|
||||
</div>
|
||||
@ -31,11 +23,13 @@
|
||||
'./pages/home.riot'
|
||||
)),
|
||||
},
|
||||
|
||||
state: {
|
||||
pages,
|
||||
showNotFound: false,
|
||||
activePage: null
|
||||
},
|
||||
|
||||
onBeforeMount({ isServer }) {
|
||||
this.anyRouteStream = route('(.*)')
|
||||
this.anyRouteStream.on.value(this.onAnyRoute)
|
||||
|
@ -2,8 +2,6 @@ import log from "./log"
|
||||
|
||||
export default class Model {
|
||||
constructor() {
|
||||
localStorage.clear()
|
||||
|
||||
this.state = {
|
||||
api: {
|
||||
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)}` +
|
||||
`&apikey=${this.state.api.apikey}`
|
||||
|
||||
console.log(this.state.api.apikey)
|
||||
|
||||
return fetch(link)
|
||||
.then((res) => res.json())
|
||||
.then((data) => {
|
||||
@ -250,7 +246,7 @@ export default class Model {
|
||||
* (Bilal prends la responsabilite de ce massacre)
|
||||
* */
|
||||
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}`
|
||||
} 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` +
|
||||
@ -301,16 +297,14 @@ export default class Model {
|
||||
`&location=6,48.04137,1.74683&basemap=e69ab1` +
|
||||
`&apikey=${this.state.api.apikey}`
|
||||
|
||||
console.log(link)
|
||||
|
||||
/**
|
||||
* (Bilal prends la responsabilite de ce massacre)
|
||||
* */
|
||||
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}`
|
||||
} 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}`
|
||||
}
|
||||
|
||||
|
@ -306,9 +306,7 @@ export default class View {
|
||||
this.map.innerHTML = ""
|
||||
|
||||
const nmap = document.createElement("map")
|
||||
|
||||
console.log(link)
|
||||
|
||||
|
||||
riot.mount(nmap, {
|
||||
link: link
|
||||
}, "map")
|
||||
|
@ -9,7 +9,7 @@
|
||||
#map-container
|
||||
#map-map {
|
||||
width: 100%;
|
||||
height: 25vw;
|
||||
height: 45vw;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user