tilføj separat indholdsfortegnelse, dagsordenspunkter, sikker også mere

This commit is contained in:
Christoffer Müller Madsen 2016-09-17 23:38:37 +02:00
parent b97b11a82c
commit f8bafabe5d
3 changed files with 124 additions and 15 deletions

View File

@ -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 () { app.listen(35211, function () {
console.log('Server listening on port 35211!'); console.log('Server listening on port 35211!');
}); });

View File

@ -0,0 +1,51 @@
<html>
<head>
<% include head %>
</head>
<body>
<h1>// Indholdsfortegnelse for referater //</h1>
<ul>
<!-- Print indholdsfortegnelse -->
<%
for (var i in data) {
var holdets_time = data[i]; %>
<li><a href="/#<%=holdets_time['date']%>"><%=holdets_time['date']%> - <%=holdets_time['subtitle']%></a>
<ul>
<li><a href="/#<%=holdets_time['date']%>Indledende">Indledende bemærkninger</a></li>
<ul>
<%
var prepost_event = holdets_time["prepost_event"];
for (var j in holdets_time["events"]) {
if (j <= prepost_event) {
var e = holdets_time["events"][j];%>
<li><a href="/#<%=(holdets_time['date'] + e['title']).replace(/\s/g,'')%>"><%=e['title']%></a></li>
<%
}
} %>
</ul>
<li><a href="/#<%=holdets_time['date']%>Klandringer">Klandringer</a></li>
<ul>
<% for (var j in holdets_time["klandringer"]) {
var k = holdets_time["klandringer"][j]; %>
<li><a href="/#<%=String(k['klandrer'] + k['klandret'] + k['title']).replace(/\s/g,'')%>"><%=k['klandrer']%> v. <%=k['klandret']%> - <i><%=k['title']%></i></a></li>
<% } %>
</ul>
<li><a href="/#<%=holdets_time['date']%>Afsluttende">Afsluttende bemærkninger</a></li>
<ul>
<%
var prepost_event = holdets_time["prepost_event"];
for (var j in holdets_time["events"]) {
if (j > prepost_event) {
var e = holdets_time["events"][j];%>
<li><a href="/#<%=(holdets_time['date'] + e['title']).replace(/\s/g,'')%>"><%=e['title']%></a></li>
<%
}
} %>
</ul>
</ul>
<% } %>
%>
</ul>
<!-- Slut indholdsfortegnelse -->
</body>
</html>

View File

@ -4,38 +4,90 @@
</head> </head>
<body> <body>
<h1>// Referater fra holdets time på DAT3 //</h1> <h1>// Referater fra holdets time på DAT3 //</h1>
<h3><a href="/toc">Fuld indholdsfortegnelse</a></h3>
<ul> <ul>
<!-- Print indholdsfortegnelse -->
<% <%
for (var i in data) { for (var i in data) {
var holdets_time = data[i]; %> var holdets_time = data[i]; %>
<li><a href="#<%=holdets_time['date']%>"><%=holdets_time['date']%> - <%=holdets_time['subtitle']%></a> <li><a href="#<%=holdets_time['date']%>"><%=holdets_time['date']%> - <%=holdets_time['subtitle']%></a>
<ul>
<% for (var j in holdets_time["data"]) {
var k = holdets_time["data"][j]; %>
<li><a href="#<%=String(k['klandrer'] + k['klandret'] + k['title']).replace(/\s/g,'')%>"><%=k['klandrer']%> v. <%=k['klandret']%> - <i><%=k['title']%></i></a></li>
<% } %>
</ul>
<% } %> <% } %>
%> %>
</ul> </ul>
<!-- Slut indholdsfortegnelse -->
<!-- Start holdets timer -->
<% <%
for (var i in data) { for (var i in data) {
var holdets_time = data[i]; var holdets_time = data[i];
%> %>
<h2><%=holdets_time['date']%> kl. <%=holdets_time['time']%> - <%=holdets_time['subtitle']%></h2> <a name="<%=holdets_time['date']%>"></a><h2><%=holdets_time['date']%> kl. <%=holdets_time['time']%> - <%=holdets_time['subtitle']%></h2>
<%for (var j in holdets_time['data']) {
var k = holdets_time["data"][j]; %> <!-- Print punkterne før klandringer -->
<a name="<%=holdets_time['date']%>Indledende"></a><h3>Indeledende bemærkninger</h3>
<%
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];
%>
<a name="<%=(holdets_time["date"] + e["title"]).replace(/\s/g,'')%>"></a><h4><%=e["title"]%></h4>
<p>
<%-e["description"]%>
</p>
<%
}
}
%>
<!-- Slut før -->
<!-- Print klandringer -->
<a name="<%=holdets_time['date']%>Klandringer"></a><h3>Klandringer</h3>
<%for (var j in holdets_time["klandringer"]) {
var k = holdets_time["klandringer"][j]; %>
<a name="<%=(k["klandrer"] + k["klandret"] + k["title"]).replace(/\s/g,'')%>"></a><h4><%=k["klandrer"]%> v. <%=k["klandret"]%> - <i><%=k["title"]%></i></h4> <a name="<%=(k["klandrer"] + k["klandret"] + k["title"]).replace(/\s/g,'')%>"></a><h4><%=k["klandrer"]%> v. <%=k["klandret"]%> - <i><%=k["title"]%></i></h4>
<p> <p>
<%-k["description"]%> <%-k["description"]%>
<br><br> <br><br>
<% if (k["taber"] != "") { %> <% if (k["taber"] != "") { %>
<i><%=k["taber"]%> taber!</i> <i><%=k["taber"]%> taber!</i>
<% } %>
</p> </p>
<% } <% } %>
<!-- Slut klandringer -->
<%
}%>
<!-- Print punkterne efter klandringer -->
<a name="<%=holdets_time['date']%>Afsluttende"></a><h3>Afsluttende bemærkninger</h3>
<%
var prepost_event = holdets_time["prepost_event"];
for (var j in holdets_time["events"]) {
if (j > prepost_event) {
var e = holdets_time["events"][j];
%>
<a name="<%=(holdets_time["date"] + e["title"]).replace(/\s/g,'')%>"></a><h4><%=e["title"]%></h4>
<p>
<%-e["description"]%>
</p>
<%
}
} }
%> %>
<%
}
%>
<!-- Slut holdets timer -->
<body> <body>
</html> </html>