Merge lp:~aelkner/schooltool/schooltool.zambia into lp:~schooltool-owners/schooltool/schooltool.zambia
- schooltool.zambia
- Merge into schooltool.zambia
Proposed by
Alan Elkner
Status: | Merged |
---|---|
Merged at revision: | 59 |
Proposed branch: | lp:~aelkner/schooltool/schooltool.zambia |
Merge into: | lp:~schooltool-owners/schooltool/schooltool.zambia |
Diff against target: |
702 lines (+612/-3) 7 files modified
src/schooltool/zambia/app/browser/app.py (+307/-1) src/schooltool/zambia/app/browser/configure.zcml (+52/-0) src/schooltool/zambia/app/browser/resources/zambia.css (+20/-0) src/schooltool/zambia/app/browser/templates/subgroups_timetable.pt (+55/-0) src/schooltool/zambia/app/browser/templates/subgroups_timetable_pdf.pt (+88/-0) src/schooltool/zambia/app/browser/templates/teachers_timetable.pt (+2/-2) src/schooltool/zambia/app/browser/templates/teachers_timetable_pdf.pt (+88/-0) |
To merge this branch: | bzr merge lp:~aelkner/schooltool/schooltool.zambia |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
SchoolTool Owners | Pending | ||
Review via email: mp+34671@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
- 59. By Alan Elkner <aelkner@ubuntu>
-
cosmetic changes to timetable pdfs
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'src/schooltool/zambia/app/browser/app.py' | |||
2 | --- src/schooltool/zambia/app/browser/app.py 2010-08-08 18:28:59 +0000 | |||
3 | +++ src/schooltool/zambia/app/browser/app.py 2010-09-26 22:01:04 +0000 | |||
4 | @@ -19,14 +19,19 @@ | |||
5 | 19 | """ | 19 | """ |
6 | 20 | SchoolTool Zambia application views. | 20 | SchoolTool Zambia application views. |
7 | 21 | """ | 21 | """ |
8 | 22 | from reportlab.lib import pagesizes | ||
9 | 22 | 23 | ||
10 | 24 | from zope.browserpage.viewpagetemplatefile import ViewPageTemplateFile | ||
11 | 23 | from zope.publisher.browser import BrowserView | 25 | from zope.publisher.browser import BrowserView |
12 | 24 | from zope.security.proxy import removeSecurityProxy | 26 | from zope.security.proxy import removeSecurityProxy |
13 | 25 | from zope.traversing.browser.absoluteurl import absoluteURL | 27 | from zope.traversing.browser.absoluteurl import absoluteURL |
14 | 26 | 28 | ||
15 | 29 | from schooltool.app.browser.report import ReportPDFView | ||
16 | 27 | from schooltool.app.interfaces import ISchoolToolApplication | 30 | from schooltool.app.interfaces import ISchoolToolApplication |
18 | 28 | from schooltool.course.interfaces import IInstructor | 31 | from schooltool.course.interfaces import IInstructor, ISectionContainer |
19 | 32 | from schooltool.group.interfaces import IGroupContainer | ||
20 | 29 | from schooltool.schoolyear.interfaces import ISchoolYearContainer | 33 | from schooltool.schoolyear.interfaces import ISchoolYearContainer |
21 | 34 | from schooltool.schoolyear.interfaces import ISchoolYear | ||
22 | 30 | from schooltool.skin.skin import NavigationViewlet | 35 | from schooltool.skin.skin import NavigationViewlet |
23 | 31 | from schooltool.term.interfaces import ITerm | 36 | from schooltool.term.interfaces import ITerm |
24 | 32 | from schooltool.timetable.interfaces import ITimetables | 37 | from schooltool.timetable.interfaces import ITimetables |
25 | @@ -38,6 +43,10 @@ | |||
26 | 38 | ERROR_INVALID_MODEL = _('Timetable model must be WeeklyTimetableModel.') | 43 | ERROR_INVALID_MODEL = _('Timetable model must be WeeklyTimetableModel.') |
27 | 39 | ERROR_TIMETABLE_MISMATCH = _('Timetables must be consistent for the term.') | 44 | ERROR_TIMETABLE_MISMATCH = _('Timetables must be consistent for the term.') |
28 | 40 | 45 | ||
29 | 46 | TEACHER_HEADING = _('Teacher') | ||
30 | 47 | TOTAL_HEADING = _('Total') | ||
31 | 48 | SUBGROUP_HEADING = _('Sub-\ngroup') | ||
32 | 49 | |||
33 | 41 | 50 | ||
34 | 42 | class ManageYearlyViewlet(NavigationViewlet): | 51 | class ManageYearlyViewlet(NavigationViewlet): |
35 | 43 | @property | 52 | @property |
36 | @@ -193,3 +202,300 @@ | |||
37 | 193 | results.append(result) | 202 | results.append(result) |
38 | 194 | return results | 203 | return results |
39 | 195 | 204 | ||
40 | 205 | |||
41 | 206 | class SubgroupsTimetableView(BrowserView): | ||
42 | 207 | """A view for the term's subgroup-based timetable""" | ||
43 | 208 | |||
44 | 209 | def __init__(self, context, request): | ||
45 | 210 | super(SubgroupsTimetableView, self).__init__(context, request) | ||
46 | 211 | self.term = removeSecurityProxy(self.context) | ||
47 | 212 | self.schoolyear = ISchoolYear(self.term) | ||
48 | 213 | self.groups = IGroupContainer(self.schoolyear) | ||
49 | 214 | |||
50 | 215 | def error(self, error_message): | ||
51 | 216 | self.error_message = error_message | ||
52 | 217 | |||
53 | 218 | def update(self): | ||
54 | 219 | self.error_message = '' | ||
55 | 220 | self.data = { | ||
56 | 221 | 'days': [], | ||
57 | 222 | 'rows': [], | ||
58 | 223 | } | ||
59 | 224 | |||
60 | 225 | subgroup_sections = {} | ||
61 | 226 | for section in ISectionContainer(self.context).values(): | ||
62 | 227 | title = section.title.upper() | ||
63 | 228 | subgroup_sections.setdefault(title, []).append(section) | ||
64 | 229 | |||
65 | 230 | for subgroup_title, sections in sorted(subgroup_sections.items()): | ||
66 | 231 | subgroup_dict = {} | ||
67 | 232 | |||
68 | 233 | teacher = '' | ||
69 | 234 | if subgroup_title in self.groups: | ||
70 | 235 | leaders = [l for l in self.groups[subgroup_title].leaders] | ||
71 | 236 | if leaders: | ||
72 | 237 | teacher = leaders[0].title | ||
73 | 238 | |||
74 | 239 | for section in sections: | ||
75 | 240 | titles = [course.title.lower() | ||
76 | 241 | for course in section.courses] | ||
77 | 242 | course_title = ', '.join(titles) | ||
78 | 243 | |||
79 | 244 | timetables = ITimetables(section).timetables | ||
80 | 245 | if len(timetables.keys()) != 1: | ||
81 | 246 | return self.error(ERROR_TOO_COMPLEX) | ||
82 | 247 | timetable = timetables[timetables.keys()[0]] | ||
83 | 248 | if timetable.model.factory_id != 'WeeklyTimetableModel': | ||
84 | 249 | return self.error(ERROR_INVALID_MODEL) | ||
85 | 250 | |||
86 | 251 | days = [[day_id, timetable[day_id].periods] | ||
87 | 252 | for day_id in timetable.day_ids] | ||
88 | 253 | if not self.data['days']: | ||
89 | 254 | self.data['days'] = days | ||
90 | 255 | elif days != self.data['days']: | ||
91 | 256 | return self.error(ERROR_TIMETABLE_MISMATCH) | ||
92 | 257 | |||
93 | 258 | for day_id, periods in days: | ||
94 | 259 | subgroup_day = subgroup_dict.setdefault(day_id, {}) | ||
95 | 260 | for period in periods: | ||
96 | 261 | if timetable[day_id].activities[period]: | ||
97 | 262 | cell = subgroup_day.setdefault(period, {}) | ||
98 | 263 | cell[course_title] = 0 | ||
99 | 264 | |||
100 | 265 | if subgroup_dict: | ||
101 | 266 | row = { | ||
102 | 267 | 'name': subgroup_title, | ||
103 | 268 | 'teacher': teacher, | ||
104 | 269 | 'days': subgroup_dict, | ||
105 | 270 | } | ||
106 | 271 | self.data['rows'].append(row) | ||
107 | 272 | |||
108 | 273 | used_days = {} | ||
109 | 274 | for row in self.data['rows']: | ||
110 | 275 | for day_id in row['days']: | ||
111 | 276 | used_day = used_days.setdefault(day_id, set()) | ||
112 | 277 | for period in row['days'][day_id]: | ||
113 | 278 | used_day.add(period) | ||
114 | 279 | |||
115 | 280 | adjusted_days = [] | ||
116 | 281 | for day_id, periods in days: | ||
117 | 282 | if day_id not in used_days: | ||
118 | 283 | continue | ||
119 | 284 | adjusted_periods = [] | ||
120 | 285 | for period in periods: | ||
121 | 286 | if period in used_days[day_id]: | ||
122 | 287 | adjusted_periods.append(period) | ||
123 | 288 | if adjusted_periods: | ||
124 | 289 | adjusted_days.append([day_id, adjusted_periods]) | ||
125 | 290 | self.data['days'] = adjusted_days | ||
126 | 291 | |||
127 | 292 | def days(self): | ||
128 | 293 | dayNames = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday'] | ||
129 | 294 | results = [] | ||
130 | 295 | for day_id, day_periods in self.data['days']: | ||
131 | 296 | periods = [] | ||
132 | 297 | for period_index, value in enumerate(day_periods): | ||
133 | 298 | if period_index == 0: | ||
134 | 299 | cell = ' heading_left' | ||
135 | 300 | else: | ||
136 | 301 | cell = ' heading' | ||
137 | 302 | cls = 'odd border_top period' + cell | ||
138 | 303 | period = { | ||
139 | 304 | 'class': cls, | ||
140 | 305 | 'value': unicode(value)[:3], | ||
141 | 306 | } | ||
142 | 307 | periods.append(period) | ||
143 | 308 | result = { | ||
144 | 309 | 'text': dayNames[day_id], | ||
145 | 310 | 'span': len(periods), | ||
146 | 311 | 'periods': periods, | ||
147 | 312 | } | ||
148 | 313 | results.append(result) | ||
149 | 314 | return results | ||
150 | 315 | |||
151 | 316 | def rows(self): | ||
152 | 317 | results = [] | ||
153 | 318 | for index, row in enumerate(self.data['rows']): | ||
154 | 319 | if index % 2 == 0: | ||
155 | 320 | even_odd = ' even' | ||
156 | 321 | else: | ||
157 | 322 | even_odd = ' odd' | ||
158 | 323 | days = [] | ||
159 | 324 | for day_id, day_periods in self.data['days']: | ||
160 | 325 | if day_id not in row['days']: | ||
161 | 326 | continue | ||
162 | 327 | periods = [] | ||
163 | 328 | for period_index, period in enumerate(day_periods): | ||
164 | 329 | if period_index == 0: | ||
165 | 330 | cell = ' sg_cell_left' | ||
166 | 331 | else: | ||
167 | 332 | cell = ' sg_cell' | ||
168 | 333 | |||
169 | 334 | value = '' | ||
170 | 335 | if day_id in row['days']: | ||
171 | 336 | values = row['days'][day_id].get(period, {}) | ||
172 | 337 | value = '\n'.join([unicode(value)[:4] | ||
173 | 338 | for value in sorted(values)]) | ||
174 | 339 | |||
175 | 340 | cls = 'period' + even_odd + cell | ||
176 | 341 | |||
177 | 342 | period_cell = { | ||
178 | 343 | 'class': cls, | ||
179 | 344 | 'value': value, | ||
180 | 345 | } | ||
181 | 346 | periods.append(period_cell) | ||
182 | 347 | days.append(periods) | ||
183 | 348 | |||
184 | 349 | result = { | ||
185 | 350 | 'name': row['name'], | ||
186 | 351 | 'teacher': row['teacher'], | ||
187 | 352 | 'days': days, | ||
188 | 353 | 'class': 'cell' + even_odd, | ||
189 | 354 | 'class_left': 'cell_left' + even_odd, | ||
190 | 355 | } | ||
191 | 356 | results.append(result) | ||
192 | 357 | return results | ||
193 | 358 | |||
194 | 359 | |||
195 | 360 | class TeachersTimetablePDFView(ReportPDFView, TeachersTimetableView): | ||
196 | 361 | """A view for the term's teacher-based timetable pdf""" | ||
197 | 362 | |||
198 | 363 | template=ViewPageTemplateFile('templates/teachers_timetable_pdf.pt') | ||
199 | 364 | pageSize = pagesizes.landscape(ReportPDFView.pageSize) | ||
200 | 365 | rotation = 90 | ||
201 | 366 | name_width = '2.5cm' | ||
202 | 367 | period_width = 0.55 | ||
203 | 368 | empty_width = 0.03 | ||
204 | 369 | total_width = ',1cm' | ||
205 | 370 | |||
206 | 371 | def __call__(self): | ||
207 | 372 | self.term = removeSecurityProxy(self.context) | ||
208 | 373 | self.update() | ||
209 | 374 | return super(TeachersTimetablePDFView, self).__call__() | ||
210 | 375 | |||
211 | 376 | def heading_widths1(self): | ||
212 | 377 | results = self.name_width | ||
213 | 378 | for day in self.days(): | ||
214 | 379 | day_width = self.empty_width + day['span'] * self.period_width | ||
215 | 380 | results += ',%fcm' % day_width | ||
216 | 381 | results += ',%fcm' % self.empty_width | ||
217 | 382 | results += self.total_width | ||
218 | 383 | return results | ||
219 | 384 | |||
220 | 385 | def heading_widths2(self): | ||
221 | 386 | results = self.name_width | ||
222 | 387 | for day in self.days(): | ||
223 | 388 | results += ',%fcm' % self.empty_width | ||
224 | 389 | for period in day['periods']: | ||
225 | 390 | results += ',%fcm' % self.period_width | ||
226 | 391 | results += ',%fcm' % self.empty_width | ||
227 | 392 | results += self.total_width | ||
228 | 393 | return results | ||
229 | 394 | |||
230 | 395 | def headings1(self): | ||
231 | 396 | results = [''] | ||
232 | 397 | for day in self.days(): | ||
233 | 398 | results.append(day['text']) | ||
234 | 399 | results.extend(['', '']) | ||
235 | 400 | return results | ||
236 | 401 | |||
237 | 402 | def headings2(self): | ||
238 | 403 | results = [TEACHER_HEADING] | ||
239 | 404 | for day in self.days(): | ||
240 | 405 | results.append('') | ||
241 | 406 | for period in day['periods']: | ||
242 | 407 | results.append(period['value']) | ||
243 | 408 | results.extend(['', TOTAL_HEADING]) | ||
244 | 409 | return results | ||
245 | 410 | |||
246 | 411 | def row_heights(self): | ||
247 | 412 | result = 1 | ||
248 | 413 | rows = self.rows() | ||
249 | 414 | for row in rows: | ||
250 | 415 | for day in row['days']: | ||
251 | 416 | for period in day: | ||
252 | 417 | size = len(period['value'].split('\n')) | ||
253 | 418 | if size > result: | ||
254 | 419 | result = size | ||
255 | 420 | if result == 1: | ||
256 | 421 | height = 0.65 | ||
257 | 422 | else: | ||
258 | 423 | height = 0.28 * result | ||
259 | 424 | return ','.join(['%fcm' % height] * len(rows)) | ||
260 | 425 | |||
261 | 426 | def pdf_rows(self): | ||
262 | 427 | results = [] | ||
263 | 428 | for row in self.rows(): | ||
264 | 429 | result_row = [row['name']] | ||
265 | 430 | for day in row['days']: | ||
266 | 431 | result_row.append('') | ||
267 | 432 | for period in day: | ||
268 | 433 | value = period['value'] | ||
269 | 434 | result_row.append(value) | ||
270 | 435 | result_row.extend(['', row['total']]) | ||
271 | 436 | results.append(result_row) | ||
272 | 437 | return results | ||
273 | 438 | |||
274 | 439 | |||
275 | 440 | class SubgroupsTimetablePDFView(ReportPDFView, SubgroupsTimetableView): | ||
276 | 441 | """A view for the term's subgroup-based timetable pdf""" | ||
277 | 442 | |||
278 | 443 | template=ViewPageTemplateFile('templates/subgroups_timetable_pdf.pt') | ||
279 | 444 | pageSize = pagesizes.landscape(ReportPDFView.pageSize) | ||
280 | 445 | rotation = 90 | ||
281 | 446 | name_width = '1.2cm' | ||
282 | 447 | teacher_width = ',1.7cm' | ||
283 | 448 | period_width = 0.56 | ||
284 | 449 | empty_width = 0.03 | ||
285 | 450 | |||
286 | 451 | def __call__(self): | ||
287 | 452 | self.term = removeSecurityProxy(self.context) | ||
288 | 453 | self.schoolyear = ISchoolYear(self.term) | ||
289 | 454 | self.groups = IGroupContainer(self.schoolyear) | ||
290 | 455 | self.update() | ||
291 | 456 | return super(SubgroupsTimetablePDFView, self).__call__() | ||
292 | 457 | |||
293 | 458 | def heading_widths1(self): | ||
294 | 459 | results = self.name_width + self.teacher_width | ||
295 | 460 | for day in self.days(): | ||
296 | 461 | day_width = self.empty_width + day['span'] * self.period_width | ||
297 | 462 | results += ',%fcm' % day_width | ||
298 | 463 | return results | ||
299 | 464 | |||
300 | 465 | def heading_widths2(self): | ||
301 | 466 | results = self.name_width + self.teacher_width | ||
302 | 467 | for day in self.days(): | ||
303 | 468 | results += ',%fcm' % self.empty_width | ||
304 | 469 | for period in day['periods']: | ||
305 | 470 | results += ',%fcm' % self.period_width | ||
306 | 471 | return results | ||
307 | 472 | |||
308 | 473 | def headings1(self): | ||
309 | 474 | results = ['', ''] | ||
310 | 475 | for day in self.days(): | ||
311 | 476 | results.append(day['text']) | ||
312 | 477 | return results | ||
313 | 478 | |||
314 | 479 | def headings2(self): | ||
315 | 480 | results = [SUBGROUP_HEADING, TEACHER_HEADING] | ||
316 | 481 | for day in self.days(): | ||
317 | 482 | results.append('') | ||
318 | 483 | for period in day['periods']: | ||
319 | 484 | results.append(period['value']) | ||
320 | 485 | return results | ||
321 | 486 | |||
322 | 487 | def row_heights(self): | ||
323 | 488 | return ','.join(['0.65cm'] * len(self.rows())) | ||
324 | 489 | |||
325 | 490 | def pdf_rows(self): | ||
326 | 491 | results = [] | ||
327 | 492 | for row in self.rows(): | ||
328 | 493 | result_row = [row['name'], row['teacher']] | ||
329 | 494 | for day in row['days']: | ||
330 | 495 | result_row.append('') | ||
331 | 496 | for period in day: | ||
332 | 497 | value = period['value'] | ||
333 | 498 | result_row.append(value) | ||
334 | 499 | results.append(result_row) | ||
335 | 500 | return results | ||
336 | 501 | |||
337 | 196 | 502 | ||
338 | === modified file 'src/schooltool/zambia/app/browser/configure.zcml' | |||
339 | --- src/schooltool/zambia/app/browser/configure.zcml 2010-08-08 18:28:59 +0000 | |||
340 | +++ src/schooltool/zambia/app/browser/configure.zcml 2010-09-26 22:01:04 +0000 | |||
341 | @@ -52,6 +52,36 @@ | |||
342 | 52 | title="Teachers Timetable" | 52 | title="Teachers Timetable" |
343 | 53 | order="50" | 53 | order="50" |
344 | 54 | /> | 54 | /> |
345 | 55 | <navigationViewlet | ||
346 | 56 | name="subgroups_timetable.html" | ||
347 | 57 | for="schooltool.term.interfaces.ITerm" | ||
348 | 58 | manager="schooltool.skin.IActionMenuManager" | ||
349 | 59 | template="templates/actionsViewlet.pt" | ||
350 | 60 | permission="schooltool.edit" | ||
351 | 61 | link="subgroups_timetable.html" | ||
352 | 62 | title="Subgroups Timetable" | ||
353 | 63 | order="60" | ||
354 | 64 | /> | ||
355 | 65 | <navigationViewlet | ||
356 | 66 | name="teachers_timetable.pdf" | ||
357 | 67 | for="schooltool.term.interfaces.ITerm" | ||
358 | 68 | manager="schooltool.skin.IActionMenuManager" | ||
359 | 69 | template="templates/actionsViewlet.pt" | ||
360 | 70 | permission="schooltool.edit" | ||
361 | 71 | link="teachers_timetable.pdf" | ||
362 | 72 | title="Teachers PDF" | ||
363 | 73 | order="50" | ||
364 | 74 | /> | ||
365 | 75 | <navigationViewlet | ||
366 | 76 | name="subgroups_timetable.pdf" | ||
367 | 77 | for="schooltool.term.interfaces.ITerm" | ||
368 | 78 | manager="schooltool.skin.IActionMenuManager" | ||
369 | 79 | template="templates/actionsViewlet.pt" | ||
370 | 80 | permission="schooltool.edit" | ||
371 | 81 | link="subgroups_timetable.pdf" | ||
372 | 82 | title="Subgroups PDF" | ||
373 | 83 | order="60" | ||
374 | 84 | /> | ||
375 | 55 | </configure> | 85 | </configure> |
376 | 56 | 86 | ||
377 | 57 | <page | 87 | <page |
378 | @@ -70,5 +100,27 @@ | |||
379 | 70 | permission="schooltool.edit" | 100 | permission="schooltool.edit" |
380 | 71 | layer="schooltool.zambia.app.skin.ISchoolToolZambiaLayer" | 101 | layer="schooltool.zambia.app.skin.ISchoolToolZambiaLayer" |
381 | 72 | /> | 102 | /> |
382 | 103 | <page | ||
383 | 104 | name="subgroups_timetable.html" | ||
384 | 105 | for="schooltool.term.interfaces.ITerm" | ||
385 | 106 | class="schooltool.zambia.app.browser.app.SubgroupsTimetableView" | ||
386 | 107 | template="templates/subgroups_timetable.pt" | ||
387 | 108 | permission="schooltool.edit" | ||
388 | 109 | layer="schooltool.zambia.app.skin.ISchoolToolZambiaLayer" | ||
389 | 110 | /> | ||
390 | 111 | <page | ||
391 | 112 | name="teachers_timetable.pdf" | ||
392 | 113 | for="schooltool.term.interfaces.ITerm" | ||
393 | 114 | class="schooltool.zambia.app.browser.app.TeachersTimetablePDFView" | ||
394 | 115 | permission="schooltool.edit" | ||
395 | 116 | layer="schooltool.zambia.app.skin.ISchoolToolZambiaLayer" | ||
396 | 117 | /> | ||
397 | 118 | <page | ||
398 | 119 | name="subgroups_timetable.pdf" | ||
399 | 120 | for="schooltool.term.interfaces.ITerm" | ||
400 | 121 | class="schooltool.zambia.app.browser.app.SubgroupsTimetablePDFView" | ||
401 | 122 | permission="schooltool.edit" | ||
402 | 123 | layer="schooltool.zambia.app.skin.ISchoolToolZambiaLayer" | ||
403 | 124 | /> | ||
404 | 73 | 125 | ||
405 | 74 | </configure> | 126 | </configure> |
406 | 75 | 127 | ||
407 | === modified file 'src/schooltool/zambia/app/browser/resources/zambia.css' | |||
408 | --- src/schooltool/zambia/app/browser/resources/zambia.css 2010-08-08 18:28:59 +0000 | |||
409 | +++ src/schooltool/zambia/app/browser/resources/zambia.css 2010-09-26 22:01:04 +0000 | |||
410 | @@ -51,6 +51,26 @@ | |||
411 | 51 | text-align: center; | 51 | text-align: center; |
412 | 52 | } | 52 | } |
413 | 53 | 53 | ||
414 | 54 | .sg_cell { | ||
415 | 55 | height: 3.5em; | ||
416 | 56 | padding: .2em; | ||
417 | 57 | margin: 0em; | ||
418 | 58 | border-left: thin solid gray; | ||
419 | 59 | border-right: thin solid gray; | ||
420 | 60 | color: black; | ||
421 | 61 | text-align: center; | ||
422 | 62 | } | ||
423 | 63 | |||
424 | 64 | .sg_cell_left { | ||
425 | 65 | height: 3.5em; | ||
426 | 66 | padding: .2em; | ||
427 | 67 | margin: 0em; | ||
428 | 68 | border-left: 3px solid gray; | ||
429 | 69 | border-right: thin solid gray; | ||
430 | 70 | color: black; | ||
431 | 71 | text-align: center; | ||
432 | 72 | } | ||
433 | 73 | |||
434 | 54 | .border_top { | 74 | .border_top { |
435 | 55 | border-top: thin solid gray; | 75 | border-top: thin solid gray; |
436 | 56 | } | 76 | } |
437 | 57 | 77 | ||
438 | === added file 'src/schooltool/zambia/app/browser/templates/subgroups_timetable.pt' | |||
439 | --- src/schooltool/zambia/app/browser/templates/subgroups_timetable.pt 1970-01-01 00:00:00 +0000 | |||
440 | +++ src/schooltool/zambia/app/browser/templates/subgroups_timetable.pt 2010-09-26 22:01:04 +0000 | |||
441 | @@ -0,0 +1,55 @@ | |||
442 | 1 | <tal:tag condition="view/update" /> | ||
443 | 2 | <html metal:use-macro="view/@@standard_macros/page" i18n:domain="schooltool.gradebook"> | ||
444 | 3 | <head> | ||
445 | 4 | <title metal:fill-slot="title" i18n:translate="">Subgroups Timetable</title> | ||
446 | 5 | </head> | ||
447 | 6 | <body> | ||
448 | 7 | |||
449 | 8 | <h1 metal:fill-slot="content-header" | ||
450 | 9 | i18n:translate="">Subgroups Timetable</h1> | ||
451 | 10 | |||
452 | 11 | <metal:block metal:fill-slot="body"> | ||
453 | 12 | |||
454 | 13 | <h1 tal:condition="view/error_message" | ||
455 | 14 | tal:content="view/error_message" /> | ||
456 | 15 | |||
457 | 16 | <table tal:condition="not: view/error_message" class="teachers_timetable"> | ||
458 | 17 | <tr> | ||
459 | 18 | <th class="heading odd"></th> | ||
460 | 19 | <th class="heading odd"></th> | ||
461 | 20 | <th tal:repeat="day view/days" class="heading_left odd" | ||
462 | 21 | tal:content="day/text" | ||
463 | 22 | tal:attributes="colspan day/span" /> | ||
464 | 23 | </tr> | ||
465 | 24 | |||
466 | 25 | <tr> | ||
467 | 26 | <th class="heading odd" i18n:translate="">Subgroup</th> | ||
468 | 27 | <th class="heading odd" i18n:translate="">Teacher</th> | ||
469 | 28 | <tal:block repeat="day view/days"> | ||
470 | 29 | <th tal:repeat="period day/periods" | ||
471 | 30 | tal:attributes="class period/class" | ||
472 | 31 | tal:content="period/value" /> | ||
473 | 32 | </tal:block> | ||
474 | 33 | </tr> | ||
475 | 34 | |||
476 | 35 | <tal:block repeat="row view/rows"> | ||
477 | 36 | <tr> | ||
478 | 37 | <td tal:attributes="class row/class"> | ||
479 | 38 | <span tal:content="row/name" /> | ||
480 | 39 | </td> | ||
481 | 40 | <td tal:attributes="class row/class"> | ||
482 | 41 | <span tal:content="row/teacher" /> | ||
483 | 42 | </td> | ||
484 | 43 | <tal:block repeat="day row/days"> | ||
485 | 44 | <td tal:repeat="period day" | ||
486 | 45 | tal:attributes="class period/class" | ||
487 | 46 | tal:content="period/value" /> | ||
488 | 47 | </tal:block> | ||
489 | 48 | </tr> | ||
490 | 49 | </tal:block> | ||
491 | 50 | |||
492 | 51 | </table> | ||
493 | 52 | |||
494 | 53 | </metal:block> | ||
495 | 54 | </body> | ||
496 | 55 | </html> | ||
497 | 0 | 56 | ||
498 | === added file 'src/schooltool/zambia/app/browser/templates/subgroups_timetable_pdf.pt' | |||
499 | --- src/schooltool/zambia/app/browser/templates/subgroups_timetable_pdf.pt 1970-01-01 00:00:00 +0000 | |||
500 | +++ src/schooltool/zambia/app/browser/templates/subgroups_timetable_pdf.pt 2010-09-26 22:01:04 +0000 | |||
501 | @@ -0,0 +1,88 @@ | |||
502 | 1 | <?xml version="1.0" standalone="no" ?> | ||
503 | 2 | <!DOCTYPE document SYSTEM "rml_1_0.dtd" [ | ||
504 | 3 | <!ENTITY pound "£"> | ||
505 | 4 | <!ENTITY nbsp " "> | ||
506 | 5 | ]> | ||
507 | 6 | |||
508 | 7 | <document | ||
509 | 8 | xmlns:tal="http://xml.zope.org/namespaces/tal" | ||
510 | 9 | xmlns:metal="http://xml.zope.org/namespaces/metal" | ||
511 | 10 | xmlns:i18n="http://xml.zope.org/namespaces/i18n" | ||
512 | 11 | metal:use-macro="context/@@rml_macros/report" | ||
513 | 12 | i18n:domain="schooltool.zambia"> | ||
514 | 13 | |||
515 | 14 | <metal:block fill-slot="page_templates"> | ||
516 | 15 | <tal:block content="structure view/use_template/default" /> | ||
517 | 16 | </metal:block> | ||
518 | 17 | |||
519 | 18 | <stylesheet> | ||
520 | 19 | <metal:block fill-slot="extra_initialize"> | ||
521 | 20 | </metal:block> | ||
522 | 21 | <metal:block fill-slot="stylesheet"> | ||
523 | 22 | |||
524 | 23 | <paraStyle | ||
525 | 24 | name="heading" | ||
526 | 25 | fontName="Arial_Bold" | ||
527 | 26 | fontSize="9" | ||
528 | 27 | alignment="center" | ||
529 | 28 | leading="12"/> | ||
530 | 29 | |||
531 | 30 | <paraStyle | ||
532 | 31 | name="cell" | ||
533 | 32 | fontName="Arial_Normal" | ||
534 | 33 | fontSize="6" | ||
535 | 34 | alignment="center" | ||
536 | 35 | leading="7"/> | ||
537 | 36 | |||
538 | 37 | <blockTableStyle id="headings_table"> | ||
539 | 38 | <blockValign value="middle" start="0,0" stop="0,-1"/> | ||
540 | 39 | </blockTableStyle> | ||
541 | 40 | |||
542 | 41 | <blockTableStyle id="grid"> | ||
543 | 42 | <lineStyle kind="OUTLINE" | ||
544 | 43 | colorName="black" thickness="0.25" | ||
545 | 44 | start="0,0" stop="-1,-1" /> | ||
546 | 45 | <lineStyle kind="INNERGRID" | ||
547 | 46 | colorName="black" thickness="0.25" | ||
548 | 47 | start="0,0" stop="-1,-1" /> | ||
549 | 48 | <blockValign value="middle" start="0,0" stop="0,-1"/> | ||
550 | 49 | </blockTableStyle> | ||
551 | 50 | </metal:block> | ||
552 | 51 | </stylesheet> | ||
553 | 52 | |||
554 | 53 | <story metal:fill-slot="story"> | ||
555 | 54 | |||
556 | 55 | <blockTable style="headings_table" | ||
557 | 56 | tal:attributes="colWidths view/heading_widths1" | ||
558 | 57 | alignment="left"> | ||
559 | 58 | <tr> | ||
560 | 59 | <td tal:repeat="heading view/headings1"> | ||
561 | 60 | <para style="heading" tal:content="heading" /> | ||
562 | 61 | </td> | ||
563 | 62 | </tr> | ||
564 | 63 | </blockTable> | ||
565 | 64 | |||
566 | 65 | <blockTable style="grid" | ||
567 | 66 | tal:attributes="colWidths view/heading_widths2" | ||
568 | 67 | alignment="left"> | ||
569 | 68 | <tr> | ||
570 | 69 | <td tal:repeat="heading view/headings2" vAlign="middle"> | ||
571 | 70 | <para style="heading" tal:content="heading" /> | ||
572 | 71 | </td> | ||
573 | 72 | </tr> | ||
574 | 73 | </blockTable> | ||
575 | 74 | |||
576 | 75 | <blockTable style="grid" | ||
577 | 76 | tal:attributes="colWidths view/heading_widths2; | ||
578 | 77 | rowHeights view/row_heights" | ||
579 | 78 | alignment="left"> | ||
580 | 79 | <tr tal:repeat="row view/pdf_rows"> | ||
581 | 80 | <td tal:repeat="cell row" vAlign="middle"> | ||
582 | 81 | <para style="cell" tal:content="cell" /> | ||
583 | 82 | </td> | ||
584 | 83 | </tr> | ||
585 | 84 | </blockTable> | ||
586 | 85 | |||
587 | 86 | </story> | ||
588 | 87 | |||
589 | 88 | </document> | ||
590 | 0 | 89 | ||
591 | === modified file 'src/schooltool/zambia/app/browser/templates/teachers_timetable.pt' | |||
592 | --- src/schooltool/zambia/app/browser/templates/teachers_timetable.pt 2010-08-08 18:28:59 +0000 | |||
593 | +++ src/schooltool/zambia/app/browser/templates/teachers_timetable.pt 2010-09-26 22:01:04 +0000 | |||
594 | @@ -23,13 +23,13 @@ | |||
595 | 23 | </tr> | 23 | </tr> |
596 | 24 | 24 | ||
597 | 25 | <tr> | 25 | <tr> |
599 | 26 | <th class="heading odd">Teacher</th> | 26 | <th class="heading odd" i18n:translate="">Teacher</th> |
600 | 27 | <tal:block repeat="day view/days"> | 27 | <tal:block repeat="day view/days"> |
601 | 28 | <th tal:repeat="period day/periods" | 28 | <th tal:repeat="period day/periods" |
602 | 29 | tal:attributes="class period/class" | 29 | tal:attributes="class period/class" |
603 | 30 | tal:content="period/value" /> | 30 | tal:content="period/value" /> |
604 | 31 | </tal:block> | 31 | </tal:block> |
606 | 32 | <th class="heading_left odd">Periods</th> | 32 | <th class="heading_left odd" i18n:translate="">Periods</th> |
607 | 33 | </tr> | 33 | </tr> |
608 | 34 | 34 | ||
609 | 35 | <tal:block repeat="row view/rows"> | 35 | <tal:block repeat="row view/rows"> |
610 | 36 | 36 | ||
611 | === added file 'src/schooltool/zambia/app/browser/templates/teachers_timetable_pdf.pt' | |||
612 | --- src/schooltool/zambia/app/browser/templates/teachers_timetable_pdf.pt 1970-01-01 00:00:00 +0000 | |||
613 | +++ src/schooltool/zambia/app/browser/templates/teachers_timetable_pdf.pt 2010-09-26 22:01:04 +0000 | |||
614 | @@ -0,0 +1,88 @@ | |||
615 | 1 | <?xml version="1.0" standalone="no" ?> | ||
616 | 2 | <!DOCTYPE document SYSTEM "rml_1_0.dtd" [ | ||
617 | 3 | <!ENTITY pound "£"> | ||
618 | 4 | <!ENTITY nbsp " "> | ||
619 | 5 | ]> | ||
620 | 6 | |||
621 | 7 | <document | ||
622 | 8 | xmlns:tal="http://xml.zope.org/namespaces/tal" | ||
623 | 9 | xmlns:metal="http://xml.zope.org/namespaces/metal" | ||
624 | 10 | xmlns:i18n="http://xml.zope.org/namespaces/i18n" | ||
625 | 11 | metal:use-macro="context/@@rml_macros/report" | ||
626 | 12 | i18n:domain="schooltool.zambia"> | ||
627 | 13 | |||
628 | 14 | <metal:block fill-slot="page_templates"> | ||
629 | 15 | <tal:block content="structure view/use_template/default" /> | ||
630 | 16 | </metal:block> | ||
631 | 17 | |||
632 | 18 | <stylesheet> | ||
633 | 19 | <metal:block fill-slot="extra_initialize"> | ||
634 | 20 | </metal:block> | ||
635 | 21 | <metal:block fill-slot="stylesheet"> | ||
636 | 22 | |||
637 | 23 | <paraStyle | ||
638 | 24 | name="heading" | ||
639 | 25 | fontName="Arial_Bold" | ||
640 | 26 | fontSize="9" | ||
641 | 27 | alignment="center" | ||
642 | 28 | leading="12"/> | ||
643 | 29 | |||
644 | 30 | <paraStyle | ||
645 | 31 | name="cell" | ||
646 | 32 | fontName="Arial_Normal" | ||
647 | 33 | fontSize="6" | ||
648 | 34 | alignment="center" | ||
649 | 35 | leading="7"/> | ||
650 | 36 | |||
651 | 37 | <blockTableStyle id="headings_table"> | ||
652 | 38 | <blockValign value="top" start="0,0" stop="0,-1"/> | ||
653 | 39 | </blockTableStyle> | ||
654 | 40 | |||
655 | 41 | <blockTableStyle id="grid"> | ||
656 | 42 | <lineStyle kind="OUTLINE" | ||
657 | 43 | colorName="black" thickness="0.25" | ||
658 | 44 | start="0,0" stop="-1,-1" /> | ||
659 | 45 | <lineStyle kind="INNERGRID" | ||
660 | 46 | colorName="black" thickness="0.25" | ||
661 | 47 | start="0,0" stop="-1,-1" /> | ||
662 | 48 | <blockValign value="top" start="0,0" stop="0,-1"/> | ||
663 | 49 | </blockTableStyle> | ||
664 | 50 | </metal:block> | ||
665 | 51 | </stylesheet> | ||
666 | 52 | |||
667 | 53 | <story metal:fill-slot="story"> | ||
668 | 54 | |||
669 | 55 | <blockTable style="headings_table" | ||
670 | 56 | tal:attributes="colWidths view/heading_widths1" | ||
671 | 57 | alignment="left"> | ||
672 | 58 | <tr> | ||
673 | 59 | <td tal:repeat="heading view/headings1"> | ||
674 | 60 | <para style="heading" tal:content="heading" /> | ||
675 | 61 | </td> | ||
676 | 62 | </tr> | ||
677 | 63 | </blockTable> | ||
678 | 64 | |||
679 | 65 | <blockTable style="grid" | ||
680 | 66 | tal:attributes="colWidths view/heading_widths2" | ||
681 | 67 | alignment="left"> | ||
682 | 68 | <tr> | ||
683 | 69 | <td tal:repeat="heading view/headings2"> | ||
684 | 70 | <para style="heading" tal:content="heading" /> | ||
685 | 71 | </td> | ||
686 | 72 | </tr> | ||
687 | 73 | </blockTable> | ||
688 | 74 | |||
689 | 75 | <blockTable style="grid" | ||
690 | 76 | tal:attributes="colWidths view/heading_widths2; | ||
691 | 77 | rowHeights view/row_heights" | ||
692 | 78 | alignment="left"> | ||
693 | 79 | <tr tal:repeat="row view/pdf_rows"> | ||
694 | 80 | <td tal:repeat="cell row" vAlign="middle"> | ||
695 | 81 | <para style="cell" tal:content="cell" /> | ||
696 | 82 | </td> | ||
697 | 83 | </tr> | ||
698 | 84 | </blockTable> | ||
699 | 85 | |||
700 | 86 | </story> | ||
701 | 87 | |||
702 | 88 | </document> |