From b97b11a82c7f5a6d69fd6e3b1207b5b0f6b973ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoffer=20M=C3=BCller=20Madsen?= Date: Sat, 17 Sep 2016 13:27:44 +0200 Subject: [PATCH] =?UTF-8?q?=20tilf=C3=B8j=20mulighed=20for=20at=20vise=20u?= =?UTF-8?q?ndertitel,=20tid=20og=20sted=20for=20holdets=20timer?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server.js | 11 ++++++----- views/klandringer.ejs | 24 ++++++++++++++---------- 2 files changed, 20 insertions(+), 15 deletions(-) diff --git a/server.js b/server.js index 4ea7645..a5a7231 100644 --- a/server.js +++ b/server.js @@ -22,11 +22,12 @@ var getdata = function(callback) { if (err) { throw err; } else { - var klanddata = {}; - for(var i = 0; i < result.length; i++) { - klanddata[result[i]['date']] = result[i]['data']; - } - callback(klanddata); + result.sort(); + result.reverse(); + // for(var i = 0; i < result.length; i++) { + // klanddata[result[i]['date']] = result[i]['data']; + // } + callback(result); } }); } diff --git a/views/klandringer.ejs b/views/klandringer.ejs index 019f635..586a30c 100644 --- a/views/klandringer.ejs +++ b/views/klandringer.ejs @@ -6,12 +6,13 @@

// Referater fra holdets time på DAT3 //

<% -for (var key in data) { +for (var i in data) { +var holdets_time = data[i]; %> -

<%=key%>

- <%for (var i in data[key]) { - var k = data[key][i]; %> +

<%=holdets_time['date']%> kl. <%=holdets_time['time']%> - <%=holdets_time['subtitle']%>

+ <%for (var j in holdets_time['data']) { + var k = holdets_time["data"][j]; %> ">

<%=k["klandrer"]%> v. <%=k["klandret"]%> - <%=k["title"]%>

<%-k["description"]%>

- <%=k["taber"]%> taber! + <% if (k["taber"] != "") { %> + <%=k["taber"]%> taber! + <% } %>

<% } }