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) { if (err) {
throw err; throw err;
} else { } else {
var klanddata = {}; result.sort();
for(var i = 0; i < result.length; i++) { result.reverse();
klanddata[result[i]['date']] = result[i]['data']; // for(var i = 0; i < result.length; i++) {
} // klanddata[result[i]['date']] = result[i]['data'];
callback(klanddata); // }
callback(result);
} }
}); });
} }

View File

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