Changeset 164 for waeup_product/trunk/skins
- Timestamp:
- 10 Nov 2005, 21:40:01 (19 years ago)
- Location:
- waeup_product/trunk/skins
- Files:
-
- 7 added
- 10 edited
- 1 copied
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
waeup_product/trunk/skins/waeup_default/getWAeUPLayouts.py
r161 r164 4 4 """Return custom layouts types.""" 5 5 6 ## 'widgets': { ###( 7 ## '': { 6 ##def widget(type = 'String Widget', 7 ## 'data': { 8 ## 'title': '', 9 ## 'fields': ('nr_of_floors',), 10 ## 'is_required': True, 11 ## 'label': 'Nr of Floors ', 12 ## 'label_edit': 'Nr of Floors', 13 ## 'description': '', 14 ## 'help': 'Number of floors per block', 15 ## 'is_i18n': False, 16 ## 'readonly_layout_modes': [], 17 ## 'hidden_layout_modes': [], 18 ## 'hidden_readonly_layout_modes': [], 19 ## 'hidden_empty': 0, 20 ## 'hidden_if_expr': '', 21 ## 'widget_mode_expr': '', 22 ## 'css_class': '', 23 ## 'css_class_expr': '', 24 ## 'javascript_expr': '', 25 ## 'vocabulary': 'range5', 26 ## 'translated': False, 27 ## }, 28 ## }, 29 30 Heading = { ###( 31 'type': 'Heading Widget', 32 'data': { 33 'fields': ['heading'], 34 'level': 1, 35 'is_i18n': 0, 36 'is_required': 1, 37 'label_edit': 'Headline', 38 'help': 'a short headline', 39 'display_width': 40, 40 'size_max': 200, 41 }, 42 }###) 43 44 Text = { ###( 45 'type': 'Text Widget', 46 'data': { 47 'fields': ['text'], 48 'is_i18n': 1, 49 'label_edit': 'Text', 50 'label': 'Text', 51 'help': 'a short Description', 52 'css_class': 'description', 53 'width': 72, 54 'height': 5, 55 'render_format': 'text', 56 'hidden_layout_modes': (), 57 }, 58 }###) 59 60 Title = { ###( 61 'type': 'String Widget', 62 'data': { 63 'fields': ['Title'], 64 'is_i18n': 0, 65 'is_required': 1, 66 'label': 'Title', 67 'label_edit': 'Title', 68 'display_width': 40, 69 'size_max': 200, 70 }, 71 }###) 72 73 sc_id = { ###( 74 'type': 'String Widget', 75 'data': { 76 'title': 'SC ID', 77 'fields': ('sc_id'), 78 'is_required': False, 79 'label': 'Card Serial Number ', 80 'label_edit': 'Card Serial Number', 81 'description': 'Card Serial Number ', 82 'help': 'This can be found on the bottom right of the reverse side of your Scratch Card', 83 'is_i18n': False, 84 'readonly_layout_modes': (), 85 'hidden_layout_modes': (), 86 'hidden_readonly_layout_modes': (), 87 'hidden_empty': False, 88 'hidden_if_expr': 'python:1', 89 'css_class': '', 90 'widget_mode_expr': '', 91 'display_width': 10, 92 'size_max': 0, 93 } 94 } 95 ###) 96 97 sc_pin = { ###( 98 'type': 'Scratchcard Pin Widget', 99 'data': { 100 'title': 'SC Pin', 101 'fields': ('sc_pin'), 102 'is_required': True, 103 'label': 'enter PIN', 104 'label_edit': 'enter an Accommodation PIN', 105 'description': '', 106 'help': 'Please enter a PIN valid for Accomodation booking', 107 'is_i18n': False, 108 'readonly_layout_modes': (), 109 'hidden_layout_modes': (), 110 'hidden_readonly_layout_modes': (), 111 'hidden_empty': False, 112 'hidden_if_expr': '', 113 'css_class': '', 114 'widget_mode_expr': '', 115 'display_width': 10, 116 'size_max': 10, 117 }, 118 } 119 ###) 120 121 sc_value = { ###( 122 'type': 'Float Widget', 123 'data': { 124 'title': 'Scratch card value', 125 'fields': ('sc_value',), 126 'is_required': True, 127 'label': 'SC Value', 128 'label_edit': 'Scratcard Value', 129 'description': '', 130 'help': '', 131 'is_i18n': False, 132 'readonly_layout_modes': (), 133 'hidden_layout_modes': (), 134 'hidden_readonly_layout_modes': (), 135 'hidden_empty': False, 136 'hidden_if_expr': '', 137 'css_class': '', 138 'widget_mode_expr': '', 139 'display_width': 10, 140 'size_max': 10, 141 }, 142 } 143 ###) 144 145 Description = { ###( 146 'type': 'Text Widget', 147 'data': { 148 'fields': ['Description'], 149 'is_i18n': 1, 150 'label_edit': 'Description', 151 'label': 'Description', 152 'css_class': 'description', 153 'width': 72, 154 'height': 5, 155 'render_format': 'text', 156 'hidden_layout_modes': (), 157 }, 158 }###) 159 160 common_layout = {###( 161 'widgets': { 162 'LanguageSelector': { 163 'type': 'Document Language Select Widget', 164 'data': { 165 'fields': ['Language'], 166 }, 167 }, 168 'Title': Title, 169 'Description': Description, 170 'LanguageSelectorCreation': { 171 'type': 'Select Widget', 172 'data': { 173 'title': 'Language', 174 'fields': ('Language',), 175 'is_required': 0, 176 'label': 'label_language', 177 'label_edit': 'label_language', 178 'description': '', 179 'help': '', 180 'is_i18n': 0, 181 'readonly_layout_modes': (), 182 'hidden_layout_modes': ('create','edit', 'view'), 183 'hidden_readonly_layout_modes': (), 184 'hidden_empty': 0, 185 'hidden_if_expr': '', 186 'css_class': '', 187 'vocabulary': 'language_voc', 188 }, 189 }, 190 }, 191 'layout': { 192 'style_prefix': 'layout_waeup_', 193 'rows': [ 194 #[{'widget_id': 'LanguageSelector'}], 195 [{'widget_id': 'Title'},], 196 [{'widget_id': 'Description'},], 197 #[{'widget_id': 'LanguageSelectorCreation'}], 198 ], 199 }, 200 } 201 # 202 ###) 203 204 student_layout = { ###( 205 'widgets': { 206 'jamb_is_admitted': { 207 'type': 'Boolean Widget', 208 'data': { 209 'title': 'JAMB Admission', 210 'fields': ('jamb_is_admitted',), 211 'is_required': False, 212 'label': 'JAMB Admission', 213 'label_edit': 'JAMB Admission', 214 'description': '', 215 'help': '', 216 'is_i18n': False, 217 'readonly_layout_modes': (), 218 'hidden_layout_modes': (), 219 'hidden_readonly_layout_modes': (), 220 'hidden_empty': False, 221 'hidden_if_expr': '', 222 'css_class': '', 223 'widget_mode_expr': '', 224 'display_width': 10, 225 'size_max': 0, 226 }, 227 }, 228 ## 'accommodation': { 8 229 ## 'type': 'String Widget', 9 230 ## 'data': { 10 ## 'title': ' ',11 ## 'fields': (' ',),231 ## 'title': 'Accommodation', 232 ## 'fields': ('accommodation',), 12 233 ## 'is_required': False, 13 ## 'label': ' ',14 ## 'label_edit': ' ',234 ## 'label': 'Accommodation', 235 ## 'label_edit': 'Accommodation', 15 236 ## 'description': '', 16 237 ## 'help': '', … … 26 247 ## 'size_max': 0, 27 248 ## }, 28 29 ###) 30 31 Heading = { ###( 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 45 Text = { ###( 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 61 Title = { ###( 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 74 Description = { ###( 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 89 common_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 133 student_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': { 249 ## }, 250 ## 'accommodation_sc_pin': { 158 251 ## 'type': 'String Widget', 159 252 ## 'data': { 160 ## 'title': ' Jamb Admission Location',161 ## 'fields': (' jamb_where_admitted',),253 ## 'title': 'Accommodation SC Pin', 254 ## 'fields': ('accommodation_sc_pin',), 162 255 ## 'is_required': False, 163 ## 'label': ' University',164 ## 'label_edit': ' University',256 ## 'label': 'Accommodation SC Pin', 257 ## 'label_edit': 'Accommodation SC Pin', 165 258 ## 'description': '', 166 259 ## 'help': '', … … 206 299 'rows': [ 207 300 #[{'widget_id': 'jamb_is_admitted', 'ncols': 1},], 208 #[{'widget_id': ' jamb_where_admitted', 'ncols': 1},],209 #[{'widget_id': ' jamb_pin_usage', 'ncols': 1},],301 #[{'widget_id': 'accommodation', 'ncols': 1},], 302 #[{'widget_id': 'accommodation_sc_pin', 'ncols': 1},], 210 303 #[{'widget_id': 'faculty', 'ncols': 1},], 211 304 ] … … 228 321 }, 229 322 } 230 middlename = { 323 324 ###) 325 326 middlename = { ###( 231 327 'type': 'String Widget', 232 328 'data': { … … 251 347 } 252 348 253 lastname = { 349 ###) 350 351 lastname = { ###( 254 352 'type': 'String Widget', 255 353 'data': { … … 273 371 }, 274 372 } 275 sex = { 373 374 ###) 375 376 email = { ###( 377 'type': 'Email Widget', 378 'data': { 379 'title': 'Email', 380 'fields': ('email',), 381 'is_required': False, 382 'label': 'Email', 383 'label_edit': 'Email', 384 'description': 'First Name', 385 'help': 'First name', 386 'is_i18n': False, 387 'display_width': 40, 388 }, 389 } 390 ###) 391 392 sex = { ###( 276 393 'type': 'Boolean Widget', 277 394 'data': { … … 297 414 } 298 415 } 416 417 ###) 418 419 pw = { ###( 420 'type': 'Password Widget', 421 'data': { 422 'title': 'Password', 423 'fields': ('pw',), 424 'is_required': False, 425 'label': 'New Password', 426 'label_edit': 'New Password', 427 'description': '', 428 'help': 'enter a new Password', 429 'is_i18n': 0, 430 'readonly_layout_modes': [], 431 'hidden_layout_modes': [], 432 'hidden_readonly_layout_modes': [], 433 'hidden_empty': 0, 434 'hidden_if_expr': '', 435 'widget_mode_expr': '', 436 'css_class': '', 437 'css_class_expr': '', 438 'javascript_expr': '', 439 'display_width': 12, 440 'size_max': 8, 441 'password_widget': '', 442 'check_lower': 0, 443 'check_upper': 0, 444 'check_digit': 0, 445 'check_extra': 0, 446 'size_min': 5, 447 }, 448 } 449 ###) 450 451 rpw = { ###( 452 'type': 'Password Widget', 453 'data': { 454 'title': 'confirm Password', 455 'fields': ('rpw',), 456 'is_required': False, 457 'label': 'Confirm Password', 458 'label_edit': 'Confirm Password', 459 'description': '', 460 'help': 'confirm the new Password', 461 'is_i18n': False, 462 'display_width': 12, 463 'size_max': 8, 464 'password_widget': 'pw', 465 'check_lower': 0, 466 'check_upper': 0, 467 'check_digit': 0, 468 'check_extra': 0, 469 'size_min': 5, 470 }, 471 } 299 472 300 473 ###) … … 404 577 ###) 405 578 579 student_eligibility = { ###( 580 'widgets': { 581 'firstname': firstname, 582 'middlename': middlename, 583 'lastname': lastname, 584 'sex': sex, 585 'email': email, 586 'pw': pw, 587 'rpw': rpw, 588 }, 589 'layout': { 590 'style_prefix': 'layout_eligibility_', 591 'flexible_widgets': (), 592 'ncols': 1, 593 'rows': [ 594 #[{'widget_id': 'firstname', 'ncols': 1},], 595 #[{'widget_id': 'middlename', 'ncols': 1},], 596 #[{'widget_id': 'lastname', 'ncols': 1},], 597 #[{'widget_id': 'sex', 'ncols': 1},], 598 [{'widget_id': 'email', 'ncols': 1},], 599 [{'widget_id': 'pw', 'ncols': 1},], 600 [{'widget_id': 'rpw', 'ncols': 1},], 601 ] 602 }, 603 } 604 ###) 605 406 606 scratch_card = { ###( 407 607 'widgets': { … … 494 694 'data': { 495 695 'title': 'SC ID', 496 'fields': (' admission_sc_id',),696 'fields': ('sc_id',), 497 697 'is_required': False, 498 698 'label': 'Card Serial Number ', … … 505 705 'hidden_readonly_layout_modes': (), 506 706 'hidden_empty': False, 507 'hidden_if_expr': 'python:1', 508 'css_class': '', 509 'widget_mode_expr': '', 510 'display_width': 10, 511 'size_max': 0, 512 }, 513 }, 707 'hidden_if_expr': '', 708 'css_class': '', 709 'widget_mode_expr': '', 710 'display_width': 10, 711 'size_max': 0, 712 }, 713 }, 714 'sc_value': { ###( 715 'type': 'Float Widget', 716 'data': { 717 'title': 'Scratch card value', 718 'fields': ('sc_value',), 719 'is_required': False, 720 'label': 'SC Value', 721 'label_edit': 'Scratcard Value', 722 'description': '', 723 'help': '', 724 'is_i18n': False, 725 'readonly_layout_modes': ('create'), 726 'hidden_layout_modes': (), 727 'hidden_readonly_layout_modes': (), 728 'hidden_empty': False, 729 'hidden_if_expr': '', 730 'css_class': '', 731 'widget_mode_expr': '', 732 'display_width': 10, 733 'size_max': 10, 734 }, 735 },###) 514 736 'sc_pin': { 515 737 'type': 'Scratchcard Pin Widget', 516 738 'data': { 517 739 'title': 'SC Pin', 518 'fields': (' admission_sc_pin'),740 'fields': ('sc_pin'), 519 741 'is_required': True, 520 742 'label': 'PIN', … … 541 763 'ncols': 1, 542 764 'rows': [ 543 [{'widget_id': 'sc_id', 'ncols': 1},], 765 #[{'widget_id': 'sc_id', 'ncols': 1},], 766 [{'widget_id': 'sc_value', 'ncols': 1},], 544 767 [{'widget_id': 'sc_pin', 'ncols': 1},], 545 768 [{'widget_id': 'jamb_id', 'ncols': 1},], 769 ] 770 }, 771 } 772 ###) 773 774 clearence = { ###( 775 'widgets': { 776 'sc_id': { 777 'type': 'String Widget', 778 'data': { 779 'title': 'SC ID', 780 'fields': ('sc_id',), 781 'is_required': False, 782 'label': 'Card Serial Number ', 783 'label_edit': 'Card Serial Number', 784 'description': 'Card Serial Number ', 785 'help': 'This can be found on the bottom right of the reverse side of your Scratch Card', 786 'is_i18n': False, 787 'readonly_layout_modes': (), 788 'hidden_layout_modes': (), 789 'hidden_readonly_layout_modes': (), 790 'hidden_empty': False, 791 'hidden_if_expr': 'python:1', 792 'css_class': '', 793 'widget_mode_expr': '', 794 'display_width': 10, 795 'size_max': 0, 796 }, 797 }, 798 'sc_pin': { 799 'type': 'Scratchcard Pin Widget', 800 'data': { 801 'title': 'SC Pin', 802 'fields': ('sc_pin'), 803 'is_required': True, 804 'label': 'PIN', 805 'label_edit': 'PIN', 806 'description': '', 807 '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', 808 'is_i18n': False, 809 'readonly_layout_modes': (), 810 'hidden_layout_modes': (), 811 'hidden_readonly_layout_modes': (), 812 'hidden_empty': False, 813 'hidden_if_expr': '', 814 'css_class': '', 815 'widget_mode_expr': '', 816 'display_width': 10, 817 'size_max': 10, 818 }, 819 }, 820 'sc_value': { ###( 821 'type': 'Float Widget', 822 'data': { 823 'title': 'Scratch card value', 824 'fields': ('sc_value',), 825 'is_required': False, 826 'label': 'SC Value', 827 'label_edit': 'Scratcard Value', 828 'description': '', 829 'help': '', 830 'is_i18n': False, 831 'readonly_layout_modes': ('create'), 832 'hidden_layout_modes': (), 833 'hidden_readonly_layout_modes': (), 834 'hidden_empty': False, 835 'hidden_if_expr': '', 836 'css_class': '', 837 'widget_mode_expr': '', 838 'display_width': 10, 839 'size_max': 10, 840 }, 841 },###) 842 'lastname': { ###( 843 'type': 'String Widget', 844 'data': { 845 'title': 'Scratch card value', 846 'fields': ('lastname',), 847 'is_required': False, 848 'label': 'Surname', 849 'label_edit': 'Surname', 850 'description': '', 851 'help': '', 852 'is_i18n': False, 853 'readonly_layout_modes': ('create'), 854 'hidden_layout_modes': (), 855 'hidden_readonly_layout_modes': (), 856 'hidden_empty': False, 857 'hidden_if_expr': '', 858 'css_class': '', 859 'widget_mode_expr': '', 860 'display_width': 10, 861 'size_max': 10, 862 }, 863 },###) 864 'jamb_id' : jamb_id, 865 }, 866 'layout': { 867 'style_prefix': 'layout_clearence_', 868 'flexible_widgets': (), 869 'ncols': 1, 870 'rows': [ 871 #[{'widget_id': 'sc_id', 'ncols': 1},], 872 [{'widget_id': 'sc_value', 'ncols': 1},], 873 [{'widget_id': 'sc_pin', 'ncols': 1},], 874 [{'widget_id': 'jamb_id', 'ncols': 1},], 875 #[{'widget_id': 'lastname', 'ncols': 1},], 546 876 ] 547 877 }, … … 876 1206 ###) 877 1207 1208 admission_slip = { ###( 1209 'widgets': jamb_widgets, 1210 'layout': { 1211 'style_prefix': 'layout_waeup_', 1212 'flexible_widgets': (), 1213 'ncols': 1, 1214 'rows': [ 1215 [{'widget_id': 'reg_nr', 'ncols': 1},], 1216 [{'widget_id': 'firstname', 'ncols': 1},], 1217 [{'widget_id': 'middlename', 'ncols': 1},], 1218 [{'widget_id': 'lastname', 'ncols': 1},], 1219 #[{'widget_id': 'sc_id', 'ncols': 1},], 1220 #[{'widget_id': 'sc_pin', 'ncols': 1},], 1221 [{'widget_id': 'age', 'ncols': 1},], 1222 [{'widget_id': 'sex', 'ncols': 1},], 1223 [{'widget_id': 'state', 'ncols': 1},], 1224 #[{'widget_id': 'exam_results', 'ncols': 1},], 1225 [{'widget_id': 'aggregate', 'ncols': 1},], 1226 [{'widget_id': 'faculty', 'ncols': 1},], 1227 [{'widget_id': 'course', 'ncols': 1},], 1228 [{'widget_id': 'listing_date', 'ncols': 1},], 1229 #[{'widget_id': '2nd_choice', 'ncols': 1},], 1230 #[{'widget_id': '3rd_choice', 'ncols': 1},], 1231 ] 1232 }, 1233 } 1234 ###) 1235 878 1236 course = { ###( 879 1237 'widgets': { … … 1043 1401 [{'widget_id': 'points', 'ncols': 1},], 1044 1402 [{'widget_id': 'grade', 'ncols': 1},], 1045 ]1046 },1047 }1048 ###)1049 1050 study_level = { ###(1051 'widgets': {1052 'Title': {1053 'type': 'Select Widget',1054 'data': {1055 'title': '',1056 'fields': ('Title',),1057 'is_required': False,1058 'label': 'Study Level',1059 'label_edit': 'Study Level',1060 'description': '',1061 'help': '',1062 'vocabulary': 'courselevel',1063 'is_i18n': False,1064 'readonly_layout_modes': (),1065 'hidden_layout_modes': (),1066 'hidden_readonly_layout_modes': (),1067 'hidden_empty': False,1068 'hidden_if_expr': '',1069 'css_class': '',1070 'widget_mode_expr': '',1071 'display_width': 20,1072 'size_max': 0,1073 },1074 },1075 },1076 'layout': {1077 'style_prefix': 'layout_waeup_',1078 'flexible_widgets': (),1079 'ncols': 1,1080 'rows': [1081 [{'widget_id': 'Title', 'ncols': 1},],1082 #[{'widget_id': 'Year', 'ncols': 1},],1083 1403 ] 1084 1404 }, … … 1207 1527 ###) 1208 1528 1209 accobook= { ###(1529 study_level = { ###( 1210 1530 'widgets': { 1211 'sc_id': {1212 1213 1531 'sc_id': { ###( 1532 'type': 'String Widget', 1533 'data': { 1214 1534 'title': 'SC ID', 1215 'fields': (' accommodation_sc_id',),1535 'fields': ('sc_id'), 1216 1536 'is_required': False, 1217 1537 'label': 'Card Serial Number ', … … 1229 1549 'display_width': 10, 1230 1550 'size_max': 0, 1231 }, 1232 }, 1233 'sc_pin': { 1234 'type': 'Scratchcard Pin Widget', 1235 'data': { 1551 } 1552 },###) 1553 'sc_pin': { ###( 1554 'type': 'Scratchcard Pin Widget', 1555 'data': { 1556 'title': 'SC Pin', 1557 'fields': ('sc_pin'), 1558 'is_required': True, 1559 'label': 'enter PIN', 1560 'label_edit': 'enter Scratchcard PIN with the value above', 1561 'description': '', 1562 'help': 'Please enter a Scratchcard PIN valid for Registration of next level', 1563 'is_i18n': False, 1564 'readonly_layout_modes': (), 1565 'hidden_layout_modes': (), 1566 'hidden_readonly_layout_modes': (), 1567 'hidden_empty': False, 1568 'hidden_if_expr': '', 1569 'css_class': '', 1570 'widget_mode_expr': '', 1571 'display_width': 10, 1572 'size_max': 10, 1573 }, 1574 },###) 1575 'sc_value': { ###( 1576 'type': 'Float Widget', 1577 'data': { 1578 'title': 'Scratch card value', 1579 'fields': ('sc_value',), 1580 'is_required': False, 1581 'label': 'Scratcard Value', 1582 'label_edit': 'Scratcard Value', 1583 'description': '', 1584 'help': '', 1585 'is_i18n': False, 1586 'readonly_layout_modes': ('create'), 1587 'hidden_layout_modes': (), 1588 'hidden_readonly_layout_modes': (), 1589 'hidden_empty': False, 1590 'hidden_if_expr': '', 1591 'css_class': '', 1592 'widget_mode_expr': '', 1593 'display_width': 10, 1594 'size_max': 10, 1595 }, 1596 },###) 1597 }, 1598 'layout': { 1599 'style_prefix': 'layout_slregister_', 1600 'flexible_widgets': (), 1601 'ncols': 1, 1602 'rows': [ 1603 #[{'widget_id': 'sc_id', 'ncols': 1},], 1604 [{'widget_id': 'sc_value', 'ncols': 1},], 1605 [{'widget_id': 'sc_pin', 'ncols': 1},], 1606 ] 1607 }, 1608 }###) 1609 1610 accobook = { ###( 1611 'widgets': { 1612 'sc_id': { ###( 1613 'type': 'String Widget', 1614 'data': { 1615 'title': 'SC ID', 1616 'fields': ('accommodation_sc_id'), 1617 'is_required': False, 1618 'label': 'Card Serial Number ', 1619 'label_edit': 'Card Serial Number', 1620 'description': 'Card Serial Number ', 1621 'help': 'This can be found on the bottom right of the reverse side of your Scratch Card', 1622 'is_i18n': False, 1623 'readonly_layout_modes': (), 1624 'hidden_layout_modes': (), 1625 'hidden_readonly_layout_modes': (), 1626 'hidden_empty': False, 1627 'hidden_if_expr': 'python:1', 1628 'css_class': '', 1629 'widget_mode_expr': '', 1630 'display_width': 10, 1631 'size_max': 0, 1632 } 1633 },###) 1634 'sc_pin': { ###( 1635 'type': 'Scratchcard Pin Widget', 1636 'data': { 1236 1637 'title': 'SC Pin', 1237 1638 'fields': ('accommodation_sc_pin'), 1238 1639 'is_required': True, 1239 'label': 'enter an AccommodationPIN',1640 'label': 'enter PIN', 1240 1641 'label_edit': 'enter an Accommodation PIN', 1241 1642 'description': '', … … 1252 1653 'size_max': 10, 1253 1654 }, 1254 }, 1255 }, 1655 },###) 1656 'sc_value': { ###( 1657 'type': 'Float Widget', 1658 'data': { 1659 'title': 'Scratch card value', 1660 'fields': ('accommodation_sc_value',), 1661 'is_required': False, 1662 'label': 'SC Value', 1663 'label_edit': 'Scratcard Value', 1664 'description': '', 1665 'help': '', 1666 'is_i18n': False, 1667 'readonly_layout_modes': ('create'), 1668 'hidden_layout_modes': (), 1669 'hidden_readonly_layout_modes': (), 1670 'hidden_empty': False, 1671 'hidden_if_expr': '', 1672 'css_class': '', 1673 'widget_mode_expr': '', 1674 'display_width': 10, 1675 'size_max': 10, 1676 }, 1677 },###) 1678 }, 1256 1679 'layout': { 1257 1680 'style_prefix': 'layout_accobook_', … … 1260 1683 'rows': [ 1261 1684 #[{'widget_id': 'sc_id', 'ncols': 1},], 1685 [{'widget_id': 'sc_value', 'ncols': 1},], 1262 1686 [{'widget_id': 'sc_pin', 'ncols': 1},], 1263 1687 ] … … 1272 1696 layouts['study_level'] = study_level 1273 1697 layouts['student_personal'] = student_personal_layout 1698 layouts['student_eligibility'] = student_eligibility 1274 1699 layouts['accommodation'] = accommodation 1275 1700 layouts['accobook'] = accobook 1276 1701 layouts['scratch_card'] = scratch_card 1277 1702 layouts['admission'] = admission 1703 layouts['clearence'] = clearence 1704 layouts['admission_slip'] = admission_slip 1278 1705 layouts['jambcreate'] = jamb_layoutcreate 1279 1706 layouts['jamb'] = jamb_layout -
waeup_product/trunk/skins/waeup_default/getWAeUPSchemas.py
r161 r164 1 1 #-*- mode: python; mode: fold -*- 2 2 # $Id$ 3 4 sc_id = { ###( 5 'type': 'CPS String Field', 6 'data': { 7 'default_expr': 'string:', 8 'is_searchabletext': True, 9 'acl_read_permissions': '', 10 'acl_read_roles': '', 11 'acl_read_expr': '', 12 'acl_write_permissions': '', 13 'acl_write_roles': 'SectionReader', 14 'acl_write_expr': '', 15 'read_ignore_storage': False, 16 'read_process_expr': '', 17 'read_process_dependent_fields': (), 18 'write_ignore_storage': False, 19 'write_process_expr': '', 20 }, 21 } 22 ###) 23 24 sc_pin = { ###( 25 'type': 'CPS String Field', 26 'data': { 27 'default_expr': 'string:', 28 'is_searchabletext': True, 29 'acl_read_permissions': '', 30 'acl_read_roles': '', 31 'acl_read_expr': '', 32 'acl_write_permissions': '', 33 'acl_write_roles': 'SectionReader', 34 'acl_write_expr': '', 35 'read_ignore_storage': False, 36 'read_process_expr': '', 37 'read_process_dependent_fields': (), 38 'write_ignore_storage': False, 39 'write_process_expr': '', 40 }, 41 } 42 43 ###) 44 45 sc_value = { ###( 46 'type': 'CPS Float Field', 47 'data': { 48 'default_expr': 'python:500.', 49 'is_searchabletext': True, 50 'acl_read_permissions': '', 51 'acl_read_roles': '', 52 'acl_read_expr': '', 53 'acl_write_permissions': '', 54 'acl_write_roles': '', 55 'acl_write_expr': '', 56 'read_ignore_storage': False, 57 'read_process_expr': '', 58 'read_process_dependent_fields': (), 59 'write_ignore_storage': False, 60 'write_process_expr': '', 61 }, 62 } 63 ###) 3 64 4 65 university_schema = { ###( … … 67 128 'write_ignore_storage': False, 68 129 'write_process_expr': '', 69 }, 70 }, 71 'accommodation_sc_id': { 72 'type': 'CPS String Field', 73 'data': { 74 'default_expr': 'string:', 75 'is_searchabletext': True, 76 'acl_read_permissions': '', 77 'acl_read_roles': '', 78 'acl_read_expr': '', 79 'acl_write_permissions': '', 80 'acl_write_roles': '', 81 'acl_write_expr': '', 82 'read_ignore_storage': False, 83 'read_process_expr': '', 84 'read_process_dependent_fields': (), 85 'write_ignore_storage': False, 86 'write_process_expr': '', 87 }, 88 }, 89 'accommodation_sc_pin': { 90 'type': 'CPS String Field', 91 'data': { 92 'default_expr': 'string:', 93 'is_searchabletext': True, 94 'acl_read_permissions': '', 95 'acl_read_roles': '', 96 'acl_read_expr': '', 97 'acl_write_permissions': '', 98 'acl_write_roles': '', 99 'acl_write_expr': '', 100 'read_ignore_storage': False, 101 'read_process_expr': '', 102 'read_process_dependent_fields': (), 103 'write_ignore_storage': False, 104 'write_process_expr': '', 105 }, 106 }, 107 } 108 # 109 ###) 110 111 studylevel = { ###( 112 } 113 # 130 }, 131 }, 132 'adm_check_sc_id' : sc_id, 133 'adm_check_sc_pin' : sc_pin, 134 'adm_check_sc_value' : sc_value, 135 'adm_check_date' : { 136 'type': 'CPS DateTime Field', 137 'data': { 138 'is_searchabletext': 0, 139 'acl_write_roles': 'SectionReader', 140 }, 141 }, 142 'clearence_sc_id' : sc_id, 143 'clearence_sc_pin' : sc_pin, 144 'clearence_sc_value' : sc_value, 145 'clearence_date' : { 146 'type': 'CPS DateTime Field', 147 'data': { 148 'is_searchabletext': 0, 149 'acl_write_roles': 'SectionReader', 150 }, 151 }, 152 'accommodation_sc_id' : sc_id, 153 'accommodation_sc_pin' : sc_pin, 154 'accommodation_sc_value' : sc_value, 155 'accommodation_date' : { 156 'type': 'CPS DateTime Field', 157 'data': { 158 'is_searchabletext': 0, 159 'acl_write_roles': 'SectionReader', 160 }, 161 }, 162 } 163 ###) 164 165 student_accommodation = { ###( 166 'sc_id': sc_id, 167 'sc_pin': sc_pin, 168 'sc_value': { ###( 169 'type': 'CPS Float Field', 170 'data': { 171 'default_expr': 'python:500.', 172 'is_searchabletext': True, 173 'acl_read_permissions': '', 174 'acl_read_roles': '', 175 'acl_read_expr': '', 176 'acl_write_permissions': '', 177 'acl_write_roles': '', 178 'acl_write_expr': '', 179 'read_ignore_storage': False, 180 'read_process_expr': '', 181 'read_process_dependent_fields': (), 182 'write_ignore_storage': False, 183 'write_process_expr': '', 184 }, 185 },###) 186 'accommodation': { 187 'type': 'CPS String Field', 188 'data': { 189 'default_expr': 'string:', 190 'is_searchabletext': True, 191 'acl_read_permissions': '', 192 'acl_read_roles': '', 193 'acl_read_expr': '', 194 'acl_write_permissions': '', 195 'acl_write_roles': '', 196 'acl_write_expr': '', 197 'read_ignore_storage': False, 198 'read_process_expr': '', 199 'read_process_dependent_fields': (), 200 'write_ignore_storage': False, 201 'write_process_expr': '', 202 }, 203 }, 204 } 205 ###) 206 207 student_admission = { ###( 208 'sc_id': sc_id, 209 'sc_pin': sc_pin, 210 'sc_value': { ###( 211 'type': 'CPS Float Field', 212 'data': { 213 'default_expr': 'python:300.', 214 'is_searchabletext': True, 215 'acl_read_permissions': '', 216 'acl_read_roles': '', 217 'acl_read_expr': '', 218 'acl_write_permissions': '', 219 'acl_write_roles': '', 220 'acl_write_expr': '', 221 'read_ignore_storage': False, 222 'read_process_expr': '', 223 'read_process_dependent_fields': (), 224 'write_ignore_storage': False, 225 'write_process_expr': '', 226 }, 227 },###) 228 'reg_nr': { 229 'type': 'CPS String Field', 230 'data': { 231 'default_expr': 'string:', 232 'is_searchabletext': True, 233 }, 234 }, 235 } 236 ###) 237 238 student_clearence = { ###( 239 'sc_id': sc_id, 240 'sc_pin': sc_pin, 241 'sc_value': { ###( 242 'type': 'CPS Float Field', 243 'data': { 244 'default_expr': 'python:800.', 245 'is_searchabletext': True, 246 'acl_read_permissions': '', 247 'acl_read_roles': '', 248 'acl_read_expr': '', 249 'acl_write_permissions': '', 250 'acl_write_roles': '', 251 'acl_write_expr': '', 252 'read_ignore_storage': False, 253 'read_process_expr': '', 254 'read_process_dependent_fields': (), 255 'write_ignore_storage': False, 256 'write_process_expr': '', 257 }, 258 },###) 259 'reg_nr': { 260 'type': 'CPS String Field', 261 'data': { 262 'default_expr': 'string:', 263 'is_searchabletext': True, 264 }, 265 }, 266 'lastname': { 267 'type': 'CPS String Field', 268 'data': { 269 'default_expr': 'string:', 270 'is_searchabletext': True, 271 'acl_read_permissions': '', 272 'acl_read_roles': '', 273 'acl_read_expr': '', 274 'acl_write_permissions': '', 275 'acl_write_roles': '', 276 'acl_write_expr': '', 277 'read_ignore_storage': False, 278 'read_process_expr': '', 279 'read_process_dependent_fields': (), 280 'write_ignore_storage': False, 281 'write_process_expr': '', 282 }, 283 }, 284 }###) 285 286 study_level = { ###( 287 'sc_id': sc_id, 288 'sc_pin': sc_pin, 289 'sc_value': { ###( 290 'type': 'CPS Float Field', 291 'data': { 292 'default_expr': 'python:1000.', 293 'is_searchabletext': True, 294 'acl_read_permissions': '', 295 'acl_read_roles': '', 296 'acl_read_expr': '', 297 'acl_write_permissions': '', 298 'acl_write_roles': '', 299 'acl_write_expr': '', 300 'read_ignore_storage': False, 301 'read_process_expr': '', 302 'read_process_dependent_fields': (), 303 'write_ignore_storage': False, 304 'write_process_expr': '', 305 }, 306 },###) 307 } 114 308 ###) 115 309 … … 164 358 }, 165 359 }, 360 } 361 ###) 362 363 student_eligibility = { ###( 364 'firstname': { 365 'type': 'CPS String Field', 366 'data': { 367 'is_searchabletext': 1, 368 }, 369 }, 370 'middlename': { 371 'type': 'CPS String Field', 372 'data': { 373 'is_searchabletext': 1, 374 }, 375 }, 376 'lastname': { 377 'type': 'CPS String Field', 378 'data': { 379 'is_searchabletext': 1, 380 }, 381 }, 382 'sex': { 383 'type': 'CPS Boolean Field', 384 'default_expr': 'python:True', 385 'data': { 386 'is_searchabletext': 0, 387 }, 388 }, 389 ## 'birthday': { 390 ## 'type': 'CPS DateTime Field', 391 ## 'data': { 392 ## 'is_searchabletext': 1, 393 ## }, 394 ## }, 395 'age': { 396 'type': 'CPS DateTime Field', 397 'data': { 398 'is_searchabletext': 0, 399 }, 400 }, 401 'email': { 402 'type': 'CPS String Field', 403 'data': { 404 'is_searchabletext': 1, 405 }, 406 }, 407 'pw': { 408 'type': 'CPS String Field', 409 'data': { 410 'default_expr': 'string:default', 411 }, 412 }, 413 'rpw': { 414 'type': 'CPS String Field', 415 'data': { 416 'default_expr': 'string:default', 417 }, 418 }, 419 ## 'photo': { 420 ## 'type': 'CPS Image Field', 421 ## 'data': { 422 ## 'is_searchabletext': 0, 423 ## }, 424 ## }, 425 ## 'birth_certificate': { 426 ## 'type': 'CPS Image Field', 427 ## 'data': { 428 ## 'is_searchabletext': 0, 429 ## }, 430 ## }, 166 431 } 167 432 ###) … … 497 762 schemas['students'] = students_folder_schema 498 763 schemas['student'] = student_schema 499 schemas['studylevel'] = studylevel 764 schemas['student_admission'] = student_admission 765 schemas['student_clearence'] = student_clearence 766 schemas['student_eligibility'] = student_eligibility 767 schemas['student_accommodation'] = student_accommodation 768 schemas['study_level'] = study_level 500 769 schemas['course_results'] = course_results_schema 501 770 schemas['student_personal'] = student_personal_schema -
waeup_product/trunk/skins/waeup_default/getWAeUPTypes.py
r162 r164 20 20 'global_allow': 1, 21 21 'filter_content_types': 1, 22 'allowed_content_types': (' StudentsFolder','Faculty','AccoFolder','Section','CPSProxyDocument'),22 'allowed_content_types': ('Chat','FAQ','CPSCalendar','Forum','StudentsFolder','Faculty','AccoFolder','Section','CPSProxyDocument'), 23 23 'allow_discussion': 0, 24 24 'cps_is_searchable': 1, … … 111 111 'permissions': (UniversityManage,StudentManage)}, 112 112 { 113 'id' : ' my_admission',114 'name' : ' MyAdmission Status',113 'id' : 'check_admission', 114 'name' : 'Check Admission Status', 115 115 'action' : 'string:${object/absolute_url}/check_admission', 116 116 'condition': 'object/portal_membership/isAnonymousUser', … … 118 118 { 119 119 'id' : 'admission_list', 120 'name' : ' Admission List',121 'action' : 'string:${object/absolute_url}/ admission_status',120 'name' : 'Clearence Elegibility Process', 121 'action' : 'string:${object/absolute_url}/clearence', 122 122 'condition': 'object/portal_membership/isAnonymousUser', 123 123 'permission': (View,)}, … … 180 180 #'action': 'string:${object_url}/student_index_html', 181 181 'action': 'temporary_view_all', 182 'condition': '',182 'condition': 'object/memberIsOwner', 183 183 'permission': (View,), 184 184 'category': 'object', 185 'visible': True,}, 185 'visible': True, 186 }, 186 187 {'id': 'metadata', 187 188 'name': 'action_metadata', … … 194 195 'permissions': (ModifyPortalContent), 195 196 'visible' : 0, 197 }, 198 {'id' : 'eligibility', 199 'name' : 'eligibility', 200 'action' : 'eligibility', 201 'condition': 'object/memberIsOwner', 202 'permission': (ModifyPortalContent,), 203 'visible': False, 196 204 }, 197 205 {'id' : 'JAMB', 198 206 'name' : 'JAMB Data', 199 207 'action' : 'string:${object/absolute_url}/JAMB', 200 'condition': ' ',208 'condition': 'object/memberIsOwner', 201 209 'permission': (ModifyPortalContent,)}, 202 210 { … … 204 212 'name' : 'Personal Data', 205 213 'action' : 'string:${object/absolute_url}/PERSONAL', 206 'condition': "python: getattr(object,'PERSONAL',None)",214 'condition': "python: object.getContent().memberIsOwner() and getattr(object,'PERSONAL',None)", 207 215 'permission': (ModifyPortalContent,)}, 208 216 { … … 210 218 'name' : 'Register for next Level', 211 219 'action' : 'string:${object/absolute_url}/register_level', 212 'condition': ' ',220 'condition': 'object/memberIsOwner', 213 221 'permission': (ModifyPortalContent,)}, 214 222 { … … 216 224 'name' : 'Book Accomodation', 217 225 'action' : 'string:${object/absolute_url}/book_accommodation', 218 'condition': ' ',226 'condition': 'object/memberIsOwner', 219 227 'permission': (ModifyPortalContent,)}, 220 228 ) -
waeup_product/trunk/skins/waeup_default/getWAeUPVocabularies.py
r153 r164 83 83 ('200', "Year 2 (200 Level)", ''), 84 84 ('300', "Year 3 (300 Level)", ''), 85 ('400', "Year 4 ( 100 Level)", ''),85 ('400', "Year 4 (400 Level)", ''), 86 86 )}, 87 87 } -
waeup_product/trunk/skins/waeup_student/add_course_ticket.py
r163 r164 22 22 ob={}, 23 23 layout_mode='create', 24 create_action = ' register_study_level',24 create_action = 'add_course_ticket', 25 25 ) 26 26 if True or psm == 'invalid': -
waeup_product/trunk/skins/waeup_student/book_accommodation.py
r163 r164 21 21 ob={}, 22 22 layout_mode='create', 23 create_action = 'book_accommodation', 23 24 ) 24 25 if psm == 'invalid': 25 return context. check_admission_form(rendered = res,26 return context.book_accommodation_form(rendered = res, 26 27 psm = "Please correct your input", 27 28 ds = ds, 28 29 ) 29 30 elif psm == '': 30 return context. check_admission_form(rendered = res,31 return context.book_accommodation_form(rendered = res, 31 32 psm = None, 32 33 ds = ds, … … 36 37 halls = getattr(context,'accommodation').contentValues() 37 38 beds = [] 38 student = context. getContent()39 student = context.PERSONAL.getContent() 39 40 sf = context.getContent() 40 41 for hall in halls: -
waeup_product/trunk/skins/waeup_student/check_admission.py
r155 r164 17 17 18 18 res,psm,ds = lt.renderLayout(layout_id= 'admission', 19 schema_id= ' jamb',19 schema_id= 'student_admission', 20 20 context=context, 21 21 mapping=validate and REQUEST, … … 37 37 catalog = context.portal_catalog 38 38 search = catalog(SearchableText = "%s*" % s_id) 39 if len(search) < 1: 40 psm = "Your not admitted" 39 student = getattr(context,s_id,None) 40 if student is None: 41 #if len(search) < 1: 42 psm = "Your are not admitted" 41 43 return context.check_admission_form(rendered = res, 42 psm = psm + str(search),44 psm = psm, 43 45 ds = ds, 44 46 ) 45 sf = getattr(context,s_id,None) 46 if sf and getattr(sf,'PERSONAL',None): 47 psm = "Your already admitted, please login" 48 return context.check_admission_form(rendered = res, 49 psm = psm, 50 ds = ds, 51 ) 52 rset = REQUEST.set 53 sc_pin = ds.get('sc_pin') 54 return REQUEST.RESPONSE.redirect("%s/logged_in?__ac_name=%s&__ac_password=UnSeT&sc_pin=%s" 55 % (context.absolute_url(),s_id,sc_pin)) 56 ## return context.student_admitted_form(rendered = res, 57 ## psm = psm, 58 ## ds = ds, 59 ## student = student, 60 ## jamb = jamb, 61 ## pd = pd, 62 ## ) 63 ## 64 ##return res,psm,ds 47 student.getContent().setScratchCardData('adm_check',ds) 65 48 49 jamb = getattr(student,'JAMB') 50 res = jamb.getContent().render(layout_id = 'admission_slip', 51 layout_mode = 'view', 52 schema_id = 'jamb') 53 54 return jamb.admission_slip_form(rendered = res, dict = ds) 55 -
waeup_product/trunk/skins/waeup_student/check_admission_form.pt
r124 r164 13 13 > 14 14 </metal:block> 15 16 <metal:block fill-slot="main"> 17 <h1>Check your admission status!</h1> 18 <div tal:replace="structure rendered_main" /> 15 <metal:block fill-slot="main"> 16 <h1> Check Your Admission Status! </h1> 17 <div tal:replace="structure rendered_main" /> 18 Instructions :<br /> 19 <ul> 20 <li>Enter the scratch card PIN for admission check </li> 21 <li>Print the Admission Slip which is displayed if you are admitted by the School </li> 22 <li>Buy a Clearance card </li> 23 <li>Proceed to the Clearance Eligibility Online Form and fill your O/L details </li> 24 <li>Proceed to the School with all original documents for Clearance to finalize the clearance process </li> 25 </ul> 26 </metal:block> 27 <metal:block fill-slot="sub"> 28 </metal:block> 19 29 </metal:block> 20 <metal:block fill-slot="sub">21 30 </metal:block> 22 23 </metal:block>24 </metal:block>25 31 </tal:block> -
waeup_product/trunk/skins/waeup_student/layout_accobook_create.pt
r117 r164 10 10 edit_form python:ti and ti.getActionById('edit', 'cpsdocument_edit_form') or 'cpsdocument_edit_form'; 11 11 metadata_form python:ti and ti.getActionById('metadata', 'cpsdocument_metadata') or 'cpsdocument_metadata'; 12 formaction string:check_admission_form;13 12 first_layout options/first_layout|python:0; 14 13 last_layout options/last_layout|python:0; … … 17 16 " 18 17 > 19 <form action=' book_accommodation' method='post'18 <form action='' method='post' tal:attributes="action string:${options/create_action}" 20 19 enctype='multipart/form-data' class='workflow'> 21 20 <div class='group'> … … 81 80 </form> 82 81 </metal:block> 83 -
waeup_product/trunk/skins/waeup_student/layout_clearence_create.pt
r160 r164 17 17 " 18 18 > 19 <form action='c heck_admission' method='post'19 <form action='clearence' method='post' 20 20 enctype='multipart/form-data' class='workflow'> 21 21 <div class='group'> -
waeup_product/trunk/skins/waeup_student/process_waeup_login.py
r152 r164 37 37 pd.getContent().edit(mapping=pkw) 38 38 context.notifyCPSDocumentCreation(ob=pd) 39 return response.redirect(ma.absolute_url())40 39 40 return response.redirect("%s/eligibility" % ma.absolute_url()) 41 return ma.eligibility(REQUEST=context.REQUEST) 42 -
waeup_product/trunk/skins/waeup_student/register_level.py
r152 r164 2 2 # $Id$ 3 3 """ 4 book an accomodation 4 register for next level 5 5 """ 6 6 type_name = 'StudyLevel' … … 17 17 18 18 res,psm,ds = lt.renderLayout(layout_id= 'study_level', 19 schema_id= ' metadata',19 schema_id= 'study_level', 20 20 context=context, 21 21 mapping=validate and REQUEST, … … 28 28 create = 1, 29 29 type_name = type_name, 30 #psm = 'Not yet active',31 psm = 'Please correct your errors',30 psm = str(ds), 31 #psm = 'Please correct your errors', 32 32 ) 33 33 elif psm == '': … … 40 40 41 41 elif psm == 'valid': 42 psm = (ds) 43 oid = ds.get('Title') 44 if hasattr(context,oid): 42 voc = pv.courselevel 43 level_id = voc.items()[0][0] 44 level = getattr(context,level_id,None) 45 if level: 45 46 return context.common_edit_form(rendered = res, 46 47 create = 1, 47 48 type_name = type_name, 48 psm = 'You already registered for that level',49 psm = "You have already registered for Level %s" % voc.get(level_id) 49 50 ) 50 context.invokeFactory(type_name,oid)51 object = getattr(context,oid)52 voc = pv.courselevel53 ds.set('Title',voc.get( oid))51 52 context.invokeFactory(type_name,level_id) 53 object = getattr(context,level_id) 54 ds.set('Title',voc.get(level_id)) 54 55 object.getContent().edit(mapping=ds,proxy=object) 55 56 context.notifyCPSDocumentCreation(ob=object) 56 psm = 'new %s created' % oid57 semester_id = 'Semester_1_%s_%s' % ( oid,context.getId())57 psm = 'new %s created' % level_id 58 semester_id = 'Semester_1_%s_%s' % (level_id,context.getId()) 58 59 object.invokeFactory('Semester',semester_id) 59 60 semester = getattr(object,semester_id) 60 61 semester.getContent().edit(mapping={'Title': 'First Semester'}) 61 semester_id = 'Semester_2_%s_%s' % ( oid,context.getId())62 semester_id = 'Semester_2_%s_%s' % (level_id,context.getId()) 62 63 object.invokeFactory('Semester',semester_id) 63 64 semester = getattr(object,semester_id)
Note: See TracChangeset for help on using the changeset viewer.