facilmap/frontend/src/table/table.ejs

123 wiersze
2.7 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="icon" href="../../static/favicon.svg">
<link rel="mask-icon" href="../../static/favicon.svg" color="#00272a">
<link rel="apple-touch-icon" href="../../static/favicon-180.png">
<link rel="manifest" href="../../static/manifest.json">
</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%>"><svg class="hidden-print" viewbox="0 0 11 15" height="15"><path d="M10.195 7.5l-7.5 7.5L0 12.305 4.805 7.5 0 2.695 2.695 0z"/></svg> <%=type.name%></h2>
<div id="type-<%=type.id%>" class="collapse show">
<table class="table table-striped table-bordered table-condensed tablesorter" data-sortlist="[[0,0]]">
<thead>
<tr>
<%
if(!hide.includes("Name")) {
-%>
<th>Name</th>
<%
}
if(type.type == "marker") {
if(!hide.includes("Position")) {
-%>
<th data-sorter="false">Position</th>
<%
}
} else {
if(!hide.includes("Distance")) {
-%>
<th>Distance</th>
<%
}
if(!hide.includes("Time")) {
-%>
<th>Time</th>
<%
}
}
for(let field of type.fields) {
if(!hide.includes(field.name)) {
-%>
<th><%=field.name%></th>
<%
}
}
-%>
</tr>
</thead>
<tbody>
<%
for(let object of type.type == "marker" ? type.markers : type.lines) {
-%>
<tr>
<%
if(!hide.includes("Name")) {
-%>
<td><%=object.name%></td>
<%
}
if(type.type == "marker") {
if(!hide.includes("Position")) {
-%>
<td><%=object.lat%>,<%=object.lon%></td>
<%
}
} else {
if(!hide.includes("Distance")) {
-%>
<td><%=utils.round(object.distance, 2)%> km</td>
<%
}
if(!hide.includes("Time")) {
-%>
<td><% if(object.time != null) { %><%=utils.formatTime(object.time)%> h <%=utils.formatRouteMode(object.mode)%><% } %></td>
<%
}
}
for(let field of type.fields) {
if(!hide.includes(field.name)) {
-%>
<td><%-utils.formatField(field, object.data[field.name]).trim()%></td>
<%
}
}
-%>
</tr>
<%
}
-%>
</tbody>
</table>
</div>
<%
}
-%>
</div>
</body>
</html>