From f8bafabe5df451bbc1ff39b3d29dba9b69e7e195 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoffer=20M=C3=BCller=20Madsen?= Date: Sat, 17 Sep 2016 23:38:37 +0200 Subject: [PATCH] =?UTF-8?q?tilf=C3=B8j=20separat=20indholdsfortegnelse,=20?= =?UTF-8?q?dagsordenspunkter,=20sikker=20ogs=C3=A5=20mere?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server.js | 8 +++- views/indholdsfortegnelse.ejs | 51 ++++++++++++++++++++++ views/klandringer.ejs | 80 +++++++++++++++++++++++++++++------ 3 files changed, 124 insertions(+), 15 deletions(-) create mode 100644 views/indholdsfortegnelse.ejs diff --git a/server.js b/server.js index a5a7231..87c40c6 100644 --- a/server.js +++ b/server.js @@ -38,6 +38,12 @@ app.get('/', function(req, res) { }); }); +app.get('/toc', function(req, res) { + getdata(function(result) { + res.render("indholdsfortegnelse", {data:result}); + }); +}); + app.listen(35211, function () { console.log('Server listening on port 35211!'); - }); \ No newline at end of file + }); diff --git a/views/indholdsfortegnelse.ejs b/views/indholdsfortegnelse.ejs new file mode 100644 index 0000000..79f7a0f --- /dev/null +++ b/views/indholdsfortegnelse.ejs @@ -0,0 +1,51 @@ + + + <% include head %> + + +

// Indholdsfortegnelse for referater //

+ + + + \ No newline at end of file diff --git a/views/klandringer.ejs b/views/klandringer.ejs index 586a30c..8f88738 100644 --- a/views/klandringer.ejs +++ b/views/klandringer.ejs @@ -3,39 +3,91 @@ <% include head %> -

// Referater fra holdets time på DAT3 //

+

// Referater fra holdets time på DAT3 //

+

Fuld indholdsfortegnelse

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

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

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

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

+ + +

Indeledende bemærkninger

+<% + var prepost_event = holdets_time["prepost_event"]; + var prev_eventid; + for (var j in holdets_time["events"]) { + if (j <= prepost_event) { + prev_eventid = j; + var e = holdets_time["events"][j]; + %> + ">

<%=e["title"]%>

+

+ <%-e["description"]%> +

+ <% + } + } +%> + + + + +

Klandringer

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

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

<%-k["description"]%>

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

- <% } -} + <% } %> + + + <% + }%> + +

Afsluttende bemærkninger

+<% + var prepost_event = holdets_time["prepost_event"]; + for (var j in holdets_time["events"]) { + if (j > prepost_event) { + + var e = holdets_time["events"][j]; + %> + ">

<%=e["title"]%>

+

+ <%-e["description"]%> +

+ <% + } + } %> + + <% + } + %> + + +