From 364124db351c97fc53f249910fd8ecc46c93058f Mon Sep 17 00:00:00 2001 From: Pierre-Olivier Mercier Date: Sun, 3 Nov 2019 00:35:27 +0100 Subject: [PATCH] Add a page for each student --- main.go | 53 ++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 46 insertions(+), 7 deletions(-) diff --git a/main.go b/main.go index d1597e1..8df516c 100644 --- a/main.go +++ b/main.go @@ -68,6 +68,35 @@ function disp(rendus) { document.getElementById("head").appendChild(col); }); } + +function disp_std(rendus, login) { + Object.keys(rendus).map(function(label) { + var work = rendus[label]; + + var row = document.createElement("tr"); + + var col = document.createElement("th"); + col.innerHTML = label; + row.appendChild(col); + + if (work) { + var col = document.createElement("td"); + col.className = "success"; + col.innerHTML = work["date"] + "
" + work["hash"]; + row.appendChild(col); + } else { + var col = document.createElement("td"); + col.className = "danger"; + col.innerHTML = ""; + row.appendChild(col); + } + + document.getElementById("students").appendChild(row); +}); + var col = document.createElement("th"); + col.innerHTML = login; + document.getElementById("head").appendChild(col); +} @@ -80,13 +109,23 @@ function disp(rendus) {