source: waeup_product/trunk/skins/waeup_default/getWAeUPLayouts.py @ 142

Last change on this file since 142 was 142, checked in by joachim, 19 years ago

=added register_level

  • Property svn:keywords set to Id
File size: 38.9 KB
Line 
1#-*- mode: python; mode: fold -*-
2##parameters=
3# $Id: getWAeUPLayouts.py 142 2005-11-02 18:04:59Z joachim $
4"""Return custom layouts types."""
5
6##    'widgets': { ###(
7##        '': {
8##            'type': 'String Widget',
9##            'data': {
10##                'title': '',
11##                'fields': ('',),
12##                'is_required': False,
13##                'label': '',
14##                'label_edit': '',
15##                'description': '',
16##                'help': '',
17##                'is_i18n': False,
18##                'readonly_layout_modes': (),
19##                'hidden_layout_modes': (),
20##                'hidden_readonly_layout_modes': (),
21##                'hidden_empty': False,
22##                'hidden_if_expr': '',
23##                'css_class': '',
24##                'widget_mode_expr': '',
25##                'display_width': 10,
26##                'size_max': 0,
27##            },
28
29###)
30
31Heading = { ###(
32         'type': 'Heading Widget',
33         'data': {
34                'fields': ['heading'],
35                'level': 1,
36                'is_i18n': 0,
37                'is_required': 1,
38                'label_edit': 'Headline',
39                'help': 'a short headline',
40                'display_width': 40,
41                'size_max': 200,
42            },
43        }###)
44
45Text = { ###(
46            'type': 'Text Widget',
47            'data': {
48                'fields': ['text'],
49                'is_i18n': 1,
50                'label_edit': 'Text',
51                'label': 'Text',
52                'help': 'a short Description',
53                'css_class': 'description',
54                'width': 72,
55                'height': 5,
56                'render_format': 'text',
57                'hidden_layout_modes': (),
58            },
59        }###)
60
61Title = { ###(
62         'type': 'String Widget',
63         'data': {
64                'fields': ['Title'],
65                'level': 1,
66                'is_i18n': 0,
67                'is_required': 1,
68                'label': 'Title',
69                'label_edit': 'Title',
70                'display_width': 40,
71                'size_max': 200,
72            },
73        }###)
74
75Description = { ###(
76            'type': 'Text Widget',
77            'data': {
78                'fields': ['Description'],
79                'is_i18n': 1,
80                'label_edit': 'Description',
81                'label': 'Description',
82                'css_class': 'description',
83                'width': 72,
84                'height': 5,
85                'render_format': 'text',
86                'hidden_layout_modes': (),
87            },
88        }###)
89
90common_layout = {###(
91    'widgets': {
92        'LanguageSelector': {
93            'type': 'Document Language Select Widget',
94            'data': {
95                'fields': ['Language'],
96            },
97        },
98        'Title': Title,
99        'Description': Description,
100        'LanguageSelectorCreation': {
101            'type': 'Select Widget',
102            'data': {
103                'title': 'Language',
104                'fields': ('Language',),
105                'is_required': 0,
106                'label': 'label_language',
107                'label_edit': 'label_language',
108                'description': '',
109                'help': '',
110                'is_i18n': 0,
111                'readonly_layout_modes': (),
112                'hidden_layout_modes': ('create','edit', 'view'),
113                'hidden_readonly_layout_modes': (),
114                'hidden_empty': 0,
115                'hidden_if_expr': '',
116                'css_class': '',
117                'vocabulary': 'language_voc',
118            },
119        },
120    },
121    'layout': {
122        'style_prefix': 'layout_waeup_',
123        'rows': [
124            #[{'widget_id': 'LanguageSelector'}],
125            [{'widget_id': 'Title'},],
126            [{'widget_id': 'Description'},],
127            #[{'widget_id': 'LanguageSelectorCreation'}],
128            ],
129        },
130    }
131#
132###)
133
134student_layout = { ###(
135    'widgets': {
136        'jamb_is_admitted': {
137            'type': 'Boolean Widget',
138            'data': {
139                'title': 'JAMB Admission',
140                'fields': ('jamb_is_admitted',),
141                'is_required': False,
142                'label': 'JAMB Admission',
143                'label_edit': 'JAMB Admission',
144                'description': '',
145                'help': '',
146                'is_i18n': False,
147                'readonly_layout_modes': (),
148                'hidden_layout_modes': (),
149                'hidden_readonly_layout_modes': (),
150                'hidden_empty': False,
151                'hidden_if_expr': '',
152                'css_class': '',
153                'widget_mode_expr': '',
154                'display_width': 10,
155                'size_max': 0,
156            },
157        },
158##        'jamb_where_admitted': {
159##            'type': 'String Widget',
160##            'data': {
161##                'title': 'Jamb Admission Location',
162##                'fields': ('jamb_where_admitted',),
163##                'is_required': False,
164##                'label': 'University',
165##                'label_edit': 'University',
166##                'description': '',
167##                'help': '',
168##                'is_i18n': False,
169##                'readonly_layout_modes': (),
170##                'hidden_layout_modes': (),
171##                'hidden_readonly_layout_modes': (),
172##                'hidden_empty': False,
173##                'hidden_if_expr': '',
174##                'css_class': '',
175##                'widget_mode_expr': '',
176##                'display_width': 10,
177##                'size_max': 0,
178##            },
179##        },
180        'faculty': {
181            'type': 'String Widget',
182            'data': {
183                'title': 'Faculty',
184                'fields': ('faculty',),
185                'is_required': False,
186                'label': 'Faculty',
187                'label_edit': 'Faculty',
188                'description': '',
189                'help': '',
190                'is_i18n': False,
191                'readonly_layout_modes': (),
192                'hidden_layout_modes': (),
193                'hidden_readonly_layout_modes': (),
194                'hidden_empty': False,
195                'hidden_if_expr': '',
196                'css_class': '',
197                'widget_mode_expr': '',
198                'display_width': 10,
199                'size_max': 0,
200            },
201        },
202    },
203    'layout': {
204        'style_prefix': 'layout_default_',
205        'flexible_widgets': (),
206        'ncols': 1,
207        'rows': [
208            #[{'widget_id': 'jamb_is_admitted', 'ncols': 1},],
209            #[{'widget_id': 'jamb_where_admitted', 'ncols': 1},],
210            #[{'widget_id': 'jamb_pin_usage', 'ncols': 1},],
211            #[{'widget_id': 'faculty', 'ncols': 1},],
212        ]
213    },
214}
215###)
216
217firstname = { ###(
218            'type': 'String Widget',
219            'data': {
220                'title': 'First Name',
221                'fields': ('firstname',),
222                'is_required': False,
223                'label': 'First Name',
224                'label_edit': 'First Name',
225                'description': 'First Name',
226                'help': 'First name',
227                'is_i18n': False,
228                'display_width': 40,
229                },
230            }
231middlename = {
232            'type': 'String Widget',
233            'data': {
234                'title': '',
235                'fields': ('middlename',),
236                'is_required': False,
237                'label': 'Middle Name',
238                'label_edit': 'Middle Name',
239                'description': '',
240                'help': 'middle name',
241                'is_i18n': False,
242                'readonly_layout_modes': (),
243                'hidden_layout_modes': (),
244                'hidden_readonly_layout_modes': (),
245                'hidden_empty': True,
246                'hidden_if_expr': '',
247                'css_class': '',
248                'widget_mode_expr': '',
249                'display_width': 40,
250                'size_max': 0,
251                },
252            }
253
254lastname = {
255            'type': 'String Widget',
256            'data': {
257                'title': '',
258                'fields': ('lastname',),
259                'is_required': False,
260                'label': 'Surname',
261                'label_edit': 'Surname',
262                'description': '',
263                'help': 'Surname',
264                'is_i18n': False,
265                'readonly_layout_modes': (),
266                'hidden_layout_modes': (),
267                'hidden_readonly_layout_modes': (),
268                'hidden_empty': False,
269                'hidden_if_expr': '',
270                'css_class': '',
271                'widget_mode_expr': '',
272                'display_width': 40,
273                'size_max': 0,
274            },
275        }
276sex = {
277            'type': 'Boolean Widget',
278            'data': {
279                'title': '',
280                'fields': ('sex',),
281                'is_required': False,
282                'label': 'Sex',
283                'label_edit': 'Sex',
284                'label_false': 'male',
285                'label_true': 'female',
286                'description': '',
287                'help': '',
288                'is_i18n': False,
289                'readonly_layout_modes': (),
290                'hidden_layout_modes': (),
291                'hidden_readonly_layout_modes': (),
292                'hidden_empty': False,
293                'hidden_if_expr': '',
294                'css_class': '',
295                'widget_mode_expr': '',
296                'display_width': 20,
297                'size_max': 0,
298            }
299        }
300
301###)
302
303student_personal_layout = { ###(
304    'widgets': {
305        'firstname': firstname,
306        'middlename': middlename,
307        'lastname': lastname,
308        'sex': sex,
309        'birthday': {
310            'type': 'Date Widget',
311            'data': {
312                'title': '',
313                'fields': ('birthday',),
314                'is_required': False,
315                'label': '',
316                'label_edit': 'Day of birth',
317                'description': 'Day of birth',
318                'help': '',
319                'is_i18n': False,
320                'readonly_layout_modes': (),
321                'hidden_layout_modes': (),
322                'hidden_readonly_layout_modes': (),
323                'hidden_empty': False,
324                'hidden_if_expr': '',
325                'css_class': '',
326                'widget_mode_expr': '',
327                'display_width': 10,
328                'size_max': 0,
329            },
330        },
331    },
332    'layout': {
333        'style_prefix': 'layout_personal_',
334        'flexible_widgets': (),
335        'ncols': 1,
336        'rows': [
337            [{'widget_id': 'firstname', 'ncols': 1},],
338            [{'widget_id': 'middlename', 'ncols': 1},],
339            [{'widget_id': 'lastname', 'ncols': 1},],
340            [{'widget_id': 'sex', 'ncols': 1},],
341            [{'widget_id': 'birthday', 'ncols': 1},],
342        ]
343    },
344}
345
346###)
347
348scratch_card = { ###(
349    'widgets': {
350        'sc_id': {
351            'type': 'String Widget',
352            'data': {
353                'title': 'SC ID',
354                'fields': ('sc_id',),
355                'is_required': True,
356                'label': 'Scratch card ID',
357                'label_edit': 'Scratch card ID',
358                'description': '',
359                'help': '',
360                'is_i18n': False,
361                'readonly_layout_modes': (),
362                'hidden_layout_modes': (),
363                'hidden_readonly_layout_modes': (),
364                'hidden_empty': False,
365                'hidden_if_expr': '',
366                'css_class': '',
367                'widget_mode_expr': '',
368                'display_width': 10,
369                'size_max': 0,
370            },
371        },
372        'sc_pin': {
373            'type': 'Scratchcard Pin Widget',
374            'data': {
375                'title': 'SC Pin',
376                'fields': ('sc_pin'),
377                'is_required': True,
378                'label': 'Scratchcard Pin',
379                'label_edit': 'Scratchcard Pin',
380                'description': '',
381                'help': 'Please enter a valid Scratch card pin',
382                'is_i18n': False,
383                'readonly_layout_modes': (),
384                'hidden_layout_modes': (),
385                'hidden_readonly_layout_modes': (),
386                'hidden_empty': False,
387                'hidden_if_expr': '',
388                'css_class': '',
389                'widget_mode_expr': '',
390                'display_width': 10,
391                'size_max': 10,
392            },
393        },
394    },
395   'layout': {
396        'style_prefix': 'layout_default_',
397        'flexible_widgets': (),
398        'ncols': 1,
399        'rows': [
400            [{'widget_id': 'reg_nr', 'ncols': 1},],
401            [{'widget_id': 'sc_pin', 'ncols': 1},],
402        ]
403    },
404}
405###)
406
407jamb_id = { ###(
408           'type': 'StudentId Widget',
409           'data': {
410                'title': 'Registration Number',
411                'fields': ('reg_nr'),
412                'is_required': True,
413                'label': 'Registration Number',
414                'label_edit': 'Registration Number',
415                'description': '',
416                'help': 'This is the combination of 8 digits and 2 letters you are assigned when you purchase an examination form.',
417                'is_i18n': False,
418                'readonly_layout_modes': (),
419                'hidden_layout_modes': (),
420                'hidden_readonly_layout_modes': (),
421                'hidden_empty': False,
422                'hidden_if_expr': '',
423                'css_class': '',
424                'widget_mode_expr': '',
425                'display_width': 10,
426                'size_max': 10,
427                 },
428           }
429
430###)
431
432admission = { ###(
433    'widgets': {
434        'sc_id': {
435            'type': 'String Widget',
436            'data': {
437                'title': 'SC ID',
438                'fields': ('admission_sc_id',),
439                'is_required': False,
440                'label': 'Card Serial Number ',
441                'label_edit': 'Card Serial Number',
442                'description': 'Card Serial Number ',
443                'help': 'This can be found on the bottom right of the reverse side of your Scratch Card',
444                'is_i18n': False,
445                'readonly_layout_modes': (),
446                'hidden_layout_modes': (),
447                'hidden_readonly_layout_modes': (),
448                'hidden_empty': False,
449                'hidden_if_expr': 'python:1',
450                'css_class': '',
451                'widget_mode_expr': '',
452                'display_width': 10,
453                'size_max': 0,
454            },
455        },
456        'sc_pin': {
457            'type': 'Scratchcard Pin Widget',
458            'data': {
459                'title': 'SC Pin',
460                'fields': ('admission_sc_pin'),
461                'is_required': True,
462                'label': 'PIN',
463                'label_edit': 'PIN',
464                'description': '',
465                'help': 'PIN-(Personal Identification Number) is an 8 or 12 digit number on the reverse side of the scratch card which you can purchase from many Banks',
466                'is_i18n': False,
467                'readonly_layout_modes': (),
468                'hidden_layout_modes': (),
469                'hidden_readonly_layout_modes': (),
470                'hidden_empty': False,
471                'hidden_if_expr': '',
472                'css_class': '',
473                'widget_mode_expr': '',
474                'display_width': 10,
475                'size_max': 10,
476            },
477        },
478        'jamb_id' : jamb_id,
479    },
480   'layout': {
481        'style_prefix': 'layout_admission_',
482        'flexible_widgets': (),
483        'ncols': 1,
484        'rows': [
485            [{'widget_id': 'sc_id', 'ncols': 1},],
486            [{'widget_id': 'sc_pin', 'ncols': 1},],
487            [{'widget_id': 'jamb_id', 'ncols': 1},],
488        ]
489    },
490}
491###)
492
493admission_status = { ###(
494    'widgets': {
495       'quick_search': {
496            'type': 'String Widget',
497            'data': {
498                'title': 'A search string',
499                'fields': ('admission_sc_id',),
500                'is_required': False,
501                'label': 'Quick Search',
502                'label_edit': 'Quick Search',
503                'description': 'Search',
504                'help': '',
505                'is_i18n': False,
506                'readonly_layout_modes': (),
507                'hidden_layout_modes': (),
508                'hidden_readonly_layout_modes': (),
509                'hidden_empty': False,
510                'hidden_if_expr': 'python:0',
511                'css_class': '',
512                'widget_mode_expr': '',
513                'display_width': 20,
514                'size_max': 0,
515            },
516        },
517
518    },
519   'layout': {
520        'style_prefix': 'layout_admission_status_',
521        'flexible_widgets': (),
522        'ncols': 2,
523        'rows': [
524            [{'widget_id': 'quick_search', 'ncols': 2},],
525        ]
526    },
527}
528###)
529
530jamb_widgets = { ###(
531        'reg_nr': {
532            'type': 'StudentId Widget',
533            'data': {
534                'title': 'registration nr',
535                'fields': ('reg_nr',),
536                'is_required': True,
537                'label': 'Registration Nr',
538                'label_edit': 'Registration Nr',
539                'description': 'The student id from JAMB',
540                'help': 'The student id from JAMB',
541                'is_i18n': False,
542                'display_width': 10,
543                'size_max': 10,
544            },
545        },
546        'firstname': firstname,
547        'middlename': middlename,
548        'lastname': lastname,
549        'age': {
550            'type': 'Int Widget',
551            'data': {
552                'title': '',
553                'fields': ('age',),
554                'is_required': False,
555                'label': 'Age',
556                'label_edit': 'Age',
557                'description': '',
558                'help': '',
559                'is_i18n': False,
560                'readonly_layout_modes': (),
561                'hidden_layout_modes': (),
562                'hidden_readonly_layout_modes': (),
563                'hidden_empty': False,
564                'hidden_if_expr': '',
565                'css_class': '',
566                'widget_mode_expr': '',
567                'display_width': 2,
568                'size_max': 2,
569            },
570        },
571        'sex': sex,
572        'state': {
573            'type': 'Select Widget',
574            'data': {
575                'title': '',
576                'fields': ('state',),
577                'is_required': False,
578                'label': 'State of Origin',
579                'label_edit': 'State of Origin',
580                'description': '',
581                'help': '',
582                'is_i18n': False,
583                'vocabulary': 'nigerian_states',
584            },
585        },
586        'exam_results': {
587            'type': 'String Widget',
588            'data': {
589                'title': '',
590                'fields': ('exam_results',),
591                'is_required': False,
592                'label': 'JAMB Results',
593                'label_edit': 'JAMB Results',
594                'description': '',
595                'help': '',
596                'is_i18n': False,
597                'readonly_layout_modes': (),
598                'hidden_layout_modes': (),
599                'hidden_readonly_layout_modes': (),
600                'hidden_empty': False,
601                'hidden_if_expr': '',
602                'css_class': '',
603                'widget_mode_expr': '',
604                'display_width': 20,
605                'size_max': 0,
606            },
607        },
608        'aggregate': {
609            'type': 'Int Widget',
610            'data': {
611                'title': 'Agregate',
612                'fields': ('aggregate',),
613                'is_required': False,
614                'label': 'Score',
615                'label_edit': 'Score',
616                'description': '',
617                'help': '',
618                'is_i18n': False,
619            },
620        },
621        'faculty': {
622            'type': 'Select Widget',
623            'data': {
624                'title': 'Faculty',
625                'fields': ('faculty',),
626                'is_required': True,
627                'label': 'Faculty',
628                'label_edit': 'Faculty',
629                'description': '',
630                'help': '',
631                'is_i18n': False,
632                'vocabulary': 'faculties',
633            },
634        },
635        'course': {
636            'type': 'String Widget',
637            'data': {
638                'title': 'Study Course',
639                'fields': ('course',),
640                'is_required': True,
641                'label': 'Study Course',
642                'label_edit': 'Study Course',
643                'description': '',
644                'help': 'The course to study',
645                'is_i18n': False,
646            },
647        },
648        'listing_date': {
649            'type': 'Date Widget',
650            'data': {
651                'title': 'Listing Date',
652                'fields': ('listing_date',),
653                'is_required': False,
654                'label': 'Listing Date',
655                'label_edit': 'Listing Date',
656                'description': '',
657                'help': '',
658                'is_i18n': False,
659                'readonly_layout_modes': (),
660                'hidden_layout_modes': (),
661                'hidden_readonly_layout_modes': (),
662                'hidden_empty': False,
663                'hidden_if_expr': '',
664                'css_class': '',
665                'widget_mode_expr': '',
666                'display_width': 3,
667                'size_max': 0,
668            },
669        },
670##        '2nd_choice': { ###(
671##            'type': 'String Widget',
672##            'data': {
673##                'title': 'Second choice',
674##                'fields': ('2nd_choice',),
675##                'is_required': False,
676##                'label': 'Second choice',
677##                'label_edit': 'Second choice',
678##                'description': '',
679##                'help': 'second_choice',
680##                'is_i18n': False,
681##                'readonly_layout_modes': (),
682##                'hidden_layout_modes': (),
683##                'hidden_readonly_layout_modes': (),
684##                'hidden_empty': False,
685##                'hidden_if_expr': '',
686##                'css_class': '',
687##                'widget_mode_expr': '',
688##                'display_width': 20,
689##                'size_max': 0,
690##            },
691##        },
692##
693##        '3rd_choice': {
694##            'type': 'String Widget',
695##            'data': {
696##                'title': 'Third_choice',
697##                'fields': ('3rd_choice',),
698##                'is_required': False,
699##                'label': 'Third choice',
700##                'label_edit': 'Third choice',
701##                'description': 'third_choice',
702##                'help': 'third_choice',
703##                'is_i18n': False,
704##                'readonly_layout_modes': (),
705##                'hidden_layout_modes': (),
706##                'hidden_readonly_layout_modes': (),
707##                'hidden_empty': False,
708##                'hidden_if_expr': '',
709##                'css_class': '',
710##                'widget_mode_expr': '',
711##                'display_width': 20,
712##                'size_max': 0,
713##            },
714##        },
715###)
716
717        'sc_id': {
718            'type': 'String Widget',
719            'data': {
720                'title': '',
721                'fields': ('admission_sc_id',),
722                'is_required': False,
723                'label': 'Scratch card ID used',
724                'label_edit': 'Scratch card ID used',
725                'description': '',
726                'help': '',
727                'is_i18n': False,
728                'readonly_layout_modes': (),
729                'hidden_layout_modes': (),
730                'hidden_readonly_layout_modes': (),
731                'hidden_empty': False,
732                'hidden_if_expr': '',
733                'css_class': '',
734                'widget_mode_expr': '',
735                'display_width': 20,
736                'size_max': 0,
737            },
738        },
739        'sc_pin': {
740            'type': 'String Widget',
741            'data': {
742                'title': '',
743                'fields': ('admission_sc_pin',),
744                'is_required': False,
745                'label': 'PIN Card Code',
746                'label_edit': 'PIN Card Code',
747                'description': '',
748                'help': '',
749                'is_i18n': False,
750                'readonly_layout_modes': (),
751                'hidden_layout_modes': (),
752                'hidden_readonly_layout_modes': (),
753                'hidden_empty': False,
754                'hidden_if_expr': '',
755                'css_class': '',
756                'widget_mode_expr': '',
757                'display_width': 20,
758                'size_max': 0,
759            },
760        },
761    }
762###)
763
764jamb_layoutcreate = { ###(
765    'widgets': jamb_widgets,
766    'layout': {
767        'style_prefix': 'layout_jambcreate_',
768        'flexible_widgets': (),
769        'ncols': 1,
770        'rows': [
771            [{'widget_id': 'reg_nr', 'ncols': 1},],
772            [{'widget_id': 'firstname', 'ncols': 1},],
773            [{'widget_id': 'middlename', 'ncols': 1},],
774            [{'widget_id': 'lastname', 'ncols': 1},],
775            #[{'widget_id': 'sc_id', 'ncols': 1},],
776            #[{'widget_id': 'sc_pin', 'ncols': 1},],
777            [{'widget_id': 'age', 'ncols': 1},],
778            [{'widget_id': 'sex', 'ncols': 1},],
779            [{'widget_id': 'state', 'ncols': 1},],
780            #[{'widget_id': 'exam_results', 'ncols': 1},],
781            [{'widget_id': 'aggregate', 'ncols': 1},],
782            [{'widget_id': 'faculty', 'ncols': 1},],
783            [{'widget_id': 'course', 'ncols': 1},],
784            [{'widget_id': 'listing_date', 'ncols': 1},],
785            #[{'widget_id': '2nd_choice', 'ncols': 1},],
786            #[{'widget_id': '3rd_choice', 'ncols': 1},],
787        ]
788    },
789}
790###)
791
792jamb_layout = { ###(
793    'widgets': jamb_widgets,
794    'layout': {
795        'style_prefix': 'layout_waeup_',
796        'flexible_widgets': (),
797        'ncols': 1,
798        'rows': [
799            [{'widget_id': 'reg_nr', 'ncols': 1},],
800            [{'widget_id': 'firstname', 'ncols': 1},],
801            [{'widget_id': 'middlename', 'ncols': 1},],
802            [{'widget_id': 'lastname', 'ncols': 1},],
803            #[{'widget_id': 'sc_id', 'ncols': 1},],
804            [{'widget_id': 'sc_pin', 'ncols': 1},],
805            [{'widget_id': 'age', 'ncols': 1},],
806            [{'widget_id': 'sex', 'ncols': 1},],
807            [{'widget_id': 'state', 'ncols': 1},],
808            #[{'widget_id': 'exam_results', 'ncols': 1},],
809            [{'widget_id': 'aggregate', 'ncols': 1},],
810            [{'widget_id': 'faculty', 'ncols': 1},],
811            [{'widget_id': 'course', 'ncols': 1},],
812            [{'widget_id': 'listing_date', 'ncols': 1},],
813            #[{'widget_id': '2nd_choice', 'ncols': 1},],
814            #[{'widget_id': '3rd_choice', 'ncols': 1},],
815        ]
816    },
817}
818###)
819
820course = { ###(
821    'widgets': {
822        'heading': {
823         'type': 'Heading Widget',
824         'data': {
825                'fields': ['heading'],
826                'level': 2,
827                'is_i18n': 0,
828                'is_required': 1,
829                'label': 'Title',
830                'label_edit': 'Title',
831                'help': 'Course Title',
832                'display_width': 40,
833                'size_max': 40,
834            },
835        },
836        'title': Title,
837        'text': Text,
838        'level': {
839            'type': 'Select Widget',
840            'data': {
841                'title': '',
842                'fields': ('level',),
843                'is_required': True,
844                'label': 'Level',
845                'label_edit': 'Level',
846                'description': '',
847                'help': '',
848                'is_i18n': False,
849                'vocabulary': 'courselevel',
850            },
851        },
852        'code': {
853            'type': 'String Widget',
854            'data': {
855                'title': 'Code',
856                'fields': ('code',),
857                'is_required': True,
858                'label': 'Code',
859                'label_edit': 'Code',
860                'description': '',
861                'help': '',
862                'is_i18n': False,
863                'display_width': 10,
864                'size_max': 0,
865            },
866        },
867        'semester': {
868            'type': 'Boolean Widget',
869            'data': {
870                'title': '',
871                'fields': ('semester',),
872                'is_required': True,
873                'label': 'Semester',
874                'label_edit': 'Semester',
875                'label_false': 'Second Semester',
876                'label_true': 'First Semester',
877                'description': '',
878                'help': '',
879                'is_i18n': False,
880                'display_width': 10,
881                'size_max': 0,
882            },
883        },
884        'credit': {
885            'type': 'Int Widget',
886            'data': {
887                'title': '',
888                'fields': ('credit',),
889                'is_required': True,
890                'label': 'Credit',
891                'label_edit': 'Credit',
892                'description': '',
893                'help': '',
894                'is_i18n': False,
895                'display_width': 2,
896                'size_max': 0,
897            },
898        },
899        'core_elective': {
900            'type': 'Boolean Widget',
901            'data': {
902                'title': '',
903                'fields': ('core_elective',),
904                'is_required': True,
905                'label': 'Core or elective',
906                'label_edit': 'Core or elective',
907                'label_true': 'Core Course',
908                'label_false': 'Elective Course',
909                'description': '',
910                'help': '',
911                'is_i18n': False,
912                'display_width': 10,
913                'size_max': 0,
914            },
915        },
916    },
917   'layout': {
918        'style_prefix': 'layout_waeup_',
919        'flexible_widgets': (),
920        'ncols': 1,
921        'rows': [
922            #[{'widget_id': 'heading', 'ncols': 1},],
923            [{'widget_id': 'title', 'ncols': 1},],
924            [{'widget_id': 'text', 'ncols': 1},],
925            [{'widget_id': 'level', 'ncols': 1},],
926            [{'widget_id': 'code', 'ncols': 1},],
927            [{'widget_id': 'semester', 'ncols': 1},],
928            [{'widget_id': 'credit', 'ncols': 1},],
929            [{'widget_id': 'core_elective', 'ncols': 1},],
930        ]
931    },
932}
933###)
934
935course_results = { ###(
936    'widgets': {
937        'points': {
938            'type': 'Int Widget',
939            'data': {
940                'title': '',
941                'fields': ('points',),
942                'is_required': False,
943                'label': 'Points',
944                'label_edit': 'Points',
945                'description': '',
946                'help': '',
947                'is_i18n': False,
948                'readonly_layout_modes': (),
949                'hidden_layout_modes': (),
950                'hidden_readonly_layout_modes': (),
951                'hidden_empty': False,
952                'hidden_if_expr': '',
953                'css_class': '',
954                'widget_mode_expr': '',
955                'display_width': 3,
956                'size_max': 3,
957            },
958        },
959        'grade': {
960            'type': 'String Widget',
961            'data': {
962                'title': '',
963                'fields': ('grade'),
964                'is_required': False,
965                'label': 'Grade',
966                'label_edit': 'Grade',
967                'description': '',
968                'help': '',
969                'is_i18n': False,
970                'readonly_layout_modes': (),
971                'hidden_layout_modes': (),
972                'hidden_readonly_layout_modes': (),
973                'hidden_empty': False,
974                'hidden_if_expr': '',
975                'css_class': '',
976                'widget_mode_expr': '',
977                'display_width': 2,
978                'size_max': 1,
979            },
980        },
981    },
982   'layout': {
983        'style_prefix': 'layout_default_',
984        'flexible_widgets': (),
985        'ncols': 1,
986        'rows': [
987            [{'widget_id': 'points', 'ncols': 1},],
988            [{'widget_id': 'grade', 'ncols': 1},],
989        ]
990    },
991}
992###)
993
994study_level = { ###(
995    'widgets': {
996        'Title': {
997            'type': 'Select Widget',
998            'data': {
999                'title': '',
1000                'fields': ('Title',),
1001                'is_required': False,
1002                'label': 'Study Level',
1003                'label_edit': 'Study Level',
1004                'description': '',
1005                'help': '',
1006                'vocabulary': 'courselevel',
1007                'is_i18n': False,
1008                'readonly_layout_modes': (),
1009                'hidden_layout_modes': (),
1010                'hidden_readonly_layout_modes': (),
1011                'hidden_empty': False,
1012                'hidden_if_expr': '',
1013                'css_class': '',
1014                'widget_mode_expr': '',
1015                'display_width': 20,
1016                'size_max': 0,
1017            },
1018        },
1019    },
1020   'layout': {
1021        'style_prefix': 'layout_waeup_',
1022        'flexible_widgets': (),
1023        'ncols': 1,
1024        'rows': [
1025            [{'widget_id': 'Title', 'ncols': 1},],
1026        ]
1027    },
1028}
1029###)
1030
1031accommodation = { ###(
1032    'widgets': {
1033        'heading': {
1034         'type': 'Heading Widget',
1035         'data': {
1036                'fields': ['heading'],
1037                'level': 2,
1038                'is_i18n': 0,
1039                'is_required': 1,
1040                'label': 'Hall Name',
1041                'label_edit': 'Hall Name',
1042                'help': '',
1043                'display_width': 40,
1044                'size_max': 40,
1045            },
1046        },
1047        'Title': Title,
1048        'text': Text,
1049        'which_sex': {
1050            'type': 'Boolean Widget',
1051            'data': {
1052                'title': '',
1053                'fields': ('which_sex',),
1054                'is_required': False,
1055                'label': 'Sex',
1056                'label_edit': 'Sex',
1057                'label_false': 'male',
1058                'label_true': 'female',
1059                'description': '',
1060                'help': '',
1061                'is_i18n': False,
1062            },
1063        },
1064        'nr_of_blocks': {
1065            'type': 'Select Widget',
1066            'data': {
1067                'title': '',
1068                'fields': ('nr_of_blocks',),
1069                'is_required': True,
1070                'label': 'Nr of Blocks',
1071                'label_edit': 'Nr of Blocks',
1072                'description': '',
1073                'help': 'Number of blocks',
1074                'is_i18n': False,
1075                'vocabulary': 'range10',
1076            },
1077        },
1078        'nr_of_floors': {
1079            'type': 'Select Widget',
1080            'data': {
1081                'title': '',
1082                'fields': ('nr_of_floors',),
1083                'is_required': True,
1084                'label': 'Nr of Floors ',
1085                'label_edit': 'Nr of Floors',
1086                'description': '',
1087                'help': 'Number of floors per block',
1088                'is_i18n': False,
1089                'vocabulary': 'range5',
1090            },
1091        },
1092        'rooms_per_floor': {
1093            'type': 'Select Widget',
1094            'data': {
1095                'title': '',
1096                'fields': ('rooms_per_floor',),
1097                'is_required': True,
1098                'label': 'Rooms per Floor',
1099                'label_edit': 'Rooms per Floor',
1100                'description': '',
1101                'help': 'Number of rooms per floor',
1102                'is_i18n': False,
1103                'vocabulary': 'range50',
1104            },
1105        },
1106        'beds_per_room': {
1107            'type': 'Select Widget',
1108            'data': {
1109                'title': '',
1110                'fields': ('beds_per_room',),
1111                'is_required': True,
1112                'label': 'Beds per Room',
1113                'label_edit': 'Beds per Room',
1114                'description': '',
1115                'help': 'Number of beds per room',
1116                'is_i18n': False,
1117                'vocabulary': 'range10',
1118            },
1119        },
1120        'beds_assigned': {
1121            'type': 'Int Widget',
1122            'data': {
1123                'title': '',
1124                'fields': ('beds_assigned',),
1125                'is_required': True,
1126                'label': 'Assigned Beds',
1127                'label_edit': 'Assigned Beds',
1128                'description': '',
1129                'help': 'Number of beds already assined to students',
1130                'is_i18n': False,
1131            },
1132        },
1133    },
1134   'layout': {
1135        'style_prefix': 'layout_waeup_',
1136        'flexible_widgets': (),
1137        'ncols': 1,
1138        'rows': [
1139            #[{'widget_id': 'heading', 'ncols': 1},],
1140            [{'widget_id': 'Title', 'ncols': 1},],
1141            [{'widget_id': 'text', 'ncols': 1},],
1142            [{'widget_id': 'which_sex', 'ncols': 1},],
1143            [{'widget_id': 'nr_of_blocks', 'ncols': 1},],
1144            [{'widget_id': 'nr_of_floors', 'ncols': 1},],
1145            [{'widget_id': 'rooms_per_floor', 'ncols': 1},],
1146            [{'widget_id': 'beds_per_room', 'ncols': 1},],
1147            [{'widget_id': 'beds_assigned', 'ncols': 1},],
1148        ]
1149    },
1150}
1151###)
1152
1153accobook = { ###(
1154    'widgets': {
1155        'sc_id': {
1156            'type': 'String Widget',
1157            'data': {
1158                'title': 'SC ID',
1159                'fields': ('accommodation_sc_id',),
1160                'is_required': False,
1161                'label': 'Card Serial Number ',
1162                'label_edit': 'Card Serial Number',
1163                'description': 'Card Serial Number ',
1164                'help': 'This can be found on the bottom right of the reverse side of your Scratch Card',
1165                'is_i18n': False,
1166                'readonly_layout_modes': (),
1167                'hidden_layout_modes': (),
1168                'hidden_readonly_layout_modes': (),
1169                'hidden_empty': False,
1170                'hidden_if_expr': 'python:1',
1171                'css_class': '',
1172                'widget_mode_expr': '',
1173                'display_width': 10,
1174                'size_max': 0,
1175            },
1176        },
1177        'sc_pin': {
1178            'type': 'Scratchcard Pin Widget',
1179            'data': {
1180                'title': 'SC Pin',
1181                'fields': ('accommodation_sc_pin'),
1182                'is_required': True,
1183                'label': 'enter an Accommodation PIN',
1184                'label_edit': 'enter an Accommodation PIN',
1185                'description': '',
1186                'help': 'Please enter a PIN valid for Accomodation booking',
1187                'is_i18n': False,
1188                'readonly_layout_modes': (),
1189                'hidden_layout_modes': (),
1190                'hidden_readonly_layout_modes': (),
1191                'hidden_empty': False,
1192                'hidden_if_expr': '',
1193                'css_class': '',
1194                'widget_mode_expr': '',
1195                'display_width': 10,
1196                'size_max': 10,
1197            },
1198        },
1199    },
1200   'layout': {
1201        'style_prefix': 'layout_accobook_',
1202        'flexible_widgets': (),
1203        'ncols': 1,
1204        'rows': [
1205            #[{'widget_id': 'sc_id', 'ncols': 1},],
1206            [{'widget_id': 'sc_pin', 'ncols': 1},],
1207        ]
1208    },
1209}
1210###)
1211
1212layouts = {}
1213layouts['university'] = common_layout
1214layouts['waeup_common'] = common_layout
1215layouts['student'] = student_layout
1216layouts['study_level'] = study_level
1217layouts['student_personal'] = student_personal_layout
1218layouts['accommodation'] = accommodation
1219layouts['accobook'] = accobook
1220layouts['scratch_card'] = scratch_card
1221layouts['admission'] = admission
1222layouts['jambcreate'] = jamb_layoutcreate
1223layouts['jamb'] = jamb_layout
1224layouts['faculty'] = common_layout
1225layouts['department'] = common_layout
1226layouts['course'] = course
1227layouts['admission_status'] = admission_status
1228return layouts
Note: See TracBrowser for help on using the repository browser.