merge
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -85,11 +85,33 @@ var mainController = {
|
||||
this.update({
|
||||
course: null,
|
||||
schoolList: [],
|
||||
school: null,
|
||||
popupEnabled: false,
|
||||
shouldShowInfos: false
|
||||
});
|
||||
},
|
||||
clearCache(e) {
|
||||
localStorage.clear();
|
||||
e.target.textContent = "Cache vidé !";
|
||||
setTimeout(() => {
|
||||
e.target.textContent = "Vider le cache";
|
||||
}, 3000);
|
||||
},
|
||||
popup(school) {
|
||||
this.update({
|
||||
school: school,
|
||||
popupEnabled: true
|
||||
});
|
||||
console.log("popup!");
|
||||
},
|
||||
closePopup() {
|
||||
this.update({
|
||||
popupEnabled: false
|
||||
});
|
||||
console.log("closed!");
|
||||
}
|
||||
},
|
||||
template: (template, expressionTypes, bindingTypes, getComponent) => template('<div class="columns"><div class="column is-one-third"><div class="box p-3 m-2" style="display: flex"><img class="m-auto" src="./resources/logo-parcoursup.svg"/></div><search expr643="expr643"></search></div><div class="column"><fili-info expr644="expr644"></fili-info><school expr645="expr645"></school></div></div><school-info expr646="expr646"></school-info>', [{
|
||||
template: (template, expressionTypes, bindingTypes, getComponent) => template('<div class="columns"><div class="column is-one-third"><div class="box p-3 m-2" style="display: flex"><img class="m-auto" src="./resources/logo-parcoursup.svg"/></div><search expr2165="expr2165"></search><button expr2166="expr2166" class="button is-danger ml-2 is-outlined">Vider le cache</button></div><div class="column pl-0"><fili-info expr2167="expr2167"></fili-info><school expr2168="expr2168"></school></div></div><school-info expr2169="expr2169"></school-info>', [{
|
||||
type: bindingTypes.TAG,
|
||||
getComponent: getComponent,
|
||||
evaluate: _scope => 'search',
|
||||
@@ -99,8 +121,16 @@ var mainController = {
|
||||
name: 'updateCourse',
|
||||
evaluate: _scope => _scope.updateCourse
|
||||
}],
|
||||
redundantAttribute: 'expr643',
|
||||
selector: '[expr643]'
|
||||
redundantAttribute: 'expr2165',
|
||||
selector: '[expr2165]'
|
||||
}, {
|
||||
redundantAttribute: 'expr2166',
|
||||
selector: '[expr2166]',
|
||||
expressions: [{
|
||||
type: expressionTypes.EVENT,
|
||||
name: 'onclick',
|
||||
evaluate: _scope => _scope.clearCache
|
||||
}]
|
||||
}, {
|
||||
type: bindingTypes.TAG,
|
||||
getComponent: getComponent,
|
||||
@@ -119,14 +149,18 @@ var mainController = {
|
||||
name: 'shouldShowInfos',
|
||||
evaluate: _scope => _scope.state.shouldShowInfos
|
||||
}],
|
||||
redundantAttribute: 'expr644',
|
||||
selector: '[expr644]'
|
||||
redundantAttribute: 'expr2167',
|
||||
selector: '[expr2167]'
|
||||
}, {
|
||||
type: bindingTypes.TAG,
|
||||
getComponent: getComponent,
|
||||
evaluate: _scope => 'school',
|
||||
slots: [],
|
||||
attributes: [{
|
||||
type: expressionTypes.ATTRIBUTE,
|
||||
name: 'popup',
|
||||
evaluate: _scope => _scope.popup
|
||||
}, {
|
||||
type: expressionTypes.ATTRIBUTE,
|
||||
name: 'schoolList',
|
||||
evaluate: _scope => _scope.state.schoolList
|
||||
@@ -143,16 +177,28 @@ var mainController = {
|
||||
name: 'shouldShowInfos',
|
||||
evaluate: _scope => _scope.state.shouldShowInfos
|
||||
}],
|
||||
redundantAttribute: 'expr645',
|
||||
selector: '[expr645]'
|
||||
redundantAttribute: 'expr2168',
|
||||
selector: '[expr2168]'
|
||||
}, {
|
||||
type: bindingTypes.TAG,
|
||||
getComponent: getComponent,
|
||||
evaluate: _scope => 'school-info',
|
||||
slots: [],
|
||||
attributes: [],
|
||||
redundantAttribute: 'expr646',
|
||||
selector: '[expr646]'
|
||||
attributes: [{
|
||||
type: expressionTypes.ATTRIBUTE,
|
||||
name: 'closeWindow',
|
||||
evaluate: _scope => _scope.closePopup
|
||||
}, {
|
||||
type: expressionTypes.ATTRIBUTE,
|
||||
name: 'popupEnabled',
|
||||
evaluate: _scope => _scope.state.popupEnabled
|
||||
}, {
|
||||
type: expressionTypes.ATTRIBUTE,
|
||||
name: 'school',
|
||||
evaluate: _scope => _scope.state.school
|
||||
}],
|
||||
redundantAttribute: 'expr2169',
|
||||
selector: '[expr2169]'
|
||||
}]),
|
||||
name: 'main-controller'
|
||||
};
|
||||
|
File diff suppressed because one or more lines are too long
@@ -5,7 +5,7 @@ const SORT_TABLE = [{
|
||||
name: "Ville",
|
||||
id: "ville_etab"
|
||||
}, {
|
||||
name: "Département",
|
||||
name: "Dept.",
|
||||
id: "dep"
|
||||
}, {
|
||||
name: "Moyenne",
|
||||
@@ -69,6 +69,38 @@ var school = {
|
||||
state.filteredSchoolList = [...state.schoolList];
|
||||
if (this.$("input")) this.$("input").value = "";
|
||||
}
|
||||
if (state.map) {
|
||||
state.markers.clearLayers();
|
||||
for (let school of state.filteredSchoolList) {
|
||||
let fields = school.fields;
|
||||
let pos = fields.g_olocalisation_des_formations;
|
||||
let popupHTML = document.createElement("div");
|
||||
let title = document.createElement("span");
|
||||
title.textContent = fields.g_ea_lib_vx;
|
||||
title.class = "is-primary";
|
||||
console.log(props);
|
||||
let linkToForma = document.createElement("a");
|
||||
linkToForma.onclick = () => props.popup(school);
|
||||
linkToForma.textContent = "Voir les infos de l'établissement";
|
||||
popupHTML.appendChild(title);
|
||||
popupHTML.appendChild(document.createElement("br"));
|
||||
popupHTML.appendChild(linkToForma);
|
||||
let marker = L.marker(pos);
|
||||
marker.bindPopup(popupHTML);
|
||||
state.markers.addLayer(marker);
|
||||
}
|
||||
state.map.addLayer(state.markers);
|
||||
}
|
||||
},
|
||||
onUpdated(props, state) {
|
||||
if (!state.map && props.shouldShowInfos) {
|
||||
state.map = L.map("map").setView([47, 2.5], 5);
|
||||
state.markers = L.markerClusterGroup();
|
||||
L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {
|
||||
maxZoom: 19,
|
||||
attribution: '© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'
|
||||
}).addTo(state.map);
|
||||
}
|
||||
},
|
||||
onBeforeMount(props, state) {
|
||||
this.state = {
|
||||
@@ -79,20 +111,14 @@ var school = {
|
||||
},
|
||||
sortFields: SORT_TABLE
|
||||
},
|
||||
template: (template, expressionTypes, bindingTypes, getComponent) => template('<div expr680="expr680" class="box p-2 m-2" disabled></div>', [{
|
||||
template: (template, expressionTypes, bindingTypes, getComponent) => template('<div expr157="expr157" class="box p-2 m-2" disabled></div>', [{
|
||||
type: bindingTypes.IF,
|
||||
evaluate: _scope => _scope.props.shouldShowInfos,
|
||||
redundantAttribute: 'expr680',
|
||||
selector: '[expr680]',
|
||||
template: template('<iframe expr681="expr681" width="100%" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://www.openstreetmap.org/export/embed.html?bbox=-14.655761718750002%2C40.56389453066509%2C13.601074218750002%2C51.754240074033525&layer=mapnik" style="border-radius: 5px;"></iframe><div class="block control has-icons-left is-inline-block is-pulled-right"><input expr682="expr682" class="input" type="search" placeholder="Établissement"/><span class="icon is-small is-left"><i class="fas fa-search"></i></span></div><table class="table is-fullwidth is-hoverable"><thead><tr><th expr683="expr683"></th></tr></thead><tbody><tr expr685="expr685"></tr></tbody></table>', [{
|
||||
type: bindingTypes.IF,
|
||||
evaluate: _scope => false,
|
||||
redundantAttribute: 'expr681',
|
||||
selector: '[expr681]',
|
||||
template: template(null, [])
|
||||
}, {
|
||||
redundantAttribute: 'expr682',
|
||||
selector: '[expr682]',
|
||||
redundantAttribute: 'expr157',
|
||||
selector: '[expr157]',
|
||||
template: template('<div id="map" width="100%" style="border-radius: 5px"></div><div class="mt-2 mb-2 control has-icons-left is-inline-block is-pulled-right"><input expr158="expr158" class="input" type="search" placeholder="Établissement"/><span class="icon is-small is-left"><i class="fas fa-search"></i></span></div><table class="table is-fullwidth is-hoverable is-narrow"><thead><tr><th expr159="expr159"></th></tr></thead><tbody><tr expr161="expr161"></tr></tbody></table>', [{
|
||||
redundantAttribute: 'expr158',
|
||||
selector: '[expr158]',
|
||||
expressions: [{
|
||||
type: expressionTypes.EVENT,
|
||||
name: 'onkeyup',
|
||||
@@ -102,15 +128,15 @@ var school = {
|
||||
type: bindingTypes.EACH,
|
||||
getKey: null,
|
||||
condition: null,
|
||||
template: template(' <a expr684="expr684"><span class="icon"><i class="fas fa-sort"></i></span></a>', [{
|
||||
template: template(' <a expr160="expr160"><span class="icon"><i class="fas fa-sort"></i></span></a>', [{
|
||||
expressions: [{
|
||||
type: expressionTypes.TEXT,
|
||||
childNodeIndex: 0,
|
||||
evaluate: _scope => [_scope.sortField.name].join('')
|
||||
}]
|
||||
}, {
|
||||
redundantAttribute: 'expr684',
|
||||
selector: '[expr684]',
|
||||
redundantAttribute: 'expr160',
|
||||
selector: '[expr160]',
|
||||
expressions: [{
|
||||
type: expressionTypes.ATTRIBUTE,
|
||||
name: 'id',
|
||||
@@ -121,8 +147,8 @@ var school = {
|
||||
evaluate: _scope => () => _scope.sortList(_scope.sortField.id, true)
|
||||
}]
|
||||
}]),
|
||||
redundantAttribute: 'expr683',
|
||||
selector: '[expr683]',
|
||||
redundantAttribute: 'expr159',
|
||||
selector: '[expr159]',
|
||||
itemName: 'sortField',
|
||||
indexName: null,
|
||||
evaluate: _scope => _scope.sortFields
|
||||
@@ -130,9 +156,9 @@ var school = {
|
||||
type: bindingTypes.EACH,
|
||||
getKey: null,
|
||||
condition: null,
|
||||
template: template('<td><a expr686="expr686"> </a></td><td expr687="expr687"> </td><td expr688="expr688"> </td><td expr689="expr689"> </td><td><title-progress expr690="expr690" max="100" style="margin: auto"></title-progress></td>', [{
|
||||
redundantAttribute: 'expr686',
|
||||
selector: '[expr686]',
|
||||
template: template('<td><a expr162="expr162"> </a></td><td expr163="expr163"> </td><td expr164="expr164"> </td><td expr165="expr165"> </td><td><title-progress expr166="expr166" max="100" style="margin: auto"></title-progress></td>', [{
|
||||
redundantAttribute: 'expr162',
|
||||
selector: '[expr162]',
|
||||
expressions: [{
|
||||
type: expressionTypes.TEXT,
|
||||
childNodeIndex: 0,
|
||||
@@ -143,24 +169,24 @@ var school = {
|
||||
evaluate: _scope => () => _scope.props.popup(_scope.school)
|
||||
}]
|
||||
}, {
|
||||
redundantAttribute: 'expr687',
|
||||
selector: '[expr687]',
|
||||
redundantAttribute: 'expr163',
|
||||
selector: '[expr163]',
|
||||
expressions: [{
|
||||
type: expressionTypes.TEXT,
|
||||
childNodeIndex: 0,
|
||||
evaluate: _scope => _scope.school.fields.ville_etab
|
||||
}]
|
||||
}, {
|
||||
redundantAttribute: 'expr688',
|
||||
selector: '[expr688]',
|
||||
redundantAttribute: 'expr164',
|
||||
selector: '[expr164]',
|
||||
expressions: [{
|
||||
type: expressionTypes.TEXT,
|
||||
childNodeIndex: 0,
|
||||
evaluate: _scope => _scope.school.fields.dep
|
||||
}]
|
||||
}, {
|
||||
redundantAttribute: 'expr689',
|
||||
selector: '[expr689]',
|
||||
redundantAttribute: 'expr165',
|
||||
selector: '[expr165]',
|
||||
expressions: [{
|
||||
type: expressionTypes.TEXT,
|
||||
childNodeIndex: 0,
|
||||
@@ -176,11 +202,11 @@ var school = {
|
||||
name: 'value',
|
||||
evaluate: _scope => _scope.school.fields.taux_acces_ens
|
||||
}],
|
||||
redundantAttribute: 'expr690',
|
||||
selector: '[expr690]'
|
||||
redundantAttribute: 'expr166',
|
||||
selector: '[expr166]'
|
||||
}]),
|
||||
redundantAttribute: 'expr685',
|
||||
selector: '[expr685]',
|
||||
redundantAttribute: 'expr161',
|
||||
selector: '[expr161]',
|
||||
itemName: 'school',
|
||||
indexName: null,
|
||||
evaluate: _scope => _scope.state.filteredSchoolList
|
||||
|
@@ -150,9 +150,9 @@ var search = {
|
||||
this.updateList();
|
||||
}
|
||||
},
|
||||
template: (template, expressionTypes, bindingTypes, getComponent) => template('<div class="box p-1 m-2"><div class="columns m-1"><input expr31="expr31" class="input" type="input"/><button expr32="expr32" class="button ml-1"><</button></div><div id="list-formations"><ul><li expr33="expr33" class="m-1"></li></ul></div></div>', [{
|
||||
redundantAttribute: 'expr31',
|
||||
selector: '[expr31]',
|
||||
template: (template, expressionTypes, bindingTypes, getComponent) => template('<div class="box p-1 m-2"><div class="columns m-1"><input expr28="expr28" class="input" type="input"/><button expr29="expr29" class="button ml-1"><</button></div><div id="list-formations"><ul><li expr30="expr30" class="m-1"></li></ul></div></div>', [{
|
||||
redundantAttribute: 'expr28',
|
||||
selector: '[expr28]',
|
||||
expressions: [{
|
||||
type: expressionTypes.EVENT,
|
||||
name: 'onkeyup',
|
||||
@@ -163,8 +163,8 @@ var search = {
|
||||
evaluate: _scope => _scope.state.placeholder
|
||||
}]
|
||||
}, {
|
||||
redundantAttribute: 'expr32',
|
||||
selector: '[expr32]',
|
||||
redundantAttribute: 'expr29',
|
||||
selector: '[expr29]',
|
||||
expressions: [{
|
||||
type: expressionTypes.ATTRIBUTE,
|
||||
name: 'disabled',
|
||||
@@ -178,9 +178,9 @@ var search = {
|
||||
type: bindingTypes.EACH,
|
||||
getKey: null,
|
||||
condition: null,
|
||||
template: template('<button expr34="expr34" class="button is-fullwidth p-2" style="white-space: unset"><div style="display: flex; width: 100%"><span class="mt-auto mb-auto" style="font-size: 0.75em; text-align: left; "><strong expr35="expr35"> </strong></span><div style="margin-left: auto;"></div><span expr36="expr36" class="tag is-primary mt-auto mb-auto"> </span></div></button>', [{
|
||||
redundantAttribute: 'expr34',
|
||||
selector: '[expr34]',
|
||||
template: template('<button expr31="expr31" class="button is-fullwidth p-2" style="white-space: unset"><div style="display: flex; width: 100%"><span class="mt-auto mb-auto" style="font-size: 0.75em; text-align: left; "><strong expr32="expr32"> </strong></span><div style="margin-left: auto;"></div><span expr33="expr33" class="tag is-primary mt-auto mb-auto"> </span></div></button>', [{
|
||||
redundantAttribute: 'expr31',
|
||||
selector: '[expr31]',
|
||||
expressions: [{
|
||||
type: expressionTypes.ATTRIBUTE,
|
||||
name: 'disabled',
|
||||
@@ -191,24 +191,24 @@ var search = {
|
||||
evaluate: _scope => () => _scope.cruiseForward(_scope.item.name)
|
||||
}]
|
||||
}, {
|
||||
redundantAttribute: 'expr35',
|
||||
selector: '[expr35]',
|
||||
redundantAttribute: 'expr32',
|
||||
selector: '[expr32]',
|
||||
expressions: [{
|
||||
type: expressionTypes.TEXT,
|
||||
childNodeIndex: 0,
|
||||
evaluate: _scope => _scope.item.name
|
||||
}]
|
||||
}, {
|
||||
redundantAttribute: 'expr36',
|
||||
selector: '[expr36]',
|
||||
redundantAttribute: 'expr33',
|
||||
selector: '[expr33]',
|
||||
expressions: [{
|
||||
type: expressionTypes.TEXT,
|
||||
childNodeIndex: 0,
|
||||
evaluate: _scope => _scope.item.count
|
||||
}]
|
||||
}]),
|
||||
redundantAttribute: 'expr33',
|
||||
selector: '[expr33]',
|
||||
redundantAttribute: 'expr30',
|
||||
selector: '[expr30]',
|
||||
itemName: 'item',
|
||||
indexName: null,
|
||||
evaluate: _scope => _scope.state.items
|
||||
|
@@ -25,11 +25,11 @@ var titleProgress = {
|
||||
state.class = this.computeClasses();
|
||||
}
|
||||
},
|
||||
template: (template, expressionTypes, bindingTypes, getComponent) => template('<div style="display: flex;"><span expr664="expr664"></span><span expr665="expr665" class="ml-1"> </span><progress expr666="expr666" style="box-shadow: 0 0.5em 1em -0.125em rgb(10 10 10 / 10%), 0 0 0 1px rgb(10 10 10 / 2%);"></progress></div>', [{
|
||||
template: (template, expressionTypes, bindingTypes, getComponent) => template('<div style="display: flex;"><span expr44="expr44"></span><span expr45="expr45" class="ml-1"> </span><progress expr46="expr46" style="box-shadow: 0 0.5em 1em -0.125em rgb(10 10 10 / 10%), 0 0 0 1px rgb(10 10 10 / 2%);"></progress></div>', [{
|
||||
type: bindingTypes.IF,
|
||||
evaluate: _scope => _scope.props.title,
|
||||
redundantAttribute: 'expr664',
|
||||
selector: '[expr664]',
|
||||
redundantAttribute: 'expr44',
|
||||
selector: '[expr44]',
|
||||
template: template(' ', [{
|
||||
expressions: [{
|
||||
type: expressionTypes.TEXT,
|
||||
@@ -38,16 +38,16 @@ var titleProgress = {
|
||||
}]
|
||||
}])
|
||||
}, {
|
||||
redundantAttribute: 'expr665',
|
||||
selector: '[expr665]',
|
||||
redundantAttribute: 'expr45',
|
||||
selector: '[expr45]',
|
||||
expressions: [{
|
||||
type: expressionTypes.TEXT,
|
||||
childNodeIndex: 0,
|
||||
evaluate: _scope => _scope.calcPct()
|
||||
}]
|
||||
}, {
|
||||
redundantAttribute: 'expr666',
|
||||
selector: '[expr666]',
|
||||
redundantAttribute: 'expr46',
|
||||
selector: '[expr46]',
|
||||
expressions: [{
|
||||
type: expressionTypes.ATTRIBUTE,
|
||||
name: 'value',
|
||||
|
Reference in New Issue
Block a user