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,
popupEnabled: true
})
console.log("popup!")
},
closePopup(){
this.update({
popupEnabled: false
})
console.log("closed!")
}
}
</script>

View File

@ -22,9 +22,9 @@
</ul>
<p>Admis hors académie : {100-props.school.fields.pct_aca_orig}%</p>
</div>
<div class="column">
<!--<div class="column">
<p>Vitesse de remplissage :</p>
</div>
</div>-->
</div>
<div class="m-4">
<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', {
maxZoom: 19,
attribution: '&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'
}).addTo(state.map);
} else (state.map) {
}).addTo(state.map)
} else if (props.shouldShowInfos) {
state.markers.clearLayers()
for (let school of state.filteredSchoolList) {
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,
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 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,
getComponent: getComponent,
evaluate: _scope => 'search',
@ -121,11 +119,11 @@ var mainController = {
name: 'updateCourse',
evaluate: _scope => _scope.updateCourse
}],
redundantAttribute: 'expr2165',
selector: '[expr2165]'
redundantAttribute: 'expr40',
selector: '[expr40]'
}, {
redundantAttribute: 'expr2166',
selector: '[expr2166]',
redundantAttribute: 'expr41',
selector: '[expr41]',
expressions: [{
type: expressionTypes.EVENT,
name: 'onclick',
@ -149,8 +147,8 @@ var mainController = {
name: 'shouldShowInfos',
evaluate: _scope => _scope.state.shouldShowInfos
}],
redundantAttribute: 'expr2167',
selector: '[expr2167]'
redundantAttribute: 'expr42',
selector: '[expr42]'
}, {
type: bindingTypes.TAG,
getComponent: getComponent,
@ -177,8 +175,8 @@ var mainController = {
name: 'shouldShowInfos',
evaluate: _scope => _scope.state.shouldShowInfos
}],
redundantAttribute: 'expr2168',
selector: '[expr2168]'
redundantAttribute: 'expr43',
selector: '[expr43]'
}, {
type: bindingTypes.TAG,
getComponent: getComponent,
@ -197,8 +195,8 @@ var mainController = {
name: 'school',
evaluate: _scope => _scope.state.school
}],
redundantAttribute: 'expr2169',
selector: '[expr2169]'
redundantAttribute: 'expr44',
selector: '[expr44]'
}]),
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];
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();
for (let school of state.filteredSchoolList) {
let fields = school.fields;
@ -78,7 +87,6 @@ var school = {
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";
@ -92,16 +100,6 @@ var school = {
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) {
this.state = {
sortBy: null,
@ -111,14 +109,14 @@ var school = {
},
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,
evaluate: _scope => _scope.props.shouldShowInfos,
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]',
redundantAttribute: 'expr51',
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 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: 'expr52',
selector: '[expr52]',
expressions: [{
type: expressionTypes.EVENT,
name: 'onkeyup',
@ -128,15 +126,15 @@ var school = {
type: bindingTypes.EACH,
getKey: 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: [{
type: expressionTypes.TEXT,
childNodeIndex: 0,
evaluate: _scope => [_scope.sortField.name].join('')
}]
}, {
redundantAttribute: 'expr160',
selector: '[expr160]',
redundantAttribute: 'expr54',
selector: '[expr54]',
expressions: [{
type: expressionTypes.ATTRIBUTE,
name: 'id',
@ -147,8 +145,8 @@ var school = {
evaluate: _scope => () => _scope.sortList(_scope.sortField.id, true)
}]
}]),
redundantAttribute: 'expr159',
selector: '[expr159]',
redundantAttribute: 'expr53',
selector: '[expr53]',
itemName: 'sortField',
indexName: null,
evaluate: _scope => _scope.sortFields
@ -156,9 +154,9 @@ var school = {
type: bindingTypes.EACH,
getKey: 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>', [{
redundantAttribute: 'expr162',
selector: '[expr162]',
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: 'expr56',
selector: '[expr56]',
expressions: [{
type: expressionTypes.TEXT,
childNodeIndex: 0,
@ -169,24 +167,24 @@ var school = {
evaluate: _scope => () => _scope.props.popup(_scope.school)
}]
}, {
redundantAttribute: 'expr163',
selector: '[expr163]',
redundantAttribute: 'expr57',
selector: '[expr57]',
expressions: [{
type: expressionTypes.TEXT,
childNodeIndex: 0,
evaluate: _scope => _scope.school.fields.ville_etab
}]
}, {
redundantAttribute: 'expr164',
selector: '[expr164]',
redundantAttribute: 'expr58',
selector: '[expr58]',
expressions: [{
type: expressionTypes.TEXT,
childNodeIndex: 0,
evaluate: _scope => _scope.school.fields.dep
}]
}, {
redundantAttribute: 'expr165',
selector: '[expr165]',
redundantAttribute: 'expr59',
selector: '[expr59]',
expressions: [{
type: expressionTypes.TEXT,
childNodeIndex: 0,
@ -202,11 +200,11 @@ var school = {
name: 'value',
evaluate: _scope => _scope.school.fields.taux_acces_ens
}],
redundantAttribute: 'expr166',
selector: '[expr166]'
redundantAttribute: 'expr60',
selector: '[expr60]'
}]),
redundantAttribute: 'expr161',
selector: '[expr161]',
redundantAttribute: 'expr55',
selector: '[expr55]',
itemName: 'school',
indexName: null,
evaluate: _scope => _scope.state.filteredSchoolList

View File

@ -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 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>', [{
redundantAttribute: 'expr28',
selector: '[expr28]',
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: 'expr45',
selector: '[expr45]',
expressions: [{
type: expressionTypes.EVENT,
name: 'onkeyup',
@ -163,8 +163,8 @@ var search = {
evaluate: _scope => _scope.state.placeholder
}]
}, {
redundantAttribute: 'expr29',
selector: '[expr29]',
redundantAttribute: 'expr46',
selector: '[expr46]',
expressions: [{
type: expressionTypes.ATTRIBUTE,
name: 'disabled',
@ -178,9 +178,9 @@ var search = {
type: bindingTypes.EACH,
getKey: 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>', [{
redundantAttribute: 'expr31',
selector: '[expr31]',
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: 'expr48',
selector: '[expr48]',
expressions: [{
type: expressionTypes.ATTRIBUTE,
name: 'disabled',
@ -191,24 +191,24 @@ var search = {
evaluate: _scope => () => _scope.cruiseForward(_scope.item.name)
}]
}, {
redundantAttribute: 'expr32',
selector: '[expr32]',
redundantAttribute: 'expr49',
selector: '[expr49]',
expressions: [{
type: expressionTypes.TEXT,
childNodeIndex: 0,
evaluate: _scope => _scope.item.name
}]
}, {
redundantAttribute: 'expr33',
selector: '[expr33]',
redundantAttribute: 'expr50',
selector: '[expr50]',
expressions: [{
type: expressionTypes.TEXT,
childNodeIndex: 0,
evaluate: _scope => _scope.item.count
}]
}]),
redundantAttribute: 'expr30',
selector: '[expr30]',
redundantAttribute: 'expr47',
selector: '[expr47]',
itemName: 'item',
indexName: null,
evaluate: _scope => _scope.state.items

View File

@ -1,5 +1,5 @@
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 = {
css: null,
exports: {
@ -25,11 +25,11 @@ var titleProgress = {
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,
evaluate: _scope => _scope.props.title,
redundantAttribute: 'expr44',
selector: '[expr44]',
redundantAttribute: 'expr11',
selector: '[expr11]',
template: template(' ', [{
expressions: [{
type: expressionTypes.TEXT,
@ -38,16 +38,16 @@ var titleProgress = {
}]
}])
}, {
redundantAttribute: 'expr45',
selector: '[expr45]',
redundantAttribute: 'expr12',
selector: '[expr12]',
expressions: [{
type: expressionTypes.TEXT,
childNodeIndex: 0,
evaluate: _scope => _scope.calcPct()
}]
}, {
redundantAttribute: 'expr46',
selector: '[expr46]',
redundantAttribute: 'expr13',
selector: '[expr13]',
expressions: [{
type: expressionTypes.ATTRIBUTE,
name: 'value',