templates/stop_display.html

changeset 76
5fd79554c3aa
parent 68
382dd85b83a2
child 85
62e753b7d3ff
equal deleted inserted replaced
75:4f8a67d5d79e 76:5fd79554c3aa
21 { 21 {
22 height: 30vh; 22 height: 30vh;
23 vertical-align: middle; 23 vertical-align: middle;
24 } 24 }
25 25
26 .next-leave-table 26 .next-leave-list
27 { 27 {
28 width: 100%; 28 width: 100%;
29 } 29 }
30 30
31 .next-leave-time, .next-leave-destination, .next-leave-route 31 .next-leave-time,
32 .next-leave-places li.next-leave-destination,
33 .next-leave-route
32 { 34 {
33 font-weight: bold; 35 font-weight: bold;
34 font-size: 10vmin; 36 font-size: 10vmin;
35 } 37 }
36 38
37 .next-leave-time 39 .next-leave-time
38 { 40 {
39 width: 25%; 41 text-align: left;
40 text-align: left
41 } 42 }
42 43
43 .next-leave-route 44 .next-leave-route
44 { 45 {
45 width: 25%; 46 border: 0.5vmin solid black;
46 } 47 border-radius: 100%;
47 48 padding: 8px;
48 .next-leave-destination 49 min-width: 12vmin;
49 { 50 min-height: 12vmin;
50 width: 50%; 51 text-align: center;
51 } 52 background: #ffd90f;
52 53 }
53 .via 54
55 .next-leave-places
56 {
57 text-align: center;
58 }
59
60 .next-leave-places li
54 { 61 {
55 list-style: none; 62 list-style: none;
56 font-size: 6vmin; 63 font-size: 6vmin;
57 padding-top: 1vw; 64 padding-top: 1vw;
58 font-weight: normal; 65 font-weight: normal;
59 }
60
61 .next-leave-table
62 {
63 text-align: center;
64 } 66 }
65 67
66 #other-leaves 68 #other-leaves
67 { 69 {
68 width: 100%; 70 width: 100%;
167 { 169 {
168 font-size: 6vw; 170 font-size: 6vw;
169 } 171 }
170 } 172 }
171 </style> 173 </style>
172
173 <script> 174 <script>
174 num_visible_leaves = 3; 175 num_visible_leaves = 3;
175 num_imminent_leaves = {{num_imminent_leaves}}; 176 num_imminent_leaves = {{num_imminent_leaves}};
176 var imminent_leave_cycle = []; 177 var imminent_leave_cycle = [];
177 var other_leave_cycle = []; 178 var other_leave_cycle = [];
220 </script> 221 </script>
221 </head> 222 </head>
222 <body onload='cycle_leaves()'> 223 <body onload='cycle_leaves()'>
223 <h1><img src="../static/pysäkki.png" height="128" /><span id='stop-name'>{{ref}} {{name}}</span></h1> 224 <h1><img src="../static/pysäkki.png" height="128" /><span id='stop-name'>{{ref}} {{name}}</span></h1>
224 <div class='next-leave'> 225 <div class='next-leave'>
225 <table class='next-leave-table'> 226 <ul class='next-leave-list'>
226 {% for schedule_entry in schedule[:num_imminent_leaves] %} 227 {% for schedule_entry in schedule[:num_imminent_leaves] %}
227 <tbody id="leave-{{schedule_entry['index']}}"> 228 <li id="leave-{{schedule_entry['index']}}">
229
230 <table>
228 <tr> 231 <tr>
229 <td class='next-leave-time'> 232 <td class='next-leave-time'>
230 {% if schedule_entry['imminent'] %} 233 {% if schedule_entry['imminent'] %}
231 <span class='imminent-leave'>{{schedule_entry['time']}}</span>&#8203; 234 <span class='imminent-leave'>{{schedule_entry['time']}}</span>&#8203;
232 {% else %} 235 {% else %}
233 {{schedule_entry['time']}}&#8203; 236 {{schedule_entry['time']}}&#8203;
234 {% endif %} 237 {% endif %}
235 </td> 238 </td>
236 <td class='next-leave-route'>{{schedule_entry['route']}}</td> 239 <td rowspan="2">
237 <td class='next-leave-destination'>{{schedule_entry['sign']['destination']}} 240 <ul class="next-leave-places">
238 <span class='via'><br /> 241 <li class='next-leave-destination'>
239 {% if num_imminent_leaves > 1 and schedule_entry['sign']['via'][0] and schedule_entry['sign']['via'][1] %} 242 {{schedule_entry['sign']['destination']}}</li>
240 {{schedule_entry['sign']['via'][0]}} - {{schedule_entry['sign']['via'][1]}} 243 {% for entry in schedule_entry['sign']['via'] %}
241 {% for entry in schedule_entry['sign']['via'][2:] %}<br />{{entry}}{% endfor %}</span> 244 <li>{{entry}}</li>
242 {% else %} 245 {% endfor %}
243 {% for entry in schedule_entry['sign']['via'] %}{{entry}}<br />{% endfor %}</span> 246 </ul>
244 {% endif %} 247 </td>
245 </th>
246 </tr> 248 </tr>
247 </tbody> 249 <tr>
250 <td><span class='next-leave-route'>{{schedule_entry['route']}}</span></td>
251 </tr>
252 </table>
253
254 </li>
248 {% endfor %} 255 {% endfor %}
249 </table> 256 </ul>
250 </div> 257 </div>
251 {% if schedule[num_imminent_leaves] %} 258 {% if schedule[num_imminent_leaves] %}
252 <div id='other-leaves'> 259 <div id='other-leaves'>
253 <table cellspacing="0"> 260 <table cellspacing="0">
254 {% for halt in schedule[num_imminent_leaves:] %} 261 {% for halt in schedule[num_imminent_leaves:num_imminent_leaves + 2] %}
255 <tr id="leave-{{halt['index']}}" style='display: none'> 262 <tr id="leave-{{halt['index']}}" style='display: none'>
256 <td class='other-leave-time'>{{halt['time']}}</td> 263 <td class='other-leave-time'>{{halt['time']}}</td>
257 <td class='other-leave-route'>{{halt['route']}}</td> 264 <td class='other-leave-route'>{{halt['route']}}</td>
258 <td class='other-leave-destination'>{{halt['sign']['destination']}}</td> 265 <td class='other-leave-destination'>{{halt['sign']['destination']}}</td>
259 </tr> 266 </tr>

mercurial