templates/stop_week.html

Thu, 14 Dec 2017 13:59:40 +0200

author
Teemu Piippo <teemu@hecknology.net>
date
Thu, 14 Dec 2017 13:59:40 +0200
changeset 79
ba854da8c424
parent 78
ead971f9569c
child 87
9139a94e540c
permissions
-rw-r--r--

stop_week: järjestä tunnit ja paikkaa tyhjät tunnit

78
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
1 {% from "macros.html" import route_rep %}
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
2 <html>
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
3 <head>
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
4 <link rel="icon" type="image/png" href="../static/favicon.png" />
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
5 <link rel="stylesheet" type="text/css" href="../static/style.css" />
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
6 <meta charset='UTF-8' />
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
7 <title>{{name}}</title>
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
8 <style>
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
9 .minute-time
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
10 {
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
11 font-weight: bold;
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
12 }
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
13
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
14 td.minute-time
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
15 {
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
16 width: 20pt;
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
17 text-align: right;
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
18 border-left: 1px solid gray;
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
19 }
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
20
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
21 td.minute-route
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
22 {
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
23 width: 0;
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
24 margin: 0;
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
25 padding-left: 0;
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
26 padding-right: 3pt;
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
27 text-align: left;
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
28 }
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
29 .minute-route span
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
30 {
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
31 font-size: 75%;
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
32 }
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
33
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
34 .hour-column
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
35 {
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
36 width: 20pt;
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
37 }
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
38
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
39 /*
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
40 * Working days
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
41 */
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
42 tr.working-day td.minute-time
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
43 {
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
44 border-left: 1px solid #0f2e4d;
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
45 }
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
46
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
47 .aikataulu tr.working-day td, .aikataulu tr.working-day th
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
48 {
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
49 border-top: 1px solid #0f2e4d;
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
50 }
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
51
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
52 .aikataulu tr.working-day
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
53 {
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
54 background-color: #adcae6;
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
55 }
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
56
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
57 .aikataulu tbody tr.working-day:nth-child(even)
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
58 {
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
59 background-color: #8fa7bf;
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
60 }
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
61
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
62 .aikataulu tr.working-day.night
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
63 {
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
64 background-color: #1f2933;
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
65 color: white;
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
66 }
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
67
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
68 .aikataulu tbody tr.working-day.night:nth-child(even)
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
69 {
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
70 background-color: #2f3e4d;
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
71 color: white;
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
72 }
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
73
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
74 /*
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
75 * Satuday
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
76 */
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
77 tr.saturday td.minute-time
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
78 {
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
79 border-left: 1px solid #194d0f;
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
80 }
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
81
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
82 .aikataulu tr.saturday td, .aikataulu tr.saturday th
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
83 {
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
84 border-top: 1px solid #194d0f;
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
85 }
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
86
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
87 .aikataulu tr.saturday
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
88 {
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
89 background-color: #b6e6ad;
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
90 }
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
91
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
92 .aikataulu tbody tr.saturday:nth-child(even)
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
93 {
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
94 background-color: #97bf8f;
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
95 }
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
96
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
97 .aikataulu tr.saturday.night
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
98 {
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
99 background-color: #30402d;
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
100 color: white;
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
101 }
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
102
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
103 .aikataulu tbody tr.saturday.night:nth-child(even)
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
104 {
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
105 background-color: #4c6647;
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
106 color: white;
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
107 }
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
108
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
109 /*
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
110 * Sunday
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
111 */
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
112 tr.sunday td.minute-time
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
113 {
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
114 border-left: 1px solid #4d132d;
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
115 }
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
116
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
117 .aikataulu tr.sunday td, .aikataulu tr.sunday th
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
118 {
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
119 border-top: 1px solid #4d132d;
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
120 }
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
121
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
122 .aikataulu tr.sunday
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
123 {
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
124 background-color: #e68ab8;
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
125 }
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
126
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
127 .aikataulu tbody tr.sunday:nth-child(even)
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
128 {
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
129 background-color: #bf7399;
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
130 }
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
131
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
132 .aikataulu tr.sunday.night
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
133 {
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
134 background-color: #4d2e3d;
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
135 color: white;
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
136 }
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
137
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
138 .aikataulu tbody tr.sunday.night:nth-child(even)
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
139 {
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
140 background-color: #331f29;
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
141 color: white;
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
142 }
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
143 </style>
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
144 </head>
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
145 {% macro night_class(hour) %}
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
146 {% if hour < 5 or hour >= 23 %}
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
147 night
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
148 {% endif %}
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
149 {% endmacro %}
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
150 <body>
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
151 <table class='aikataulu' cellspacing="0">
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
152 <thead>
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
153 <tr>
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
154 <th colspan='100' class='primary-heading'>
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
155 <span><img src="../static/pysäkki.png" height="96" /> {{ref}} {{name}}</span>
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
156 </th>
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
157 </tr>
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
158 </thead>
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
159 <tbody>
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
160 {% for day in week %}
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
161 <tr class='{{day["day-class"]}}'>
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
162 <th colspan='100'>{{day['day'].strftime('%a %e.%m.')}}</th>
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
163 </tr>
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
164 {% for hour, hour_schedule in day['schedule'].items() %}
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
165 <tr class='{{day["day-class"]}} {{night_class(hour)}}'>
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
166 <th class='hour-column {{night_class(hour)}}'>{{hour}}</th>
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
167 {% for entry in hour_schedule %}
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
168 <td class='minute-time'><span>{{'%02d' % entry['minute']}}</span></td>
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
169 <td class='minute-route'><span>{{entry['route']}}</span></td>
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
170 {% endfor %}
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
171 </tr>
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
172 {% endfor %}
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
173 {% endfor %}
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
174 </tbody>
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
175 </table>
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
176 </body>
ead971f9569c add missing files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
177 </html>

mercurial