Tue, 20 Jun 2017 10:30:47 +0300
Uudelleennimetty templaatit
service.py | file | annotate | diff | comparison | revisions | |
templates/ajovuoro-suppea.html | file | annotate | diff | comparison | revisions | |
templates/ajovuoro.html | file | annotate | diff | comparison | revisions | |
templates/pysäkki.html | file | annotate | diff | comparison | revisions | |
templates/stop.html | file | annotate | diff | comparison | revisions | |
templates/trip.html | file | annotate | diff | comparison | revisions |
--- a/service.py Tue Jun 20 10:27:52 2017 +0300 +++ b/service.py Tue Jun 20 10:30:47 2017 +0300 @@ -84,7 +84,7 @@ 'night': is_night_time(schedule_entry['time']), }) return render_template( - 'pysäkki.html', + 'stop.html', schedule = schedule, name = reference + ' ' + tr(bus_stop.name, 'bus_stops'), link_to_map = bus_stop.location.link_to_map, @@ -175,7 +175,7 @@ sign = [sign[0], sign[-1]] for entry in concise_schedule: entry['region'] = tr(entry['region'], 'paikat') - return render_template('ajovuoro.html', + return render_template('trip.html', schedule = schedule, concise_schedule = concise_schedule, trip_reference = trip_reference,
--- a/templates/ajovuoro-suppea.html Tue Jun 20 10:27:52 2017 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,21 +0,0 @@ -<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' /> - <style> - td, th, body - { - font-size: 24pt; - } - .sarake-aika - { - text-align: center; - } - </style> - <title>{{linja}} {{selite}}</title> -</head> -<body> - <h1>{{linja}} {{selite}}</h1> -</body> -</html>
--- a/templates/ajovuoro.html Tue Jun 20 10:27:52 2017 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,89 +0,0 @@ -<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' /> - <style> - .sarake-pysäkki, .sarake-pysäkkiviite, .sarake-alue - { - text-align: left; - } - td, th, body - { - font-size: 24pt; - }/* - body - { - background: url('/static/tausta-bussi.png') no-repeat center center fixed; - background-size: cover; - }*/ - </style> - <script> - function openTab(event, category) - { - var tabcontent = document.getElementsByClassName("tab"); - for (var i = 0; i < tabcontent.length; i++) - tabcontent[i].style.display = "none"; - - var tablinks = document.getElementsByClassName("tab-button"); - for (var i = 0; i < tablinks.length; i++) - tablinks[i].className = tablinks[i].className.replace(" active", ""); - - document.getElementById(category).style.display = "block"; - event.currentTarget.className += " active"; - window.scrollTo(0, 0); - } - </script> - <title>{{route}} {{description}}</title> -</head> -<body> - <h1> - {% if night %} - 🌙 - {% endif %} - {{route}} {{description}}</h1> - <nav> - <div class="tab-bar"> - <span></span> - <button class="tab-button active" onclick="openTab(event, 'tab-overview')">Reitti</button> - <button class="tab-button" onclick="openTab(event, 'tab-stops')">Pysäkit</button> - <span></span> - </div> - </nav> - <center>Ajomatka: {{'%.1f' % length}}km</center> - <div id="tab-overview" class="tab"> - <table class='aikataulu' cellspacing='0'> - <tr> - <th class='sarake-aika'>Aika</th> - <th class='sarake-alue'>Alue</th> - </tr> - {% for entry in concise_schedule %} - <tr> - <td class='sarake-aika'>{{entry['time']}}</td> - <td class='sarake-alue'>{{entry['region']}}</td> - </tr> - {% endfor %} - </table> - </div> - <div id="tab-stops" class="tab" style="display: none"> - <table class='aikataulu' cellspacing='0'> - <tr> - <th class='sarake-aika'>Aika</th> - <th class='sarake-pysäkkiviite'>Pysäkki</th> - <th class='sarake-pysäkki'>Nimi</th> - </tr> - {% for halt in schedule %} - <tr> - <td class='sarake-aika'>{{halt['time']}}</td> - <td class='sarake-pysäkkiviite'> - <a href="/pysäkki/{{halt['reference']}}"><img src='/static/pysäkki.png' height='24' /> {{halt['reference']}}</a> - </td> - <td class='sarake-pysäkki'> - <a href="/pysäkki/{{halt['reference']}}">{{halt['name']}}</a> - </td> - </tr> - {% endfor %} - </table> - </div> -</body> -</html>
--- a/templates/pysäkki.html Tue Jun 20 10:27:52 2017 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,54 +0,0 @@ -<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' /> - <title>{{nimi}}</title> - <style> - .sarake-määränpää - { - text-align: left; - } - </style> - {% if tausta %} - <style> - /*body - { - background: url('/{{tausta}}') no-repeat center center fixed; - background-size: cover; - }*/ - </style> - {% endif %} -</head> -<body> - <h1><img src="/static/iso-pysäkki.png" height="96" /> <span>{{name}}</span></h1> - <p id="pysäkki-info"> - {{region or ""}} - — - <a class="pysäkki-sijainti" href="{{linkki_karttaan}}" target="_blank">📌 ({{location}})</a> - </p> - {% if cluster %} - <p> - <a href="/pysäkkiryhmä/{{cluster}}">{{tr('nearby-area-schedule', 'misc-text')}}</a> - </p> - {% endif %} - <table class='aikataulu' cellspacing="0"> - <tr> - <th class='sarake-aika'>{{tr('time', 'headings')}}</th> - <th class='sarake-linja'>{{tr('route', 'headings')}}</th> - <th class='sarake-määränpää'>{{tr('destination', 'headings')}}</th> - </tr> - {% for halt in schedule %} - <tr class="{% if halt['night'] %} yö {% endif %}"> - <td class='sarake-aika'>{{halt['time']}}</td> - <td class='sarake-linja linja'> - <a href="/ajovuoro/{{halt['trip']}}">{{halt['route']}}</a> - </td> - <td class='sarake-määränpää'> - <a href="/ajovuoro/{{halt['trip']}}">{{halt['sign']}}</a> - </td> - </tr> - {% endfor %} - </table> -</body> -</html>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/templates/stop.html Tue Jun 20 10:30:47 2017 +0300 @@ -0,0 +1,54 @@ +<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' /> + <title>{{nimi}}</title> + <style> + .sarake-määränpää + { + text-align: left; + } + </style> + {% if tausta %} + <style> + /*body + { + background: url('/{{tausta}}') no-repeat center center fixed; + background-size: cover; + }*/ + </style> + {% endif %} +</head> +<body> + <h1><img src="/static/iso-pysäkki.png" height="96" /> <span>{{name}}</span></h1> + <p id="pysäkki-info"> + {{region or ""}} + — + <a class="pysäkki-sijainti" href="{{linkki_karttaan}}" target="_blank">📌 ({{location}})</a> + </p> + {% if cluster %} + <p> + <a href="/pysäkkiryhmä/{{cluster}}">{{tr('nearby-area-schedule', 'misc-text')}}</a> + </p> + {% endif %} + <table class='aikataulu' cellspacing="0"> + <tr> + <th class='sarake-aika'>{{tr('time', 'headings')}}</th> + <th class='sarake-linja'>{{tr('route', 'headings')}}</th> + <th class='sarake-määränpää'>{{tr('destination', 'headings')}}</th> + </tr> + {% for halt in schedule %} + <tr class="{% if halt['night'] %} yö {% endif %}"> + <td class='sarake-aika'>{{halt['time']}}</td> + <td class='sarake-linja linja'> + <a href="/ajovuoro/{{halt['trip']}}">{{halt['route']}}</a> + </td> + <td class='sarake-määränpää'> + <a href="/ajovuoro/{{halt['trip']}}">{{halt['sign']}}</a> + </td> + </tr> + {% endfor %} + </table> +</body> +</html>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/templates/trip.html Tue Jun 20 10:30:47 2017 +0300 @@ -0,0 +1,89 @@ +<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' /> + <style> + .sarake-pysäkki, .sarake-pysäkkiviite, .sarake-alue + { + text-align: left; + } + td, th, body + { + font-size: 24pt; + }/* + body + { + background: url('/static/tausta-bussi.png') no-repeat center center fixed; + background-size: cover; + }*/ + </style> + <script> + function openTab(event, category) + { + var tabcontent = document.getElementsByClassName("tab"); + for (var i = 0; i < tabcontent.length; i++) + tabcontent[i].style.display = "none"; + + var tablinks = document.getElementsByClassName("tab-button"); + for (var i = 0; i < tablinks.length; i++) + tablinks[i].className = tablinks[i].className.replace(" active", ""); + + document.getElementById(category).style.display = "block"; + event.currentTarget.className += " active"; + window.scrollTo(0, 0); + } + </script> + <title>{{route}} {{description}}</title> +</head> +<body> + <h1> + {% if night %} + 🌙 + {% endif %} + {{route}} {{description}}</h1> + <nav> + <div class="tab-bar"> + <span></span> + <button class="tab-button active" onclick="openTab(event, 'tab-overview')">Reitti</button> + <button class="tab-button" onclick="openTab(event, 'tab-stops')">Pysäkit</button> + <span></span> + </div> + </nav> + <p style="text-align: center">Ajomatka: {{'%.1f' % length}}km</p> + <div id="tab-overview" class="tab"> + <table class='aikataulu' cellspacing='0'> + <tr> + <th class='sarake-aika'>Aika</th> + <th class='sarake-alue'>Alue</th> + </tr> + {% for entry in concise_schedule %} + <tr> + <td class='sarake-aika'>{{entry['time']}}</td> + <td class='sarake-alue'>{{entry['region']}}</td> + </tr> + {% endfor %} + </table> + </div> + <div id="tab-stops" class="tab" style="display: none"> + <table class='aikataulu' cellspacing='0'> + <tr> + <th class='sarake-aika'>Aika</th> + <th class='sarake-pysäkkiviite'>Pysäkki</th> + <th class='sarake-pysäkki'>Nimi</th> + </tr> + {% for halt in schedule %} + <tr> + <td class='sarake-aika'>{{halt['time']}}</td> + <td class='sarake-pysäkkiviite'> + <a href="/pysäkki/{{halt['reference']}}"><img src='/static/pysäkki.png' height='24' /> {{halt['reference']}}</a> + </td> + <td class='sarake-pysäkki'> + <a href="/pysäkki/{{halt['reference']}}">{{halt['name']}}</a> + </td> + </tr> + {% endfor %} + </table> + </div> +</body> +</html>