facilmap/frontend/table/table.ejs

88 wiersze
2.0 KiB
Plaintext
Czysty Wina Historia

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title><%=padData.name%> – FacilMap</title>
<base href="../" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<%
if(!padData || padData.searchEngines) {
%>
<meta name="robots" content="index,nofollow" />
<meta name="description" content="<%= padData && padData.description || "A fully-featured OpenStreetMap-based map where markers and lines can be added with live collaboration." %>" />
<%
} else {
%>
<meta name="robots" content="noindex,nofollow" />
<%
}
%>
<link rel="shortcut icon" href="../static/favicon.png">
</head>
<body>
<div class="container-fluid">
<h1><%=padData.name%> – FacilMap</h1>
<%
for(let type of Object.values(types)) {
%>
<h2 role="button" data-toggle="collapse" data-target="#type-<%=type.id%>" aria-expanded="true" aria-controls="type-<%=type.id%>"><small><span class="glyphicon glyphicon-chevron-right hidden-print"></span></small> <%=type.name%></h2>
<table id="type-<%=type.id%>" class="collapse in table table-striped table-bordered table-condensed tablesorter" data-sortlist="[[0,0]]">
<thead>
<tr>
<th>Name</th>
<%
if(type.type == "marker") {
%>
<th data-sorter="false">Position</th>
<%
} else {
%>
<th>Distance</th>
<th>Time</th>
<%
}
for(let field of type.fields) {
%>
<th><%=field.name%></th>
<%
}
%>
</tr>
</thead>
<tbody>
<%
for(let object of type.type == "marker" ? type.markers : type.lines) {
%>
<tr>
<td><%=object.name%></td>
<%
if(type.type == "marker") {
%>
<td><%=object.lat%>,<%=object.lon%></td>
<%
} else {
%>
<td><%=format.round(object.distance, 2)%> km</td>
<td><% if(object.time != null) { %><%=format.formatTime(object.time)%> h <%=format.routingMode(object.mode)%><% } %></td>
<%
}
for(let field of type.fields) {
%>
<td><%-format.formatField(field, object.data[field.name])%></td>
<%
}
%>
</tr>
<%
}
%>
</tbody>
</table>
<%
}
%>
</div>
</body>
</html>