projects
/
westcastle.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
dcf8642
)
allow scores reset through CSV init
author
Benjamin Auder
<benjamin.auder@somewhere>
Sat, 30 Dec 2017 19:12:01 +0000
(20:12 +0100)
committer
Benjamin Auder
<benjamin.auder@somewhere>
Sat, 30 Dec 2017 19:12:01 +0000
(20:12 +0100)
js/index.js
patch
|
blob
|
blame
|
history
diff --git
a/js/index.js
b/js/index.js
index
4bffa63
..
5f18704
100644
(file)
--- a/
js/index.js
+++ b/
js/index.js
@@
-408,7
+408,11
@@
new Vue({
.filter( line => { return line.length > 0; }) //remove empty lines
.map( line => {
let parts = line.split(",");
- return {prenom: parts[0], nom: parts[1], pdt: 0, session:0, available: 1};
+ let p = { prenom: parts[0], nom: parts[1] };
+ p.pdt = parts.length > 2 ? parseFloat(parts[2]) : 0;
+ p.session = parts.length > 3 ? parseInt(parts[3]) : 0;
+ p.available = parts.length > 4 ? parts[4] : 1;
+ return p;
});
this.addToto(players);
this.players = players;