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"]%> +

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