Wed, 26 Sep 2018 13:17:22 +0300
added comment
78 | 1 | {% from "macros.html" import route_rep %} |
2 | <html> | |
3 | <head> | |
4 | <link rel="icon" type="image/png" href="../static/favicon.png" /> | |
5 | <link rel="stylesheet" type="text/css" href="../static/style.css" /> | |
6 | <meta charset='UTF-8' /> | |
7 | <title>{{name}}</title> | |
8 | <style> | |
9 | .minute-time | |
10 | { | |
11 | font-weight: bold; | |
12 | } | |
13 | ||
14 | td.minute-time | |
15 | { | |
16 | width: 20pt; | |
17 | text-align: right; | |
18 | border-left: 1px solid gray; | |
19 | } | |
20 | ||
21 | td.minute-route | |
22 | { | |
23 | width: 0; | |
24 | margin: 0; | |
25 | padding-left: 0; | |
26 | padding-right: 3pt; | |
27 | text-align: left; | |
28 | } | |
29 | .minute-route span | |
30 | { | |
31 | font-size: 75%; | |
32 | } | |
33 | ||
34 | .hour-column | |
35 | { | |
36 | width: 20pt; | |
37 | } | |
38 | ||
39 | /* | |
40 | * Working days | |
41 | */ | |
42 | tr.working-day td.minute-time | |
43 | { | |
44 | border-left: 1px solid #0f2e4d; | |
45 | } | |
46 | ||
47 | .aikataulu tr.working-day td, .aikataulu tr.working-day th | |
48 | { | |
49 | border-top: 1px solid #0f2e4d; | |
50 | } | |
51 | ||
52 | .aikataulu tr.working-day | |
53 | { | |
54 | background-color: #adcae6; | |
55 | } | |
56 | ||
57 | .aikataulu tbody tr.working-day:nth-child(even) | |
58 | { | |
59 | background-color: #8fa7bf; | |
60 | } | |
61 | ||
62 | .aikataulu tr.working-day.night | |
63 | { | |
64 | background-color: #1f2933; | |
65 | color: white; | |
66 | } | |
67 | ||
68 | .aikataulu tbody tr.working-day.night:nth-child(even) | |
69 | { | |
70 | background-color: #2f3e4d; | |
71 | color: white; | |
72 | } | |
73 | ||
74 | /* | |
75 | * Satuday | |
76 | */ | |
77 | tr.saturday td.minute-time | |
78 | { | |
79 | border-left: 1px solid #194d0f; | |
80 | } | |
81 | ||
82 | .aikataulu tr.saturday td, .aikataulu tr.saturday th | |
83 | { | |
84 | border-top: 1px solid #194d0f; | |
85 | } | |
86 | ||
87 | .aikataulu tr.saturday | |
88 | { | |
89 | background-color: #b6e6ad; | |
90 | } | |
91 | ||
92 | .aikataulu tbody tr.saturday:nth-child(even) | |
93 | { | |
94 | background-color: #97bf8f; | |
95 | } | |
96 | ||
97 | .aikataulu tr.saturday.night | |
98 | { | |
99 | background-color: #30402d; | |
100 | color: white; | |
101 | } | |
102 | ||
103 | .aikataulu tbody tr.saturday.night:nth-child(even) | |
104 | { | |
105 | background-color: #4c6647; | |
106 | color: white; | |
107 | } | |
108 | ||
109 | /* | |
110 | * Sunday | |
111 | */ | |
112 | tr.sunday td.minute-time | |
113 | { | |
114 | border-left: 1px solid #4d132d; | |
115 | } | |
116 | ||
117 | .aikataulu tr.sunday td, .aikataulu tr.sunday th | |
118 | { | |
119 | border-top: 1px solid #4d132d; | |
120 | } | |
121 | ||
122 | .aikataulu tr.sunday | |
123 | { | |
124 | background-color: #e68ab8; | |
125 | } | |
126 | ||
127 | .aikataulu tbody tr.sunday:nth-child(even) | |
128 | { | |
129 | background-color: #bf7399; | |
130 | } | |
131 | ||
132 | .aikataulu tr.sunday.night | |
133 | { | |
134 | background-color: #4d2e3d; | |
135 | color: white; | |
136 | } | |
137 | ||
138 | .aikataulu tbody tr.sunday.night:nth-child(even) | |
139 | { | |
140 | background-color: #331f29; | |
141 | color: white; | |
142 | } | |
87 | 143 | |
144 | .routes-legend .route | |
145 | { | |
146 | font-weight: bold | |
147 | } | |
148 | ||
149 | .routes-legend .night-route | |
150 | { | |
151 | color: blue | |
152 | } | |
153 | ||
154 | .routes-legend | |
155 | { | |
156 | border-spacing: 0px; | |
157 | border-collapse: separate; | |
158 | width: 100%; | |
159 | border: 1px solid rgba(0, 0, 0, 0.2); | |
160 | } | |
92
16a5c37e4e67
stop_week now shows rare variants with less emphasis
Teemu Piippo <teemu@hecknology.net>
parents:
90
diff
changeset
|
161 | |
87 | 162 | .routes-legend tr |
163 | { | |
164 | width: 100%; | |
165 | } | |
92
16a5c37e4e67
stop_week now shows rare variants with less emphasis
Teemu Piippo <teemu@hecknology.net>
parents:
90
diff
changeset
|
166 | |
16a5c37e4e67
stop_week now shows rare variants with less emphasis
Teemu Piippo <teemu@hecknology.net>
parents:
90
diff
changeset
|
167 | .routes-legend .rare-group td |
16a5c37e4e67
stop_week now shows rare variants with less emphasis
Teemu Piippo <teemu@hecknology.net>
parents:
90
diff
changeset
|
168 | { |
16a5c37e4e67
stop_week now shows rare variants with less emphasis
Teemu Piippo <teemu@hecknology.net>
parents:
90
diff
changeset
|
169 | padding-top: 5px; |
16a5c37e4e67
stop_week now shows rare variants with less emphasis
Teemu Piippo <teemu@hecknology.net>
parents:
90
diff
changeset
|
170 | padding-bottom: 5px; |
16a5c37e4e67
stop_week now shows rare variants with less emphasis
Teemu Piippo <teemu@hecknology.net>
parents:
90
diff
changeset
|
171 | } |
87 | 172 | |
92
16a5c37e4e67
stop_week now shows rare variants with less emphasis
Teemu Piippo <teemu@hecknology.net>
parents:
90
diff
changeset
|
173 | .rare-group .routes:before, .common-route-group .rare-route-variant:before |
16a5c37e4e67
stop_week now shows rare variants with less emphasis
Teemu Piippo <teemu@hecknology.net>
parents:
90
diff
changeset
|
174 | { |
16a5c37e4e67
stop_week now shows rare variants with less emphasis
Teemu Piippo <teemu@hecknology.net>
parents:
90
diff
changeset
|
175 | content: "("; |
16a5c37e4e67
stop_week now shows rare variants with less emphasis
Teemu Piippo <teemu@hecknology.net>
parents:
90
diff
changeset
|
176 | } |
16a5c37e4e67
stop_week now shows rare variants with less emphasis
Teemu Piippo <teemu@hecknology.net>
parents:
90
diff
changeset
|
177 | |
16a5c37e4e67
stop_week now shows rare variants with less emphasis
Teemu Piippo <teemu@hecknology.net>
parents:
90
diff
changeset
|
178 | .rare-group .routes:after, .common-route-group .rare-route-variant:after |
87 | 179 | { |
92
16a5c37e4e67
stop_week now shows rare variants with less emphasis
Teemu Piippo <teemu@hecknology.net>
parents:
90
diff
changeset
|
180 | content: ")"; |
16a5c37e4e67
stop_week now shows rare variants with less emphasis
Teemu Piippo <teemu@hecknology.net>
parents:
90
diff
changeset
|
181 | } |
16a5c37e4e67
stop_week now shows rare variants with less emphasis
Teemu Piippo <teemu@hecknology.net>
parents:
90
diff
changeset
|
182 | |
16a5c37e4e67
stop_week now shows rare variants with less emphasis
Teemu Piippo <teemu@hecknology.net>
parents:
90
diff
changeset
|
183 | .rare-group td, .common-route-group .rare-route-variant |
16a5c37e4e67
stop_week now shows rare variants with less emphasis
Teemu Piippo <teemu@hecknology.net>
parents:
90
diff
changeset
|
184 | { |
16a5c37e4e67
stop_week now shows rare variants with less emphasis
Teemu Piippo <teemu@hecknology.net>
parents:
90
diff
changeset
|
185 | font-size: 15pt; |
87 | 186 | } |
78 | 187 | </style> |
188 | </head> | |
189 | {% macro night_class(hour) %} | |
190 | {% if hour < 5 or hour >= 23 %} | |
191 | night | |
192 | {% endif %} | |
193 | {% endmacro %} | |
87 | 194 | |
195 | {% macro all_night_routes(entry, description) %} | |
196 | {% if description['all-night-routes'](entry, description) %} | |
197 | night-route | |
198 | {% endif %} | |
199 | {% endmacro %} | |
78 | 200 | <body> |
201 | <table class='aikataulu' cellspacing="0"> | |
202 | <thead> | |
203 | <tr> | |
204 | <th colspan='100' class='primary-heading'> | |
109 | 205 | <span style='float:left'><a href='?week={{previous_week}}'>⏴</a></span> |
90 | 206 | <span><img src="../static/{{typename}}.png" height="96" /> {{ref}} {{name}}</span> |
109 | 207 | <span style='float:right'><a href='?week={{next_week}}'>⏵</a></span> |
78 | 208 | </th> |
209 | </tr> | |
87 | 210 | <tr> |
211 | <td colspan='100'> | |
212 | <table class='routes-legend'> | |
213 | {% for entry in description['description'] %} | |
92
16a5c37e4e67
stop_week now shows rare variants with less emphasis
Teemu Piippo <teemu@hecknology.net>
parents:
90
diff
changeset
|
214 | <tr class="{{entry[0] in description['rare-variant-groups'] and 'rare-group' or 'common-route-group'}}"> |
87 | 215 | <td> |
109 | 216 | <span class='routes'>{% for route in entry[0] %}<span class="route {{route in description['night-routes'] and 'night-route' or ''}} {{route in description['rare-variants'] and 'rare-route-variant' or ''}}">{{ route }}</span>{{ route != entry[0][-1] and '.' or '' }}{% endfor %}</span> |
87 | 217 | </td> |
218 | <td class="{{all_night_routes(entry, description)}} description">{{ entry[1] }}</td> | |
219 | </tr> | |
220 | {% endfor %} | |
221 | </table> | |
222 | </td> | |
223 | </tr> | |
78 | 224 | </thead> |
225 | <tbody> | |
226 | {% for day in week %} | |
227 | <tr class='{{day["day-class"]}}'> | |
228 | <th colspan='100'>{{day['day'].strftime('%a %e.%m.')}}</th> | |
229 | </tr> | |
230 | {% for hour, hour_schedule in day['schedule'].items() %} | |
231 | <tr class='{{day["day-class"]}} {{night_class(hour)}}'> | |
232 | <th class='hour-column {{night_class(hour)}}'>{{hour}}</th> | |
233 | {% for entry in hour_schedule %} | |
121 | 234 | <td class='minute-time'><a href="../trip/{{entry['trip']}}">{{'%02d' % entry['minute']}}</a></td> |
87 | 235 | {% if not description['simple'] %} |
78 | 236 | <td class='minute-route'><span>{{entry['route']}}</span></td> |
87 | 237 | {% endif %} |
78 | 238 | {% endfor %} |
239 | </tr> | |
240 | {% endfor %} | |
241 | {% endfor %} | |
242 | </tbody> | |
243 | </table> | |
244 | </body> | |
245 | </html> |