Commit final

This commit is contained in:
HORVILLE 2023-03-31 17:39:07 +02:00
parent 16ccb50e11
commit c91b652b16
9 changed files with 130 additions and 135 deletions

View File

@ -80,13 +80,11 @@
school: school, school: school,
popupEnabled: true popupEnabled: true
}) })
console.log("popup!")
}, },
closePopup(){ closePopup(){
this.update({ this.update({
popupEnabled: false popupEnabled: false
}) })
console.log("closed!")
} }
} }
</script> </script>

View File

@ -22,9 +22,9 @@
</ul> </ul>
<p>Admis hors académie : {100-props.school.fields.pct_aca_orig}%</p> <p>Admis hors académie : {100-props.school.fields.pct_aca_orig}%</p>
</div> </div>
<div class="column"> <!--<div class="column">
<p>Vitesse de remplissage :</p> <p>Vitesse de remplissage :</p>
</div> </div>-->
</div> </div>
<div class="m-4"> <div class="m-4">
<line-graph title="Répartition par genre" data={state.genreStats} style="height: 6rem;"></line-graph> <line-graph title="Répartition par genre" data={state.genreStats} style="height: 6rem;"></line-graph>

View File

@ -110,8 +110,9 @@
L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', { L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {
maxZoom: 19, maxZoom: 19,
attribution: '&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>' attribution: '&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'
}).addTo(state.map); }).addTo(state.map)
} else (state.map) {
} else if (props.shouldShowInfos) {
state.markers.clearLayers() state.markers.clearLayers()
for (let school of state.filteredSchoolList) { for (let school of state.filteredSchoolList) {
let fields = school.fields let fields = school.fields

File diff suppressed because one or more lines are too long

View File

@ -102,16 +102,14 @@ var mainController = {
school: school, school: school,
popupEnabled: true popupEnabled: true
}); });
console.log("popup!");
}, },
closePopup() { closePopup() {
this.update({ this.update({
popupEnabled: false 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 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>', [{ 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 expr40="expr40"></search><button expr41="expr41" class="button is-danger ml-2 is-outlined">Vider le cache</button></div><div class="column pl-0"><fili-info expr42="expr42"></fili-info><school expr43="expr43"></school></div></div><school-info expr44="expr44"></school-info>', [{
type: bindingTypes.TAG, type: bindingTypes.TAG,
getComponent: getComponent, getComponent: getComponent,
evaluate: _scope => 'search', evaluate: _scope => 'search',
@ -121,11 +119,11 @@ var mainController = {
name: 'updateCourse', name: 'updateCourse',
evaluate: _scope => _scope.updateCourse evaluate: _scope => _scope.updateCourse
}], }],
redundantAttribute: 'expr2165', redundantAttribute: 'expr40',
selector: '[expr2165]' selector: '[expr40]'
}, { }, {
redundantAttribute: 'expr2166', redundantAttribute: 'expr41',
selector: '[expr2166]', selector: '[expr41]',
expressions: [{ expressions: [{
type: expressionTypes.EVENT, type: expressionTypes.EVENT,
name: 'onclick', name: 'onclick',
@ -149,8 +147,8 @@ var mainController = {
name: 'shouldShowInfos', name: 'shouldShowInfos',
evaluate: _scope => _scope.state.shouldShowInfos evaluate: _scope => _scope.state.shouldShowInfos
}], }],
redundantAttribute: 'expr2167', redundantAttribute: 'expr42',
selector: '[expr2167]' selector: '[expr42]'
}, { }, {
type: bindingTypes.TAG, type: bindingTypes.TAG,
getComponent: getComponent, getComponent: getComponent,
@ -177,8 +175,8 @@ var mainController = {
name: 'shouldShowInfos', name: 'shouldShowInfos',
evaluate: _scope => _scope.state.shouldShowInfos evaluate: _scope => _scope.state.shouldShowInfos
}], }],
redundantAttribute: 'expr2168', redundantAttribute: 'expr43',
selector: '[expr2168]' selector: '[expr43]'
}, { }, {
type: bindingTypes.TAG, type: bindingTypes.TAG,
getComponent: getComponent, getComponent: getComponent,
@ -197,8 +195,8 @@ var mainController = {
name: 'school', name: 'school',
evaluate: _scope => _scope.state.school evaluate: _scope => _scope.state.school
}], }],
redundantAttribute: 'expr2169', redundantAttribute: 'expr44',
selector: '[expr2169]' selector: '[expr44]'
}]), }]),
name: 'main-controller' name: 'main-controller'
}; };

File diff suppressed because one or more lines are too long

View File

@ -69,7 +69,16 @@ var school = {
state.filteredSchoolList = [...state.schoolList]; state.filteredSchoolList = [...state.schoolList];
if (this.$("input")) this.$("input").value = ""; if (this.$("input")) this.$("input").value = "";
} }
if (state.map) { },
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: '&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'
}).addTo(state.map);
} else if (props.shouldShowInfos) {
state.markers.clearLayers(); state.markers.clearLayers();
for (let school of state.filteredSchoolList) { for (let school of state.filteredSchoolList) {
let fields = school.fields; let fields = school.fields;
@ -78,7 +87,6 @@ var school = {
let title = document.createElement("span"); let title = document.createElement("span");
title.textContent = fields.g_ea_lib_vx; title.textContent = fields.g_ea_lib_vx;
title.class = "is-primary"; title.class = "is-primary";
console.log(props);
let linkToForma = document.createElement("a"); let linkToForma = document.createElement("a");
linkToForma.onclick = () => props.popup(school); linkToForma.onclick = () => props.popup(school);
linkToForma.textContent = "Voir les infos de l'établissement"; linkToForma.textContent = "Voir les infos de l'établissement";
@ -92,16 +100,6 @@ var school = {
state.map.addLayer(state.markers); 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: '&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'
}).addTo(state.map);
}
},
onBeforeMount(props, state) { onBeforeMount(props, state) {
this.state = { this.state = {
sortBy: null, sortBy: null,
@ -111,14 +109,14 @@ var school = {
}, },
sortFields: SORT_TABLE sortFields: SORT_TABLE
}, },
template: (template, expressionTypes, bindingTypes, getComponent) => template('<div expr157="expr157" class="box p-2 m-2" disabled></div>', [{ template: (template, expressionTypes, bindingTypes, getComponent) => template('<div expr51="expr51" class="box p-2 m-2" disabled></div>', [{
type: bindingTypes.IF, type: bindingTypes.IF,
evaluate: _scope => _scope.props.shouldShowInfos, evaluate: _scope => _scope.props.shouldShowInfos,
redundantAttribute: 'expr157', redundantAttribute: 'expr51',
selector: '[expr157]', selector: '[expr51]',
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>', [{ 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 expr52="expr52" 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 expr53="expr53"></th></tr></thead><tbody><tr expr55="expr55"></tr></tbody></table>', [{
redundantAttribute: 'expr158', redundantAttribute: 'expr52',
selector: '[expr158]', selector: '[expr52]',
expressions: [{ expressions: [{
type: expressionTypes.EVENT, type: expressionTypes.EVENT,
name: 'onkeyup', name: 'onkeyup',
@ -128,15 +126,15 @@ var school = {
type: bindingTypes.EACH, type: bindingTypes.EACH,
getKey: null, getKey: null,
condition: null, condition: null,
template: template(' <a expr160="expr160"><span class="icon"><i class="fas fa-sort"></i></span></a>', [{ template: template(' <a expr54="expr54"><span class="icon"><i class="fas fa-sort"></i></span></a>', [{
expressions: [{ expressions: [{
type: expressionTypes.TEXT, type: expressionTypes.TEXT,
childNodeIndex: 0, childNodeIndex: 0,
evaluate: _scope => [_scope.sortField.name].join('') evaluate: _scope => [_scope.sortField.name].join('')
}] }]
}, { }, {
redundantAttribute: 'expr160', redundantAttribute: 'expr54',
selector: '[expr160]', selector: '[expr54]',
expressions: [{ expressions: [{
type: expressionTypes.ATTRIBUTE, type: expressionTypes.ATTRIBUTE,
name: 'id', name: 'id',
@ -147,8 +145,8 @@ var school = {
evaluate: _scope => () => _scope.sortList(_scope.sortField.id, true) evaluate: _scope => () => _scope.sortList(_scope.sortField.id, true)
}] }]
}]), }]),
redundantAttribute: 'expr159', redundantAttribute: 'expr53',
selector: '[expr159]', selector: '[expr53]',
itemName: 'sortField', itemName: 'sortField',
indexName: null, indexName: null,
evaluate: _scope => _scope.sortFields evaluate: _scope => _scope.sortFields
@ -156,9 +154,9 @@ var school = {
type: bindingTypes.EACH, type: bindingTypes.EACH,
getKey: null, getKey: null,
condition: null, condition: null,
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>', [{ template: template('<td><a expr56="expr56"> </a></td><td expr57="expr57"> </td><td expr58="expr58"> </td><td expr59="expr59"> </td><td><title-progress expr60="expr60" max="100" style="margin: auto"></title-progress></td>', [{
redundantAttribute: 'expr162', redundantAttribute: 'expr56',
selector: '[expr162]', selector: '[expr56]',
expressions: [{ expressions: [{
type: expressionTypes.TEXT, type: expressionTypes.TEXT,
childNodeIndex: 0, childNodeIndex: 0,
@ -169,24 +167,24 @@ var school = {
evaluate: _scope => () => _scope.props.popup(_scope.school) evaluate: _scope => () => _scope.props.popup(_scope.school)
}] }]
}, { }, {
redundantAttribute: 'expr163', redundantAttribute: 'expr57',
selector: '[expr163]', selector: '[expr57]',
expressions: [{ expressions: [{
type: expressionTypes.TEXT, type: expressionTypes.TEXT,
childNodeIndex: 0, childNodeIndex: 0,
evaluate: _scope => _scope.school.fields.ville_etab evaluate: _scope => _scope.school.fields.ville_etab
}] }]
}, { }, {
redundantAttribute: 'expr164', redundantAttribute: 'expr58',
selector: '[expr164]', selector: '[expr58]',
expressions: [{ expressions: [{
type: expressionTypes.TEXT, type: expressionTypes.TEXT,
childNodeIndex: 0, childNodeIndex: 0,
evaluate: _scope => _scope.school.fields.dep evaluate: _scope => _scope.school.fields.dep
}] }]
}, { }, {
redundantAttribute: 'expr165', redundantAttribute: 'expr59',
selector: '[expr165]', selector: '[expr59]',
expressions: [{ expressions: [{
type: expressionTypes.TEXT, type: expressionTypes.TEXT,
childNodeIndex: 0, childNodeIndex: 0,
@ -202,11 +200,11 @@ var school = {
name: 'value', name: 'value',
evaluate: _scope => _scope.school.fields.taux_acces_ens evaluate: _scope => _scope.school.fields.taux_acces_ens
}], }],
redundantAttribute: 'expr166', redundantAttribute: 'expr60',
selector: '[expr166]' selector: '[expr60]'
}]), }]),
redundantAttribute: 'expr161', redundantAttribute: 'expr55',
selector: '[expr161]', selector: '[expr55]',
itemName: 'school', itemName: 'school',
indexName: null, indexName: null,
evaluate: _scope => _scope.state.filteredSchoolList evaluate: _scope => _scope.state.filteredSchoolList

View File

@ -150,9 +150,9 @@ var search = {
this.updateList(); this.updateList();
} }
}, },
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">&lt;</button></div><div id="list-formations"><ul><li expr30="expr30" class="m-1"></li></ul></div></div>', [{ template: (template, expressionTypes, bindingTypes, getComponent) => template('<div class="box p-1 m-2"><div class="columns m-1"><input expr45="expr45" class="input" type="input"/><button expr46="expr46" class="button ml-1">&lt;</button></div><div id="list-formations"><ul><li expr47="expr47" class="m-1"></li></ul></div></div>', [{
redundantAttribute: 'expr28', redundantAttribute: 'expr45',
selector: '[expr28]', selector: '[expr45]',
expressions: [{ expressions: [{
type: expressionTypes.EVENT, type: expressionTypes.EVENT,
name: 'onkeyup', name: 'onkeyup',
@ -163,8 +163,8 @@ var search = {
evaluate: _scope => _scope.state.placeholder evaluate: _scope => _scope.state.placeholder
}] }]
}, { }, {
redundantAttribute: 'expr29', redundantAttribute: 'expr46',
selector: '[expr29]', selector: '[expr46]',
expressions: [{ expressions: [{
type: expressionTypes.ATTRIBUTE, type: expressionTypes.ATTRIBUTE,
name: 'disabled', name: 'disabled',
@ -178,9 +178,9 @@ var search = {
type: bindingTypes.EACH, type: bindingTypes.EACH,
getKey: null, getKey: null,
condition: null, condition: null,
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>', [{ template: template('<button expr48="expr48" 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 expr49="expr49"> </strong></span><div style="margin-left: auto;"></div><span expr50="expr50" class="tag is-primary mt-auto mb-auto"> </span></div></button>', [{
redundantAttribute: 'expr31', redundantAttribute: 'expr48',
selector: '[expr31]', selector: '[expr48]',
expressions: [{ expressions: [{
type: expressionTypes.ATTRIBUTE, type: expressionTypes.ATTRIBUTE,
name: 'disabled', name: 'disabled',
@ -191,24 +191,24 @@ var search = {
evaluate: _scope => () => _scope.cruiseForward(_scope.item.name) evaluate: _scope => () => _scope.cruiseForward(_scope.item.name)
}] }]
}, { }, {
redundantAttribute: 'expr32', redundantAttribute: 'expr49',
selector: '[expr32]', selector: '[expr49]',
expressions: [{ expressions: [{
type: expressionTypes.TEXT, type: expressionTypes.TEXT,
childNodeIndex: 0, childNodeIndex: 0,
evaluate: _scope => _scope.item.name evaluate: _scope => _scope.item.name
}] }]
}, { }, {
redundantAttribute: 'expr33', redundantAttribute: 'expr50',
selector: '[expr33]', selector: '[expr50]',
expressions: [{ expressions: [{
type: expressionTypes.TEXT, type: expressionTypes.TEXT,
childNodeIndex: 0, childNodeIndex: 0,
evaluate: _scope => _scope.item.count evaluate: _scope => _scope.item.count
}] }]
}]), }]),
redundantAttribute: 'expr30', redundantAttribute: 'expr47',
selector: '[expr30]', selector: '[expr47]',
itemName: 'item', itemName: 'item',
indexName: null, indexName: null,
evaluate: _scope => _scope.state.items evaluate: _scope => _scope.state.items

View File

@ -1,5 +1,5 @@
const DEFAULT_CLASSES = "progress is-small m-2 mt-auto mb-auto"; const DEFAULT_CLASSES = "progress is-small m-2 mt-auto mb-auto";
const COLOR_CLASSES = ["is-danger", "is-warning", "is-success", "is-info", "is-link"]; const COLOR_CLASSES = ["is-link", "is-info", "is-success", "is-warning", "is-danger"];
var titleProgress = { var titleProgress = {
css: null, css: null,
exports: { exports: {
@ -25,11 +25,11 @@ var titleProgress = {
state.class = this.computeClasses(); state.class = this.computeClasses();
} }
}, },
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>', [{ template: (template, expressionTypes, bindingTypes, getComponent) => template('<div style="display: flex;"><span expr11="expr11"></span><span expr12="expr12" class="ml-1"> </span><progress expr13="expr13" 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, type: bindingTypes.IF,
evaluate: _scope => _scope.props.title, evaluate: _scope => _scope.props.title,
redundantAttribute: 'expr44', redundantAttribute: 'expr11',
selector: '[expr44]', selector: '[expr11]',
template: template(' ', [{ template: template(' ', [{
expressions: [{ expressions: [{
type: expressionTypes.TEXT, type: expressionTypes.TEXT,
@ -38,16 +38,16 @@ var titleProgress = {
}] }]
}]) }])
}, { }, {
redundantAttribute: 'expr45', redundantAttribute: 'expr12',
selector: '[expr45]', selector: '[expr12]',
expressions: [{ expressions: [{
type: expressionTypes.TEXT, type: expressionTypes.TEXT,
childNodeIndex: 0, childNodeIndex: 0,
evaluate: _scope => _scope.calcPct() evaluate: _scope => _scope.calcPct()
}] }]
}, { }, {
redundantAttribute: 'expr46', redundantAttribute: 'expr13',
selector: '[expr46]', selector: '[expr13]',
expressions: [{ expressions: [{
type: expressionTypes.ATTRIBUTE, type: expressionTypes.ATTRIBUTE,
name: 'value', name: 'value',