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

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

=fixed Title bug in Course and Hall

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