templates/trip.html

Fri, 11 Aug 2017 14:32:04 +0300

author
Teemu Piippo <teemu@hecknology.net>
date
Fri, 11 Aug 2017 14:32:04 +0300
changeset 50
2cf22291a4f4
parent 48
428cfdf64ccc
child 53
1c934953c3e6
permissions
-rw-r--r--

Asdf v2

<html>
<head>
	<link rel="icon" type="image/png" href="../static/favicon.png" />
	<link rel="stylesheet" type="text/css" href="../static/style.css" />
	<meta charset='UTF-8' />
	<meta http-equiv='refresh' content='60'>
	<style>
	.sarake-alue
	{
		text-align: left;
	}
	.sarake-aika
	{
		width: 0;
	}
	td.folded table
	{
		display: none;
	}
	td.unfolded a.region-name
	{
		font-weight: bold;
	}
	.nested-schedule td
	{
		margin-left: 0;
		margin-right: 0;
		padding-left: 5px;
		padding-right: 5px;
	}
	.nested-schedule
	{
		border-radius: 10px;
		margin-top: 10px;
	}
	</style>
	<script>
	function toggle_fold(id)
	{
		element = document.getElementById(id);
		if (element.className.indexOf(" folded") !== -1)
			element.className = element.className.replace(" folded", "") + " unfolded";
		else
			element.className = element.className.replace(" unfolded", "") + " folded";
	}
	</script>
	<title>{{route}} {{description}}</title>
</head>
<body>
	<h1>
	{% if night %}
	&#127769;&nbsp;
	{% endif %}
	🚍 {{route}} {{description}}</h1>
	<p style="text-align: center">Ajomatka: {{'%.1f' % length}}km</p>
	<table class='aikataulu' cellspacing='0'>
		<tr>
			<th class='sarake-aika'>Aika</th>
			<th class='sarake-alue'>Alue</th>
		</tr>
		{% for entry in schedule %}
		<tr>
			<td class='sarake-aika' style='vertical-align: top'>{{entry['time']}}</td>
			<td class='sarake-alue folded' id="region-schedule-{{entry['index']}}">
				<a class="region-name" href="javascript:toggle_fold('region-schedule-{{entry['index']}}')">{{entry['name']}}</a>
				<table class="nested-schedule" cellspacing="0">
				{% for halt in entry['stops'] %}
				<tr>
					<td>{{halt['time']}}</td>
					<td><a href="../stop/{{halt['id']}}"><img src='../static/pysäkki.png' height='24' />&nbsp;{{halt['code']}}</a></td>
					<td><a href="../stop/{{halt['id']}}">{{halt['name']}}</a></td>
				</tr>
				{% endfor %}
				</table>
			</td>
		</tr>
		{% endfor %}
	</table>
</body>
</html>

mercurial