tilføj mulighed for at vise undertitel, tid og sted for holdets timer

This commit is contained in:
Christoffer Müller Madsen 2016-09-17 13:27:44 +02:00
parent cf743c2861
commit b97b11a82c
2 changed files with 20 additions and 15 deletions

View File

@ -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);
}
});
}

View File

@ -6,12 +6,13 @@
<h1>// Referater fra holdets time på DAT3 //</h1>
<ul>
<%
for (var key in data) { %>
<li><a href="#<%=key%>"><%=key%></a>
for (var i in data) {
var holdets_time = data[i]; %>
<li><a href="#<%=holdets_time['date']%>"><%=holdets_time['date']%> - <%=holdets_time['subtitle']%></a>
<ul>
<% for (var i in data[key]) {
var k = data[key][i]; %>
<li><a href="#<%=(k["klandrer"] + k["klandret"] + k["title"]).replace(/\s/g,'')%>"><%=k["klandrer"]%> v. <%=k["klandret"]%> - <i><%=k["title"]%></i></a></li>
<% 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>
<% } %>
@ -19,16 +20,19 @@ for (var key in data) { %>
</ul>
<%
for (var key in data) {
for (var i in data) {
var holdets_time = data[i];
%>
<h2><%=key%></h2>
<%for (var i in data[key]) {
var k = data[key][i]; %>
<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]; %>
<a name="<%=(k["klandrer"] + k["klandret"] + k["title"]).replace(/\s/g,'')%>"></a><h4><%=k["klandrer"]%> v. <%=k["klandret"]%> - <i><%=k["title"]%></i></h4>
<p>
<%-k["description"]%>
<br><br>
<% if (k["taber"] != "") { %>
<i><%=k["taber"]%> taber!</i>
<% } %>
</p>
<% }
}