Thu, 29 Mar 2018 23:55:36 +0300
updates
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 | } | |
161 | ||
162 | .routes-legend tr | |
163 | { | |
164 | width: 100%; | |
165 | } | |
166 | ||
167 | .routes-legend td.description | |
168 | { | |
169 | } | |
78 | 170 | </style> |
171 | </head> | |
172 | {% macro night_class(hour) %} | |
173 | {% if hour < 5 or hour >= 23 %} | |
174 | night | |
175 | {% endif %} | |
176 | {% endmacro %} | |
87 | 177 | |
178 | {% macro all_night_routes(entry, description) %} | |
179 | {% if description['all-night-routes'](entry, description) %} | |
180 | night-route | |
181 | {% endif %} | |
182 | {% endmacro %} | |
78 | 183 | <body> |
184 | <table class='aikataulu' cellspacing="0"> | |
185 | <thead> | |
186 | <tr> | |
187 | <th colspan='100' class='primary-heading'> | |
188 | <span><img src="../static/pysäkki.png" height="96" /> {{ref}} {{name}}</span> | |
189 | </th> | |
190 | </tr> | |
87 | 191 | <tr> |
192 | <td colspan='100'> | |
193 | <table class='routes-legend'> | |
194 | {% for entry in description['description'] %} | |
195 | <tr> | |
196 | <td> | |
197 | {% for route in entry[0] %} | |
198 | <span class="route {{route in description['night-routes'] and 'night-route' or ''}}">{{ route }}</span> | |
199 | {% endfor %} | |
200 | </td> | |
201 | <td class="{{all_night_routes(entry, description)}} description">{{ entry[1] }}</td> | |
202 | </tr> | |
203 | {% endfor %} | |
204 | </table> | |
205 | </td> | |
206 | </tr> | |
78 | 207 | </thead> |
208 | <tbody> | |
209 | {% for day in week %} | |
210 | <tr class='{{day["day-class"]}}'> | |
211 | <th colspan='100'>{{day['day'].strftime('%a %e.%m.')}}</th> | |
212 | </tr> | |
213 | {% for hour, hour_schedule in day['schedule'].items() %} | |
214 | <tr class='{{day["day-class"]}} {{night_class(hour)}}'> | |
215 | <th class='hour-column {{night_class(hour)}}'>{{hour}}</th> | |
216 | {% for entry in hour_schedule %} | |
217 | <td class='minute-time'><span>{{'%02d' % entry['minute']}}</span></td> | |
87 | 218 | {% if not description['simple'] %} |
78 | 219 | <td class='minute-route'><span>{{entry['route']}}</span></td> |
87 | 220 | {% endif %} |
78 | 221 | {% endfor %} |
222 | </tr> | |
223 | {% endfor %} | |
224 | {% endfor %} | |
225 | </tbody> | |
226 | </table> | |
227 | </body> | |
228 | </html> |