Controlleur

This commit is contained in:
HORVILLE 2023-03-28 13:42:53 +02:00
parent 4bcd136e75
commit 27d266709d
12 changed files with 121 additions and 47 deletions

View File

@ -0,0 +1,9 @@
<fili-info>
<div class="box p-1 m-2">
</div>
<script>
</script>
</fili-info>

View File

@ -0,0 +1,21 @@
<main-controller>
<div class="columns">
<div class="column is-one-third">
<search></search>
</div>
<div class="column">
<fili-info></fili-info>
<school></school>
</div>
</div>
<school-info></school-info>
<script>
export default {
}
</script>
</main-controller>

View File

@ -12,7 +12,7 @@
<script>
export default {
onMounted() {
this.state.enabled = true
this.state.enabled = false
this.update()
},

View File

@ -1,13 +1,11 @@
<school>
<main class="container">
<div class="block control has-icons-left is-inline-block is-pulled-right">
<input class="input" type="search" placeholder="Établissement">
<span class="icon is-small is-left">
<i class="fas fa-search"></i>
</span>
</div>
<div class="box p-2 m-2">
<div class="block control has-icons-left is-inline-block is-pulled-right">
<input 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>
@ -19,7 +17,7 @@
<th><abbr title="selectivite">Sélectivité</abbr></th>
</tr>
</thead>
</div>
<script>
export default {
onMounted() {

View File

@ -8,7 +8,7 @@
<ul>
<li class="m-1" each={item in this.state.items}>
<button class="button is-fullwidth" onclick={()=>filter(item.name)}>
<span><strong>{item.name}</strong></span>
<span style="font-size: .75em;"><strong>{item.name}</strong></span>
<div style="margin-left: auto;"></div>
<span class="tag is-primary">{item.count}</span>
</button>

View File

@ -11,16 +11,8 @@
</head>
<body>
<div class="columns">
<div class="column is-one-third">
<search></search>
</div>
<div class="column">
<school></school>
</div>
</div>
<!--<school-info></school-info>-->
<main-controller>
</main-controller>
</body>
</html>

8
javascript/fili-info.js Normal file
View File

@ -0,0 +1,8 @@
var filiInfo = {
css: null,
exports: null,
template: (template, expressionTypes, bindingTypes, getComponent) => template('<div class="box p-1 m-2"></div>', []),
name: 'fili-info'
};
export { filiInfo as default };

View File

@ -0,0 +1,40 @@
var mainController = {
css: null,
exports: {},
template: (template, expressionTypes, bindingTypes, getComponent) => template('<div class="columns"><div class="column is-one-third"><search expr19="expr19"></search></div><div class="column"><fili-info expr20="expr20"></fili-info><school expr21="expr21"></school></div></div><school-info expr22="expr22"></school-info>', [{
type: bindingTypes.TAG,
getComponent: getComponent,
evaluate: _scope => 'search',
slots: [],
attributes: [],
redundantAttribute: 'expr19',
selector: '[expr19]'
}, {
type: bindingTypes.TAG,
getComponent: getComponent,
evaluate: _scope => 'fili-info',
slots: [],
attributes: [],
redundantAttribute: 'expr20',
selector: '[expr20]'
}, {
type: bindingTypes.TAG,
getComponent: getComponent,
evaluate: _scope => 'school',
slots: [],
attributes: [],
redundantAttribute: 'expr21',
selector: '[expr21]'
}, {
type: bindingTypes.TAG,
getComponent: getComponent,
evaluate: _scope => 'school-info',
slots: [],
attributes: [],
redundantAttribute: 'expr22',
selector: '[expr22]'
}]),
name: 'main-controller'
};
export { mainController as default };

View File

@ -2,7 +2,7 @@ var schoolInfo = {
css: null,
exports: {
onMounted() {
this.state.enabled = true;
this.state.enabled = false;
this.update();
},
closeWindow() {
@ -10,14 +10,14 @@ var schoolInfo = {
this.update();
}
},
template: (template, expressionTypes, bindingTypes, getComponent) => template('<div expr33="expr33" style="position: absolute; top: 0px; left: 0px; width: 100%; height: 100%; background: #000000DD;"></div>', [{
template: (template, expressionTypes, bindingTypes, getComponent) => template('<div expr16="expr16" style="position: absolute; top: 0px; left: 0px; width: 100%; height: 100%; background: #000000DD;"></div>', [{
type: bindingTypes.IF,
evaluate: _scope => _scope.state.enabled,
redundantAttribute: 'expr33',
selector: '[expr33]',
template: template('<div style="position: absolute; top: 10%; left: 10%; width: 80%; height: 80%; background: #FFFFFF"><button expr34="expr34">X</button><p><h2></h2></p><line-graph expr35="expr35" style="height: 90px; margin: 10px;"></line-graph></div>', [{
redundantAttribute: 'expr34',
selector: '[expr34]',
redundantAttribute: 'expr16',
selector: '[expr16]',
template: template('<div style="position: absolute; top: 10%; left: 10%; width: 80%; height: 80%; background: #FFFFFF"><button expr17="expr17">X</button><p><h2></h2></p><line-graph expr18="expr18" style="height: 90px; margin: 10px;"></line-graph></div>', [{
redundantAttribute: 'expr17',
selector: '[expr17]',
expressions: [{
type: expressionTypes.EVENT,
name: 'onclick',
@ -29,8 +29,8 @@ var schoolInfo = {
evaluate: _scope => 'line-graph',
slots: [],
attributes: [],
redundantAttribute: 'expr35',
selector: '[expr35]'
redundantAttribute: 'expr18',
selector: '[expr18]'
}])
}]),
name: 'school-info'

View File

@ -5,7 +5,7 @@ var school = {
console.log("Test!");
}
},
template: (template, expressionTypes, bindingTypes, getComponent) => template('<main class="container"><div class="block control has-icons-left is-inline-block is-pulled-right"><input 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><abbr title="name">Nom</abbr></th><th><abbr title="city">Ville</abbr></th><th><abbr title="dept">Dpt</abbr></th><th><abbr title="moyenne">Moyenne</abbr></th><th><abbr title="selectivite">Sélectivité</abbr></th></tr></thead></table></main>', []),
template: (template, expressionTypes, bindingTypes, getComponent) => template('<div class="box p-2 m-2"><div class="block control has-icons-left is-inline-block is-pulled-right"><input 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><abbr title="name">Nom</abbr></th><th><abbr title="city">Ville</abbr></th><th><abbr title="dept">Dpt</abbr></th><th><abbr title="moyenne">Moyenne</abbr></th><th><abbr title="selectivite">Sélectivité</abbr></th></tr></thead></table></div>', []),
name: 'school'
};

View File

@ -114,9 +114,9 @@ var search = {
}
};
},
template: (template, expressionTypes, bindingTypes, getComponent) => template('<div class="box p-1 m-2"><div class="columns m-1"><input expr674="expr674" class="input" type="input"/><button expr675="expr675" class="button ml-1">&lt;</button></div><div id="list-formations"><ul><li expr676="expr676" class="m-1"></li></ul></div></div>', [{
redundantAttribute: 'expr674',
selector: '[expr674]',
template: (template, expressionTypes, bindingTypes, getComponent) => template('<div class="box p-1 m-2"><div class="columns m-1"><input expr3="expr3" class="input" type="input"/><button expr4="expr4" class="button ml-1">&lt;</button></div><div id="list-formations"><ul><li expr5="expr5" class="m-1"></li></ul></div></div>', [{
redundantAttribute: 'expr3',
selector: '[expr3]',
expressions: [{
type: expressionTypes.EVENT,
name: 'onkeydown',
@ -127,8 +127,8 @@ var search = {
evaluate: _scope => _scope.state.placeholder
}]
}, {
redundantAttribute: 'expr675',
selector: '[expr675]',
redundantAttribute: 'expr4',
selector: '[expr4]',
expressions: [{
type: expressionTypes.EVENT,
name: 'onclick',
@ -138,33 +138,33 @@ var search = {
type: bindingTypes.EACH,
getKey: null,
condition: null,
template: template('<button expr677="expr677" class="button is-fullwidth"><span><strong expr678="expr678"> </strong></span><div style="margin-left: auto;"></div><span expr679="expr679" class="tag is-primary"> </span></button>', [{
redundantAttribute: 'expr677',
selector: '[expr677]',
template: template('<button expr6="expr6" class="button is-fullwidth"><span style="font-size: .75em;"><strong expr7="expr7"> </strong></span><div style="margin-left: auto;"></div><span expr8="expr8" class="tag is-primary"> </span></button>', [{
redundantAttribute: 'expr6',
selector: '[expr6]',
expressions: [{
type: expressionTypes.EVENT,
name: 'onclick',
evaluate: _scope => () => _scope.filter(_scope.item.name)
}]
}, {
redundantAttribute: 'expr678',
selector: '[expr678]',
redundantAttribute: 'expr7',
selector: '[expr7]',
expressions: [{
type: expressionTypes.TEXT,
childNodeIndex: 0,
evaluate: _scope => _scope.item.name
}]
}, {
redundantAttribute: 'expr679',
selector: '[expr679]',
redundantAttribute: 'expr8',
selector: '[expr8]',
expressions: [{
type: expressionTypes.TEXT,
childNodeIndex: 0,
evaluate: _scope => _scope.item.count
}]
}]),
redundantAttribute: 'expr676',
selector: '[expr676]',
redundantAttribute: 'expr5',
selector: '[expr5]',
itemName: 'item',
indexName: null,
evaluate: _scope => _scope.state.items

View File

@ -2,17 +2,23 @@
Charge tous les fichiers riot compilés.
*/
import MainController from './javascript/main-controller.js'
import SchoolInfo from './javascript/school-info.js'
import LineGraph from './javascript/line-graph.js'
import FiliInfo from './javascript/fili-info.js'
import Search from './javascript/search.js'
import School from './javascript/school.js'
riot.register("main-controller", MainController)
riot.register("school-info", SchoolInfo)
riot.register("line-graph", LineGraph)
riot.register("fili-info", FiliInfo)
riot.register("search", Search)
riot.register("school", School)
riot.mount("main-controller")
riot.mount("school-info")
riot.mount("line-graph")
riot.mount("fili-info")
riot.mount("search")
riot.mount("school")