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> <script>
export default { export default {
onMounted() { onMounted() {
this.state.enabled = true this.state.enabled = false
this.update() this.update()
}, },

View File

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

View File

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

View File

@ -11,16 +11,8 @@
</head> </head>
<body> <body>
<div class="columns"> <main-controller>
<div class="column is-one-third">
<search></search>
</div>
<div class="column"> </main-controller>
<school></school>
</div>
</div>
<!--<school-info></school-info>-->
</body> </body>
</html> </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, css: null,
exports: { exports: {
onMounted() { onMounted() {
this.state.enabled = true; this.state.enabled = false;
this.update(); this.update();
}, },
closeWindow() { closeWindow() {
@ -10,14 +10,14 @@ var schoolInfo = {
this.update(); 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, type: bindingTypes.IF,
evaluate: _scope => _scope.state.enabled, evaluate: _scope => _scope.state.enabled,
redundantAttribute: 'expr33', redundantAttribute: 'expr16',
selector: '[expr33]', selector: '[expr16]',
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>', [{ 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: 'expr34', redundantAttribute: 'expr17',
selector: '[expr34]', selector: '[expr17]',
expressions: [{ expressions: [{
type: expressionTypes.EVENT, type: expressionTypes.EVENT,
name: 'onclick', name: 'onclick',
@ -29,8 +29,8 @@ var schoolInfo = {
evaluate: _scope => 'line-graph', evaluate: _scope => 'line-graph',
slots: [], slots: [],
attributes: [], attributes: [],
redundantAttribute: 'expr35', redundantAttribute: 'expr18',
selector: '[expr35]' selector: '[expr18]'
}]) }])
}]), }]),
name: 'school-info' name: 'school-info'

View File

@ -5,7 +5,7 @@ var school = {
console.log("Test!"); 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' 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>', [{ 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: 'expr674', redundantAttribute: 'expr3',
selector: '[expr674]', selector: '[expr3]',
expressions: [{ expressions: [{
type: expressionTypes.EVENT, type: expressionTypes.EVENT,
name: 'onkeydown', name: 'onkeydown',
@ -127,8 +127,8 @@ var search = {
evaluate: _scope => _scope.state.placeholder evaluate: _scope => _scope.state.placeholder
}] }]
}, { }, {
redundantAttribute: 'expr675', redundantAttribute: 'expr4',
selector: '[expr675]', selector: '[expr4]',
expressions: [{ expressions: [{
type: expressionTypes.EVENT, type: expressionTypes.EVENT,
name: 'onclick', name: 'onclick',
@ -138,33 +138,33 @@ var search = {
type: bindingTypes.EACH, type: bindingTypes.EACH,
getKey: null, getKey: null,
condition: 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>', [{ 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: 'expr677', redundantAttribute: 'expr6',
selector: '[expr677]', selector: '[expr6]',
expressions: [{ expressions: [{
type: expressionTypes.EVENT, type: expressionTypes.EVENT,
name: 'onclick', name: 'onclick',
evaluate: _scope => () => _scope.filter(_scope.item.name) evaluate: _scope => () => _scope.filter(_scope.item.name)
}] }]
}, { }, {
redundantAttribute: 'expr678', redundantAttribute: 'expr7',
selector: '[expr678]', selector: '[expr7]',
expressions: [{ expressions: [{
type: expressionTypes.TEXT, type: expressionTypes.TEXT,
childNodeIndex: 0, childNodeIndex: 0,
evaluate: _scope => _scope.item.name evaluate: _scope => _scope.item.name
}] }]
}, { }, {
redundantAttribute: 'expr679', redundantAttribute: 'expr8',
selector: '[expr679]', selector: '[expr8]',
expressions: [{ expressions: [{
type: expressionTypes.TEXT, type: expressionTypes.TEXT,
childNodeIndex: 0, childNodeIndex: 0,
evaluate: _scope => _scope.item.count evaluate: _scope => _scope.item.count
}] }]
}]), }]),
redundantAttribute: 'expr676', redundantAttribute: 'expr5',
selector: '[expr676]', selector: '[expr5]',
itemName: 'item', itemName: 'item',
indexName: null, indexName: null,
evaluate: _scope => _scope.state.items evaluate: _scope => _scope.state.items

View File

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