From f6f79198b6467435fd7caccd2067eb0a29c97787 Mon Sep 17 00:00:00 2001
From: Jacek Kowalski <Jacek@jacekk.info>
Date: Fri, 21 Jun 2019 22:58:16 +0000
Subject: [PATCH] Move mapping creation to a function in lib/output.php
---
templates/vehicles.html | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 59 insertions(+), 0 deletions(-)
diff --git a/templates/vehicles.html b/templates/vehicles.html
new file mode 100644
index 0000000..7686d05
--- /dev/null
+++ b/templates/vehicles.html
@@ -0,0 +1,59 @@
+<!DOCTYPE html>
+<title>Vehicles on lines (TTSS-based)</title>
+<meta name="viewport" content="width=device-width, initial-scale=1" />
+
+<style type="text/css">
+table {
+ border-collapse: collapse;
+ border-spacing: 0;
+}
+th, td {
+ border: 1px solid black;
+ padding: 5px;
+}
+td {
+ vertical-align: top;
+ text-align: center;
+}
+a {
+ text-decoration: none;
+}
+a:hover {
+ text-decoration: underline;
+}
+.low {
+ color: #000;
+}
+.low0 {
+ color: #C70;
+}
+.low1, .low2 {
+ color: #070;
+}
+</style>
+
+<table>
+
+<thead>
+<tr>
+{% for line in lines|keys %}
+<th>{{ line | e }}</th>
+{% endfor %}
+</tr>
+</thead>
+
+<tbody>
+<tr>
+{% for trips in lines %}
+<td>
+{% for trip in trips %}
+<a href="https://mpk.jacekk.net/map.html#!{{ prefix }}{{ trip.trip.id | e }}" class="low{{ trip.vehicle.low | default }}">
+{{ trip.vehicle.num | default('<?>') | e }}<br />
+</a>
+{% endfor %}
+</td>
+{% endfor %}
+</tr>
+</tbody>
+
+</table>
--
Gitblit v1.10.0