diff --git a/components/main-controller.riot b/components/main-controller.riot
index ee6ad4d..06b57fe 100644
--- a/components/main-controller.riot
+++ b/components/main-controller.riot
@@ -2,14 +2,14 @@
-
+
diff --git a/index.html b/index.html
index a8dc4db..a3d1a95 100644
--- a/index.html
+++ b/index.html
@@ -3,9 +3,10 @@
Parcourplus | Accueil
-
+
-
+
+
diff --git a/javascript/fili-info.js b/javascript/fili-info.js
index d39cffe..9943a22 100644
--- a/javascript/fili-info.js
+++ b/javascript/fili-info.js
@@ -76,54 +76,54 @@ var filiInfo = {
}];
}
},
- template: (template, expressionTypes, bindingTypes, getComponent) => template('
', [{
+ template: (template, expressionTypes, bindingTypes, getComponent) => template('
', [{
type: bindingTypes.IF,
evaluate: _scope => _scope.props.shouldShowInfos,
- redundantAttribute: 'expr0',
- selector: '[expr0]',
- template: template('
/ \r\n / \r\n
Moyenne des admis
Nombre de formations
Capacité
', [{
- redundantAttribute: 'expr1',
- selector: '[expr1]',
+ redundantAttribute: 'expr26',
+ selector: '[expr26]',
+ template: template('
/ \n / \n
Moyenne des admis
Nombre de formations
Capacité
', [{
+ redundantAttribute: 'expr27',
+ selector: '[expr27]',
expressions: [{
type: expressionTypes.TEXT,
childNodeIndex: 0,
evaluate: _scope => _scope.props.course.fili
}]
}, {
- redundantAttribute: 'expr2',
- selector: '[expr2]',
+ redundantAttribute: 'expr28',
+ selector: '[expr28]',
expressions: [{
type: expressionTypes.TEXT,
childNodeIndex: 0,
evaluate: _scope => _scope.props.course.sousfili
}]
}, {
- redundantAttribute: 'expr3',
- selector: '[expr3]',
+ redundantAttribute: 'expr29',
+ selector: '[expr29]',
expressions: [{
type: expressionTypes.TEXT,
childNodeIndex: 0,
evaluate: _scope => _scope.props.course.soussousfili
}]
}, {
- redundantAttribute: 'expr4',
- selector: '[expr4]',
+ redundantAttribute: 'expr30',
+ selector: '[expr30]',
expressions: [{
type: expressionTypes.TEXT,
childNodeIndex: 0,
evaluate: _scope => _scope.state.average
}]
}, {
- redundantAttribute: 'expr5',
- selector: '[expr5]',
+ redundantAttribute: 'expr31',
+ selector: '[expr31]',
expressions: [{
type: expressionTypes.TEXT,
childNodeIndex: 0,
evaluate: _scope => _scope.state.courseNumber
}]
}, {
- redundantAttribute: 'expr6',
- selector: '[expr6]',
+ redundantAttribute: 'expr32',
+ selector: '[expr32]',
expressions: [{
type: expressionTypes.TEXT,
childNodeIndex: 0,
@@ -143,8 +143,8 @@ var filiInfo = {
name: 'value',
evaluate: _scope => _scope.state.selectivity
}],
- redundantAttribute: 'expr7',
- selector: '[expr7]'
+ redundantAttribute: 'expr33',
+ selector: '[expr33]'
}, {
type: bindingTypes.TAG,
getComponent: getComponent,
@@ -155,8 +155,8 @@ var filiInfo = {
name: 'data',
evaluate: _scope => _scope.state.genreStats
}],
- redundantAttribute: 'expr8',
- selector: '[expr8]'
+ redundantAttribute: 'expr34',
+ selector: '[expr34]'
}, {
type: bindingTypes.TAG,
getComponent: getComponent,
@@ -167,8 +167,8 @@ var filiInfo = {
name: 'data',
evaluate: _scope => _scope.state.bacStats
}],
- redundantAttribute: 'expr9',
- selector: '[expr9]'
+ redundantAttribute: 'expr35',
+ selector: '[expr35]'
}, {
type: bindingTypes.TAG,
getComponent: getComponent,
@@ -179,8 +179,8 @@ var filiInfo = {
name: 'data',
evaluate: _scope => _scope.state.mentionStats
}],
- redundantAttribute: 'expr10',
- selector: '[expr10]'
+ redundantAttribute: 'expr36',
+ selector: '[expr36]'
}])
}]),
name: 'fili-info'
diff --git a/javascript/main-controller.js b/javascript/main-controller.js
index 467fcc4..b1c9864 100644
--- a/javascript/main-controller.js
+++ b/javascript/main-controller.js
@@ -63,7 +63,7 @@ var mainController = {
sortList(sortBy) {
//Si la liste est déjà triée par la bonne catégorie, on l'inverse
if (sortBy == this.state.sortBy) {
- this.state.schoolList.reverse();
+ this.state.filteredSchoolList.reverse();
}
//Sinon on l'ordonne par la nouvelle catégorie (ascendant par défaut)
else {
@@ -72,23 +72,21 @@ var mainController = {
case SORT_TABLE[3].id:
case SORT_TABLE[4].id:
{
- this.state.schoolList.sort((a, b) => {
+ this.state.filteredSchoolList.sort((a, b) => {
if (a.fields[sortBy] > b.fields[sortBy]) return 1;else return -1;
});
break;
}
default:
{
- this.state.schoolList.sort((a, b) => {
+ this.state.filteredSchoolList.sort((a, b) => {
return a.fields[sortBy].localeCompare(b.fields[sortBy]);
});
break;
}
}
}
- this.update({
- schoolList: this.state.schoolList
- });
+ this.update();
},
updateList(course) {
course = course || this.state.course;
@@ -108,6 +106,7 @@ var mainController = {
this.update({
schoolList: response
});
+ this.filterSearch();
});
},
updateCourse(course) {
@@ -124,11 +123,29 @@ var mainController = {
sortBy: null,
schoolList: null,
sortFields: SORT_TABLE,
+ filteredSchoolList: null,
shouldShowInfos: false
});
+ },
+ filterSearch() {
+ let input = this.$("input");
+ if (!input) return;
+ let finalArray = [];
+
+ //On évite de trier avant d'avoir plus de 1 lettres.
+ if (input.value.length > 1) {
+ finalArray = this.state.schoolList.filter(item => {
+ return item.name.toLowerCase().includes(input.value.toLowerCase());
+ });
+ } else {
+ finalArray = this.state.schoolList;
+ }
+ this.update({
+ filteredSchoolList: finalArray
+ });
}
},
- template: (template, expressionTypes, bindingTypes, getComponent) => template('
', [{
+ template: (template, expressionTypes, bindingTypes, getComponent) => template('
', [{
type: bindingTypes.TAG,
getComponent: getComponent,
evaluate: _scope => 'search',
@@ -138,8 +155,8 @@ var mainController = {
name: 'updateCourse',
evaluate: _scope => _scope.updateCourse
}],
- redundantAttribute: 'expr11',
- selector: '[expr11]'
+ redundantAttribute: 'expr71',
+ selector: '[expr71]'
}, {
type: bindingTypes.TAG,
getComponent: getComponent,
@@ -158,8 +175,8 @@ var mainController = {
name: 'shouldShowInfos',
evaluate: _scope => _scope.state.shouldShowInfos
}],
- redundantAttribute: 'expr12',
- selector: '[expr12]'
+ redundantAttribute: 'expr72',
+ selector: '[expr72]'
}, {
type: bindingTypes.TAG,
getComponent: getComponent,
@@ -172,7 +189,7 @@ var mainController = {
}, {
type: expressionTypes.ATTRIBUTE,
name: 'schoolList',
- evaluate: _scope => _scope.state.schoolList
+ evaluate: _scope => _scope.state.filteredSchoolList
}, {
type: expressionTypes.ATTRIBUTE,
name: 'sortFields',
@@ -186,16 +203,16 @@ var mainController = {
name: 'shouldShowInfos',
evaluate: _scope => _scope.state.shouldShowInfos
}],
- redundantAttribute: 'expr13',
- selector: '[expr13]'
+ redundantAttribute: 'expr73',
+ selector: '[expr73]'
}, {
type: bindingTypes.TAG,
getComponent: getComponent,
evaluate: _scope => 'school-info',
slots: [],
attributes: [],
- redundantAttribute: 'expr14',
- selector: '[expr14]'
+ redundantAttribute: 'expr74',
+ selector: '[expr74]'
}]),
name: 'main-controller'
};
diff --git a/javascript/school-info.js b/javascript/school-info.js
index bb6381d..a0428be 100644
--- a/javascript/school-info.js
+++ b/javascript/school-info.js
@@ -10,14 +10,14 @@ var schoolInfo = {
this.update();
}
},
- template: (template, expressionTypes, bindingTypes, getComponent) => template('
', [{
+ template: (template, expressionTypes, bindingTypes, getComponent) => template('
', [{
type: bindingTypes.IF,
evaluate: _scope => _scope.state.enabled,
- redundantAttribute: 'expr24',
- selector: '[expr24]',
- template: template('
', [{
- redundantAttribute: 'expr25',
- selector: '[expr25]',
+ redundantAttribute: 'expr23',
+ selector: '[expr23]',
+ template: template('
', [{
+ redundantAttribute: 'expr24',
+ selector: '[expr24]',
expressions: [{
type: expressionTypes.EVENT,
name: 'onclick',
@@ -29,8 +29,8 @@ var schoolInfo = {
evaluate: _scope => 'line-graph',
slots: [],
attributes: [],
- redundantAttribute: 'expr26',
- selector: '[expr26]'
+ redundantAttribute: 'expr25',
+ selector: '[expr25]'
}])
}]),
name: 'school-info'
diff --git a/javascript/school.js b/javascript/school.js
index 95479e7..27184c0 100644
--- a/javascript/school.js
+++ b/javascript/school.js
@@ -1,30 +1,38 @@
var school = {
css: null,
exports: null,
- template: (template, expressionTypes, bindingTypes, getComponent) => template('
', [{
+ template: (template, expressionTypes, bindingTypes, getComponent) => template('
', [{
type: bindingTypes.IF,
evaluate: _scope => _scope.props.shouldShowInfos,
- redundantAttribute: 'expr27',
- selector: '[expr27]',
- template: template('
', [{
+ redundantAttribute: 'expr52',
+ selector: '[expr52]',
+ template: template('
', [{
type: bindingTypes.IF,
evaluate: _scope => false,
- redundantAttribute: 'expr28',
- selector: '[expr28]',
+ redundantAttribute: 'expr53',
+ selector: '[expr53]',
template: template(null, [])
+ }, {
+ redundantAttribute: 'expr54',
+ selector: '[expr54]',
+ expressions: [{
+ type: expressionTypes.EVENT,
+ name: 'onkeyup',
+ evaluate: _scope => _scope.props.filterSearch
+ }]
}, {
type: bindingTypes.EACH,
getKey: null,
condition: null,
- template: template('
', [{
+ template: template('
', [{
expressions: [{
type: expressionTypes.TEXT,
childNodeIndex: 0,
evaluate: _scope => [_scope.sortField.name].join('')
}]
}, {
- redundantAttribute: 'expr30',
- selector: '[expr30]',
+ redundantAttribute: 'expr56',
+ selector: '[expr56]',
expressions: [{
type: expressionTypes.ATTRIBUTE,
name: 'id',
@@ -35,8 +43,8 @@ var school = {
evaluate: _scope => () => _scope.props.sortList(_scope.sortField.id)
}]
}]),
- redundantAttribute: 'expr29',
- selector: '[expr29]',
+ redundantAttribute: 'expr55',
+ selector: '[expr55]',
itemName: 'sortField',
indexName: null,
evaluate: _scope => _scope.props.sortFields
@@ -44,33 +52,33 @@ var school = {
type: bindingTypes.EACH,
getKey: null,
condition: null,
- template: template('
| | | | | ', [{
- redundantAttribute: 'expr32',
- selector: '[expr32]',
+ template: template('
| | | | | ', [{
+ redundantAttribute: 'expr58',
+ selector: '[expr58]',
expressions: [{
type: expressionTypes.TEXT,
childNodeIndex: 0,
evaluate: _scope => _scope.school.fields.g_ea_lib_vx
}]
}, {
- redundantAttribute: 'expr33',
- selector: '[expr33]',
+ redundantAttribute: 'expr59',
+ selector: '[expr59]',
expressions: [{
type: expressionTypes.TEXT,
childNodeIndex: 0,
evaluate: _scope => _scope.school.fields.ville_etab
}]
}, {
- redundantAttribute: 'expr34',
- selector: '[expr34]',
+ redundantAttribute: 'expr60',
+ selector: '[expr60]',
expressions: [{
type: expressionTypes.TEXT,
childNodeIndex: 0,
evaluate: _scope => _scope.school.fields.dep
}]
}, {
- redundantAttribute: 'expr35',
- selector: '[expr35]',
+ redundantAttribute: 'expr61',
+ selector: '[expr61]',
expressions: [{
type: expressionTypes.TEXT,
childNodeIndex: 0,
@@ -86,11 +94,11 @@ var school = {
name: 'value',
evaluate: _scope => _scope.school.fields.taux_acces_ens
}],
- redundantAttribute: 'expr36',
- selector: '[expr36]'
+ redundantAttribute: 'expr62',
+ selector: '[expr62]'
}]),
- redundantAttribute: 'expr31',
- selector: '[expr31]',
+ redundantAttribute: 'expr57',
+ selector: '[expr57]',
itemName: 'school',
indexName: null,
evaluate: _scope => _scope.props.schoolList
diff --git a/javascript/search.js b/javascript/search.js
index 3bc1c76..dac6114 100644
--- a/javascript/search.js
+++ b/javascript/search.js
@@ -144,9 +144,9 @@ var search = {
this.updateList();
}
},
- template: (template, expressionTypes, bindingTypes, getComponent) => template('
', [{
- redundantAttribute: 'expr18',
- selector: '[expr18]',
+ template: (template, expressionTypes, bindingTypes, getComponent) => template('
', [{
+ redundantAttribute: 'expr14',
+ selector: '[expr14]',
expressions: [{
type: expressionTypes.EVENT,
name: 'onkeyup',
@@ -157,8 +157,8 @@ var search = {
evaluate: _scope => _scope.state.placeholder
}]
}, {
- redundantAttribute: 'expr19',
- selector: '[expr19]',
+ redundantAttribute: 'expr15',
+ selector: '[expr15]',
expressions: [{
type: expressionTypes.ATTRIBUTE,
name: 'disabled',
@@ -172,9 +172,9 @@ var search = {
type: bindingTypes.EACH,
getKey: null,
condition: null,
- template: template('
', [{
- redundantAttribute: 'expr21',
- selector: '[expr21]',
+ template: template('
', [{
+ redundantAttribute: 'expr17',
+ selector: '[expr17]',
expressions: [{
type: expressionTypes.ATTRIBUTE,
name: 'disabled',
@@ -185,24 +185,24 @@ var search = {
evaluate: _scope => () => _scope.cruiseForward(_scope.item.name)
}]
}, {
- redundantAttribute: 'expr22',
- selector: '[expr22]',
+ redundantAttribute: 'expr18',
+ selector: '[expr18]',
expressions: [{
type: expressionTypes.TEXT,
childNodeIndex: 0,
evaluate: _scope => _scope.item.name
}]
}, {
- redundantAttribute: 'expr23',
- selector: '[expr23]',
+ redundantAttribute: 'expr19',
+ selector: '[expr19]',
expressions: [{
type: expressionTypes.TEXT,
childNodeIndex: 0,
evaluate: _scope => _scope.item.count
}]
}]),
- redundantAttribute: 'expr20',
- selector: '[expr20]',
+ redundantAttribute: 'expr16',
+ selector: '[expr16]',
itemName: 'item',
indexName: null,
evaluate: _scope => _scope.state.items
diff --git a/javascript/title-progress.js b/javascript/title-progress.js
index c21b8c8..2820b5f 100644
--- a/javascript/title-progress.js
+++ b/javascript/title-progress.js
@@ -25,11 +25,11 @@ var titleProgress = {
state.class = this.computeClasses();
}
},
- template: (template, expressionTypes, bindingTypes, getComponent) => template('
', [{
+ template: (template, expressionTypes, bindingTypes, getComponent) => template('
', [{
type: bindingTypes.IF,
evaluate: _scope => _scope.props.title,
- redundantAttribute: 'expr15',
- selector: '[expr15]',
+ redundantAttribute: 'expr20',
+ selector: '[expr20]',
template: template(' ', [{
expressions: [{
type: expressionTypes.TEXT,
@@ -38,16 +38,16 @@ var titleProgress = {
}]
}])
}, {
- redundantAttribute: 'expr16',
- selector: '[expr16]',
+ redundantAttribute: 'expr21',
+ selector: '[expr21]',
expressions: [{
type: expressionTypes.TEXT,
childNodeIndex: 0,
evaluate: _scope => _scope.calcPct()
}]
}, {
- redundantAttribute: 'expr17',
- selector: '[expr17]',
+ redundantAttribute: 'expr22',
+ selector: '[expr22]',
expressions: [{
type: expressionTypes.ATTRIBUTE,
name: 'value',