templates/stop_week.html

changeset 87
9139a94e540c
parent 78
ead971f9569c
child 90
36efdea68d03
equal deleted inserted replaced
86:302f840d6a65 87:9139a94e540c
138 .aikataulu tbody tr.sunday.night:nth-child(even) 138 .aikataulu tbody tr.sunday.night:nth-child(even)
139 { 139 {
140 background-color: #331f29; 140 background-color: #331f29;
141 color: white; 141 color: white;
142 } 142 }
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 }
143 </style> 170 </style>
144 </head> 171 </head>
145 {% macro night_class(hour) %} 172 {% macro night_class(hour) %}
146 {% if hour < 5 or hour >= 23 %} 173 {% if hour < 5 or hour >= 23 %}
147 night 174 night
175 {% endif %}
176 {% endmacro %}
177
178 {% macro all_night_routes(entry, description) %}
179 {% if description['all-night-routes'](entry, description) %}
180 night-route
148 {% endif %} 181 {% endif %}
149 {% endmacro %} 182 {% endmacro %}
150 <body> 183 <body>
151 <table class='aikataulu' cellspacing="0"> 184 <table class='aikataulu' cellspacing="0">
152 <thead> 185 <thead>
153 <tr> 186 <tr>
154 <th colspan='100' class='primary-heading'> 187 <th colspan='100' class='primary-heading'>
155 <span><img src="../static/pysäkki.png" height="96" /> {{ref}} {{name}}</span> 188 <span><img src="../static/pysäkki.png" height="96" /> {{ref}} {{name}}</span>
156 </th> 189 </th>
190 </tr>
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>
157 </tr> 206 </tr>
158 </thead> 207 </thead>
159 <tbody> 208 <tbody>
160 {% for day in week %} 209 {% for day in week %}
161 <tr class='{{day["day-class"]}}'> 210 <tr class='{{day["day-class"]}}'>
164 {% for hour, hour_schedule in day['schedule'].items() %} 213 {% for hour, hour_schedule in day['schedule'].items() %}
165 <tr class='{{day["day-class"]}} {{night_class(hour)}}'> 214 <tr class='{{day["day-class"]}} {{night_class(hour)}}'>
166 <th class='hour-column {{night_class(hour)}}'>{{hour}}</th> 215 <th class='hour-column {{night_class(hour)}}'>{{hour}}</th>
167 {% for entry in hour_schedule %} 216 {% for entry in hour_schedule %}
168 <td class='minute-time'><span>{{'%02d' % entry['minute']}}</span></td> 217 <td class='minute-time'><span>{{'%02d' % entry['minute']}}</span></td>
218 {% if not description['simple'] %}
169 <td class='minute-route'><span>{{entry['route']}}</span></td> 219 <td class='minute-route'><span>{{entry['route']}}</span></td>
220 {% endif %}
170 {% endfor %} 221 {% endfor %}
171 </tr> 222 </tr>
172 {% endfor %} 223 {% endfor %}
173 {% endfor %} 224 {% endfor %}
174 </tbody> 225 </tbody>

mercurial