From d940eb68fd6f58a6f637261854a6da615d087dea Mon Sep 17 00:00:00 2001
From: Benjamin Auder <benjamin.auder@somewhere>
Date: Sat, 30 Dec 2017 20:12:01 +0100
Subject: [PATCH] allow scores reset through CSV init

---
 js/index.js | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/js/index.js b/js/index.js
index 4bffa63..5f18704 100644
--- 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;
-- 
2.44.0