templates/ajovuoro.html

changeset 22
3d094a804af8
parent 21
6a0394d5a159
child 24
e6bdb9c54096
equal deleted inserted replaced
21:6a0394d5a159 22:3d094a804af8
1 <html> 1 <html>
2 <head> 2 <head>
3 <link rel="icon" type="image/png" href="/static/favicon.png" /> 3 <link rel="icon" type="image/png" href="/static/favicon.png" />
4 <link rel="stylesheet" type="text/css" href="/static/style.css" /> 4 <link rel="stylesheet" type="text/css" href="/static/style.css" />
5 <meta charset='UTF-8' /> 5 <meta charset='UTF-8' />
6
7 <style> 6 <style>
8 #aikataulu 7 .sarake-pysäkki, .sarake-pysäkkiviite, .sarake-alue
9 {
10 margin: auto;
11 }
12 #aikataulu td
13 {
14 text-align: center;
15 }
16 #aikataulu .sarake-pysäkki
17 { 8 {
18 text-align: left; 9 text-align: left;
19 } 10 }
20 td, th, body 11 td, th, body
21 { 12 {
22 font-size: 24pt; 13 font-size: 24pt;
23 } 14 }/*
24 .sarake-aika, .sarake-tunniste 15 body
25 { 16 {
26 width: 15%; 17 background: url('/static/tausta-bussi.png') no-repeat center center fixed;
27 } 18 background-size: cover;
19 }*/
28 </style> 20 </style>
21 <script>
22 function openTab(event, category)
23 {
24 var tabcontent = document.getElementsByClassName("tab");
25 for (var i = 0; i < tabcontent.length; i++)
26 tabcontent[i].style.display = "none";
27
28 var tablinks = document.getElementsByClassName("tab-button");
29 for (var i = 0; i < tablinks.length; i++)
30 tablinks[i].className = tablinks[i].className.replace(" active", "");
31
32 document.getElementById(category).style.display = "block";
33 event.currentTarget.className += " active";
34 window.scrollTo(0, 0);
35 }
36 </script>
29 <title>{{linja}} {{selite}}</title> 37 <title>{{linja}} {{selite}}</title>
30 </head> 38 </head>
31 <body> 39 <body>
32 <h1> 40 <h1>
33 {% if yö %} 41 {% if yö %}
34 &#127769; 42 &#127769;
35 {% endif %} 43 {% endif %}
36 <!--Ajo {{numero}}: -->{{linja}} {{selite}}</h1> 44 {{linja}} {{selite}}</h1>
37 <table id='aikataulu' cellspacing='0'> 45 <nav>
38 <tr> 46 <div class="tab-bar">
39 <th class='sarake-aika'>Aika</th> 47 <span></span>
40 <th class='sarake-pysäkkiviite'>Pysäkki</th> 48 <button class="tab-button active" onclick="openTab(event, 'tab-overview')">Reitti</button>
41 <th class='sarake-pysäkki'>Nimi</th> 49 <button class="tab-button" onclick="openTab(event, 'tab-stops')">Pysäkit</button>
42 </tr> 50 <span></span>
43 {% for rivi in reitti %} 51 </div>
44 <tr> 52 </nav>
45 <td class='sarake-aika'>{{rivi['aika']}}</td> 53 <center>Ajomatka: {{'%.1f' % length}}km</center>
46 <td class='sarake-pysäkkiviite'> 54 <div id="tab-overview" class="tab">
47 <a href="/pysäkki/{{rivi['tunniste']}}"><img src='/static/pysäkki.png' height='24' /> {{rivi['tunniste']}}</a> 55 <table class='aikataulu' cellspacing='0'>
48 </td> 56 <tr>
49 <td class='sarake-pysäkki'> 57 <th class='sarake-aika'>Aika</th>
50 <a href="/pysäkki/{{rivi['tunniste']}}">{{rivi['nimi']}}</a> 58 <th class='sarake-alue'>Alue</th>
51 </td> 59 </tr>
52 </tr> 60 {% for rivi in suppea_reitti %}
53 {% endfor %} 61 <tr>
54 </table> 62 <td class='sarake-aika'>{{rivi['aika']}}</td>
63 <td class='sarake-alue'>{{rivi['alue']}}</td>
64 </tr>
65 {% endfor %}
66 </table>
67 </div>
68 <div id="tab-stops" class="tab" style="display: none">
69 <table class='aikataulu' cellspacing='0'>
70 <tr>
71 <th class='sarake-aika'>Aika</th>
72 <th class='sarake-pysäkkiviite'>Pysäkki</th>
73 <th class='sarake-pysäkki'>Nimi</th>
74 </tr>
75 {% for rivi in reitti %}
76 <tr>
77 <td class='sarake-aika'>{{rivi['aika']}}</td>
78 <td class='sarake-pysäkkiviite'>
79 <a href="/pysäkki/{{rivi['tunniste']}}"><img src='/static/pysäkki.png' height='24' /> {{rivi['tunniste']}}</a>
80 </td>
81 <td class='sarake-pysäkki'>
82 <a href="/pysäkki/{{rivi['tunniste']}}">{{rivi['nimi']}}</a>
83 </td>
84 </tr>
85 {% endfor %}
86 </table>
87 </div>
55 </body> 88 </body>
56 </html> 89 </html>

mercurial