Ignore:
Timestamp:
16 Nov 2005, 16:44:13 (19 years ago)
Author:
joachim
Message:

=post-primary results adding

Location:
waeup_product/trunk/skins
Files:
7 edited
3 copied

Legend:

Unmodified
Added
Removed
  • waeup_product/trunk/skins/waeup_default/getWAeUPLayouts.py

    r178 r179  
    274274                'title': 'Email',
    275275                'fields': ('email',),
    276                 'is_required': False,
     276                'is_required': True,
    277277                'label': 'Email',
    278278                'label_edit': 'Email',
     
    869869}###)
    870870
    871 student_documents = { ###(
     871student_personal_addon = { ###(
    872872    'widgets': {
    873         'photo': { ###(
    874             'type': 'Photo Widget',
    875             'data': {
    876                 'title': '',
    877                 'fields': ('photo',),
    878                 'is_required': False,
    879                 'label': 'Personal Picture',
    880                 'label_edit': 'Personal Picture',
    881                 'description': '',
    882                 'help': '',
    883                 'is_i18n': False,
    884                 'readonly_layout_modes': (),
    885                 'hidden_layout_modes': (),
    886                 'hidden_readonly_layout_modes': (),
    887                 'hidden_empty': False,
    888                 'hidden_if_expr': '',
    889                 'widget_mode_expr': '',
    890                 'css_class': '',
    891                 'css_class_expr': '',
    892                 'javascript_expr': '',
    893                 'deletable': True,
    894                 'size_max': 204800,
    895                 'display_width': 90,
    896                 'display_height': 180,
    897                 'allow_resize': True,
    898                 'render_position': 'left',
    899                 'configurable': 'nothing',
    900                 'keep_original': 1,
    901             },
    902         },###)
    903         'birth_certificate': { ###(
    904             'type': 'Image Widget',
    905             'data': {
    906                 'title': '',
    907                 'fields': ('birth_certificate',),
    908                 'is_required': False,
    909                 'label': 'Birth Certificate',
    910                 'label_edit': 'Birth Certificate',
    911                 'description': '',
    912                 'help': '',
    913                 'is_i18n': False,
    914                 'readonly_layout_modes': (),
    915                 'hidden_layout_modes': (),
    916                 'hidden_readonly_layout_modes': (),
    917                 'hidden_empty': False,
    918                 'hidden_if_expr': '',
    919                 'widget_mode_expr': '',
    920                 'css_class': '',
    921                 'css_class_expr': '',
    922                 'javascript_expr': '',
    923                 'deletable': True,
    924                 'size_max': 204800,
    925                 'display_width': 300,
    926                 'display_height':600,
    927                 'allow_resize': True,
    928             },
    929         },###)
    930         'passport': { ###(
    931             'type': 'Image Widget',
    932             'data': {
    933                 'title': '',
    934                 'fields': ('passport',),
    935                 'is_required': False,
    936                 'label': 'scanned Passport',
    937                 'label_edit': 'scanned Passport',
    938                 'description': '',
    939                 'help': '',
    940                 'is_i18n': False,
    941                 'readonly_layout_modes': (),
    942                 'hidden_layout_modes': (),
    943                 'hidden_readonly_layout_modes': (),
    944                 'hidden_empty': False,
    945                 'hidden_if_expr': '',
    946                 'widget_mode_expr': '',
    947                 'css_class': '',
    948                 'css_class_expr': '',
    949                 'javascript_expr': '',
    950                 'deletable': True,
    951                 'size_max': 204800,
    952                 'display_width': 300,
    953                 'display_height':600,
    954                 'allow_resize': True,
    955             },
    956         },###)
    957         'results_first': { ###(
    958             'type': 'Image Widget',
    959             'data': {
    960                 'title': '',
    961                 'fields': ('results_first',),
    962                 'is_required': False,
    963                 'label': '1st Sitting Results',
    964                 'label_edit': '1st Sitting Results',
    965                 'description': '',
    966                 'help': '',
    967                 'is_i18n': False,
    968                 'readonly_layout_modes': (),
    969                 'hidden_layout_modes': (),
    970                 'hidden_readonly_layout_modes': (),
    971                 'hidden_empty': False,
    972                 'hidden_if_expr': '',
    973                 'widget_mode_expr': '',
    974                 'css_class': '',
    975                 'css_class_expr': '',
    976                 'javascript_expr': '',
    977                 'deletable': True,
    978                 'size_max': 204800,
    979                 'display_width': 300,
    980                 'display_height':600,
    981                 'allow_resize': True,
    982             },
    983         },###)
    984         'results_second': { ###(
    985             'type': 'Image Widget',
    986             'data': {
    987                 'title': '',
    988                 'fields': ('results_second',),
    989                 'is_required': False,
    990                 'label': '2nd Sitting Results',
    991                 'label_edit': '2nd Sitting Results',
    992                 'description': '',
    993                 'help': '',
    994                 'is_i18n': False,
    995                 'readonly_layout_modes': (),
    996                 'hidden_layout_modes': (),
    997                 'hidden_readonly_layout_modes': (),
    998                 'hidden_empty': False,
    999                 'hidden_if_expr': '',
    1000                 'widget_mode_expr': '',
    1001                 'css_class': '',
    1002                 'css_class_expr': '',
    1003                 'javascript_expr': '',
    1004                 'deletable': True,
    1005                 'size_max': 40960,
    1006                 'display_width': 300,
    1007                 'display_height':600,
    1008                 'allow_resize': True,
    1009             },
    1010         },###)
    1011     },
    1012     'layout': {
    1013         'style_prefix': 'layout_personal_',
    1014         'flexible_widgets': (),
    1015         'ncols': 1,
    1016         'rows': [
    1017             [{'widget_id': 'photo', 'ncols': 1},],
    1018             [{'widget_id': 'birth_certificate', 'ncols': 1},],
    1019             [{'widget_id': 'passport', 'ncols': 1},],
    1020             [{'widget_id': 'results_first', 'ncols': 1},],
    1021             [{'widget_id': 'results_second', 'ncols': 1},],
    1022         ]
    1023     },
    1024 }
    1025 
    1026 ###)
    1027 
    1028 student_eligibility = { ###(
    1029     'widgets': {
    1030         'firstname': firstname,
     873        'firstname': middlename,
    1031874        'middlename': middlename,
    1032875        'lastname': lastname,
     
    1051894        ]
    1052895    },
     896}###)
     897
     898schoolresults = { ###(
     899            'type': 'Ordered List Widget',
     900            'data': {
     901                'title': '',
     902                'fields': ['schoolresults'],
     903                'is_required': 0,
     904                'label': 'School Results',
     905                'label_edit': 'School Results',
     906                'description': '',
     907                'help': '',
     908                'is_i18n': 0,
     909                'readonly_layout_modes': [],
     910                'hidden_layout_modes': [],
     911                'hidden_readonly_layout_modes': [],
     912                'hidden_empty': 0,
     913                'hidden_if_expr': '',
     914                'widget_mode_expr': '',
     915                'css_class': '',
     916                'css_class_expr': '',
     917                'javascript_expr': '',
     918                'width': 40,
     919                'height': 5,
     920                'format_empty': '',
     921            },
     922        }###)
     923
     924student_eligibility = { ###(
     925    'widgets': {
     926        'jamb_results': {
     927            'type': 'String Widget',
     928            'data': {
     929                'title': '',
     930                'fields': ('jamb_results',),
     931                'is_required': False,
     932                'label': 'JAMB Results',
     933                'label_edit': 'JAMB Results',
     934                'description': '',
     935                'help': '',
     936                'is_i18n': False,
     937                'readonly_layout_modes': (),
     938                'hidden_layout_modes': (),
     939                'hidden_readonly_layout_modes': (),
     940                'hidden_empty': False,
     941                'hidden_if_expr': '',
     942                'css_class': '',
     943                'widget_mode_expr': '',
     944                'display_width': 20,
     945                'size_max': 0,
     946            },
     947        },
     948        'jamb_aggregate': {
     949            'type': 'Int Widget',
     950            'data': {
     951                'title': 'Agregate',
     952                'fields': ('jamb_aggregate',),
     953                'is_required': False,
     954                'label': 'Score',
     955                'label_edit': 'Score',
     956                'description': '',
     957                'help': '',
     958                'is_i18n': False,
     959            },
     960        },
     961        'jamb_listing_date': {
     962            'type': 'Date Widget',
     963            'data': {
     964                'title': 'Listing Date',
     965                'fields': ('jamb_listing_date',),
     966                'is_required': False,
     967                'label': 'Listing Date',
     968                'label_edit': 'Listing Date',
     969                'description': '',
     970                'help': '',
     971                'is_i18n': False,
     972                'readonly_layout_modes': (),
     973                'hidden_layout_modes': (),
     974                'hidden_readonly_layout_modes': (),
     975                'hidden_empty': False,
     976                'hidden_if_expr': '',
     977                'css_class': '',
     978                'widget_mode_expr': '',
     979                'display_width': 3,
     980                'size_max': 0,
     981            },
     982        },
     983        'faculty': {
     984            'type': 'Select Widget',
     985            'data': {
     986                'title': 'Faculty',
     987                'fields': ('faculty',),
     988                'is_required': True,
     989                'label': 'Faculty',
     990                'label_edit': 'Faculty',
     991                'description': '',
     992                'help': '',
     993                'is_i18n': False,
     994                'vocabulary': 'get_faculties_voc',
     995            },
     996        },
     997        'course': {
     998            'type': 'Select Widget',
     999            'data': {
     1000                'title': 'Study Course',
     1001                'fields': ('course',),
     1002                'is_required': True,
     1003                'label': 'Study Course',
     1004                'label_edit': 'Study Course',
     1005                'description': '',
     1006                'help': 'The course to study',
     1007                'vocabulary': 'get_departments_voc',
     1008                'is_i18n': False,
     1009            },
     1010        },
     1011        'schoolresults': schoolresults,
     1012    },
     1013    'layout': {
     1014        'style_prefix': 'layout_waeup_',
     1015        'flexible_widgets': (),
     1016        'ncols': 1,
     1017        'rows': [
     1018            [{'widget_id': 'jamb_results', 'ncols': 1},],
     1019            [{'widget_id': 'jamb_aggregate', 'ncols': 1},],
     1020            [{'widget_id': 'jamb_listing_date', 'ncols': 1},],
     1021            [{'widget_id': 'faculty', 'ncols': 1},],
     1022            [{'widget_id': 'course', 'ncols': 1},],
     1023            [{'widget_id': 'schoolresults', 'ncols': 1},],
     1024        ]
     1025    },
     1026}###)
     1027
     1028student_schoolresults = { ###(
     1029    'widgets': {
     1030        'schoolresults': schoolresults,
     1031    },
     1032    'layout': {
     1033        'style_prefix': 'layout_results_',
     1034        'flexible_widgets': (),
     1035        'ncols': 1,
     1036        'rows': [
     1037            #[{'widget_id': 'jamb_results', 'ncols': 1},],
     1038            #[{'widget_id': 'jamb_aggregate', 'ncols': 1},],
     1039            #[{'widget_id': 'jamb_listing_date', 'ncols': 1},],
     1040            #[{'widget_id': 'faculty', 'ncols': 1},],
     1041            #[{'widget_id': 'course', 'ncols': 1},],
     1042            [{'widget_id': 'schoolresults', 'ncols': 1},],
     1043        ]
     1044    },
     1045}###)
     1046
     1047student_documents = { ###(
     1048    'widgets': {
     1049        'photo': { ###(
     1050            'type': 'Photo Widget',
     1051            'data': {
     1052                'title': '',
     1053                'fields': ('photo',),
     1054                'is_required': False,
     1055                'label': 'Personal Picture',
     1056                'label_edit': 'Personal Picture',
     1057                'description': '',
     1058                'help': '',
     1059                'is_i18n': False,
     1060                'readonly_layout_modes': (),
     1061                'hidden_layout_modes': (),
     1062                'hidden_readonly_layout_modes': (),
     1063                'hidden_empty': False,
     1064                'hidden_if_expr': '',
     1065                'widget_mode_expr': '',
     1066                'css_class': '',
     1067                'css_class_expr': '',
     1068                'javascript_expr': '',
     1069                'deletable': True,
     1070                'size_max': 204800,
     1071                'display_width': 90,
     1072                'display_height': 180,
     1073                'allow_resize': True,
     1074                'render_position': 'left',
     1075                'configurable': 'nothing',
     1076                'keep_original': 1,
     1077            },
     1078        },###)
     1079        'birth_certificate': { ###(
     1080            'type': 'Image Widget',
     1081            'data': {
     1082                'title': '',
     1083                'fields': ('birth_certificate',),
     1084                'is_required': False,
     1085                'label': 'Birth Certificate',
     1086                'label_edit': 'Birth Certificate',
     1087                'description': '',
     1088                'help': '',
     1089                'is_i18n': False,
     1090                'readonly_layout_modes': (),
     1091                'hidden_layout_modes': (),
     1092                'hidden_readonly_layout_modes': (),
     1093                'hidden_empty': False,
     1094                'hidden_if_expr': '',
     1095                'widget_mode_expr': '',
     1096                'css_class': '',
     1097                'css_class_expr': '',
     1098                'javascript_expr': '',
     1099                'deletable': True,
     1100                'size_max': 204800,
     1101                'display_width': 300,
     1102                'display_height':600,
     1103                'allow_resize': True,
     1104            },
     1105        },###)
     1106        'passport': { ###(
     1107            'type': 'Image Widget',
     1108            'data': {
     1109                'title': '',
     1110                'fields': ('passport',),
     1111                'is_required': False,
     1112                'label': 'scanned Passport',
     1113                'label_edit': 'scanned Passport',
     1114                'description': '',
     1115                'help': '',
     1116                'is_i18n': False,
     1117                'readonly_layout_modes': (),
     1118                'hidden_layout_modes': (),
     1119                'hidden_readonly_layout_modes': (),
     1120                'hidden_empty': False,
     1121                'hidden_if_expr': '',
     1122                'widget_mode_expr': '',
     1123                'css_class': '',
     1124                'css_class_expr': '',
     1125                'javascript_expr': '',
     1126                'deletable': True,
     1127                'size_max': 204800,
     1128                'display_width': 300,
     1129                'display_height':600,
     1130                'allow_resize': True,
     1131            },
     1132        },###)
     1133        'results_first': { ###(
     1134            'type': 'Image Widget',
     1135            'data': {
     1136                'title': '',
     1137                'fields': ('results_first',),
     1138                'is_required': False,
     1139                'label': '1st Sitting Results',
     1140                'label_edit': '1st Sitting Results',
     1141                'description': '',
     1142                'help': '',
     1143                'is_i18n': False,
     1144                'readonly_layout_modes': (),
     1145                'hidden_layout_modes': (),
     1146                'hidden_readonly_layout_modes': (),
     1147                'hidden_empty': False,
     1148                'hidden_if_expr': '',
     1149                'widget_mode_expr': '',
     1150                'css_class': '',
     1151                'css_class_expr': '',
     1152                'javascript_expr': '',
     1153                'deletable': True,
     1154                'size_max': 204800,
     1155                'display_width': 300,
     1156                'display_height':600,
     1157                'allow_resize': True,
     1158            },
     1159        },###)
     1160        'results_second': { ###(
     1161            'type': 'Image Widget',
     1162            'data': {
     1163                'title': '',
     1164                'fields': ('results_second',),
     1165                'is_required': False,
     1166                'label': '2nd Sitting Results',
     1167                'label_edit': '2nd Sitting Results',
     1168                'description': '',
     1169                'help': '',
     1170                'is_i18n': False,
     1171                'readonly_layout_modes': (),
     1172                'hidden_layout_modes': (),
     1173                'hidden_readonly_layout_modes': (),
     1174                'hidden_empty': False,
     1175                'hidden_if_expr': '',
     1176                'widget_mode_expr': '',
     1177                'css_class': '',
     1178                'css_class_expr': '',
     1179                'javascript_expr': '',
     1180                'deletable': True,
     1181                'size_max': 40960,
     1182                'display_width': 300,
     1183                'display_height':600,
     1184                'allow_resize': True,
     1185            },
     1186        },###)
     1187    },
     1188    'layout': {
     1189        'style_prefix': 'layout_personal_',
     1190        'flexible_widgets': (),
     1191        'ncols': 1,
     1192        'rows': [
     1193            [{'widget_id': 'photo', 'ncols': 1},],
     1194            [{'widget_id': 'birth_certificate', 'ncols': 1},],
     1195            [{'widget_id': 'passport', 'ncols': 1},],
     1196            [{'widget_id': 'results_first', 'ncols': 1},],
     1197            [{'widget_id': 'results_second', 'ncols': 1},],
     1198        ]
     1199    },
    10531200}
     1201
    10541202###)
    10551203
     
    22292377layouts['student_documents'] = student_documents
    22302378layouts['student_personal'] = student_personal_layout
     2379layouts['student_personal_addon'] = student_personal_addon
    22312380layouts['student_eligibility'] = student_eligibility
     2381layouts['student_schoolresults'] = student_schoolresults
    22322382layouts['accommodation'] = accommodation
    22332383layouts['accobook'] = accobook
  • waeup_product/trunk/skins/waeup_default/getWAeUPSchemas.py

    r176 r179  
    415415        },
    416416    },
     417     'username': {
     418        'type': 'CPS String Field',
     419        'data': {
     420            'is_searchabletext': 1,
     421        },
     422    },
    417423     'email': {
    418424        'type': 'CPS String Field',
     
    443449###)
    444450
     451student_eligibility = { ###(
     452}###)
     453
    445454student_documents = { ###(
    446455     'photo': {
     
    478487
    479488student_eligibility = { ###(
    480      'firstname': {
    481         'type': 'CPS String Field',
    482         'data': {
    483             'is_searchabletext': 1,
    484         },
    485     },
    486     'middlename': {
    487         'type': 'CPS String Field',
    488         'data': {
    489             'is_searchabletext': 1,
    490         },
    491     },
    492      'lastname': {
    493         'type': 'CPS String Field',
    494         'data': {
    495             'is_searchabletext': 1,
    496         },
    497     },
    498      'username': {
    499         'type': 'CPS String Field',
    500         'data': {
    501             'is_searchabletext': 0,
    502         },
    503     },
    504      'sex': {
    505         'type': 'CPS Boolean Field',
    506         'default_expr': 'python:True',
    507         'data': {
    508             'is_searchabletext': 0,
    509         },
    510     },
    511 ##     'birthday': {
    512 ##        'type': 'CPS DateTime Field',
    513 ##        'data': {
    514 ##            'is_searchabletext': 1,
    515 ##        },
    516 ##    },
    517      'age': {
     489    'reg_nr': {
     490        'type': 'CPS String Field',
     491        'data': {
     492            'default_expr': 'string:',
     493            'is_searchabletext': True,
     494        },
     495    },
     496    'jamb_results': {
     497        'type': 'CPS String Field',
     498        'data': {
     499            'default_expr': 'string:',
     500        },
     501    },
     502    'jamb_aggregate': {
     503        'type': 'CPS String Field',
     504        'data': {
     505            'default_expr': 'string:',
     506            'is_searchabletext': False,
     507        },
     508    },
     509    'faculty': {
     510        'type': 'CPS String Field',
     511        'data': {
     512            'default_expr': 'string:',
     513            'is_searchabletext': False,
     514        },
     515    },
     516    'course': {
     517        'type': 'CPS String Field',
     518        'data': {
     519            'default_expr': 'string:',
     520            'is_searchabletext': False,
     521        },
     522    },
     523    'jamb_listing_date': {
    518524        'type': 'CPS DateTime Field',
    519525        'data': {
    520             'is_searchabletext': 0,
    521         },
    522     },
    523     'email': {
    524         'type': 'CPS String Field',
    525         'data': {
    526             'is_searchabletext': 1,
    527         },
    528     },
    529     'pw': {
    530         'type': 'CPS String Field',
    531         'data': {
    532             'default_expr': 'string:default',
    533         },
    534     },
    535     'rpw': {
    536         'type': 'CPS String Field',
    537         'data': {
    538             'default_expr': 'string:default',
    539         },
    540     },
    541 ##     'photo': {
    542 ##        'type': 'CPS Image Field',
    543 ##        'data': {
    544 ##            'is_searchabletext': 0,
    545 ##        },
    546 ##    },
    547 ##     'birth_certificate': {
    548 ##        'type': 'CPS Image Field',
    549 ##        'data': {
    550 ##            'is_searchabletext': 0,
    551 ##        },
    552 ##    },
     526            'is_searchabletext': False,
     527        },
     528    },
     529    'schoolresults': { ###(
     530        'type': 'CPS List List Field',
     531        'data': {
     532            'is_searchabletext': False,
     533            },
     534        },###)
    553535}
    554536###)
     
    887869schemas['student_admission'] = student_admission
    888870schemas['student_clearance'] = student_clearance
     871schemas['student_eligibility'] = student_eligibility
    889872schemas['student_documents'] = student_documents
    890 schemas['student_eligibility'] = student_eligibility
    891873schemas['student_accommodation'] = student_accommodation
    892874schemas['student_hostel_fee'] = student_hostel_fee
  • waeup_product/trunk/skins/waeup_default/getWAeUPTypes.py

    r173 r179  
    289289          },
    290290         {'id'        : 'eligibility',
    291           'name'      : 'eligibility',
     291          'name'      : 'Post-Primary Results',
    292292          'action'    : 'eligibility',
    293293          'condition':  'object/memberIsOwner',
    294294          'permission': (ModifyPortalContent,),
    295           'visible': False,
     295          'visible': True,
    296296          },
    297297         {'id'        : 'JAMB',
     
    437437###)
    438438
     439student_eligibility_type = { ###(
     440    'title': "Student eligibility data",
     441    'description': '',
     442    'content_icon': '',
     443    'content_meta_type': 'StudentEligibility',
     444    'product': 'WAeUP',
     445    'factory': 'addStudentEligibility',
     446    'immediate_view': 'temporary_view_all',
     447    'global_allow': True,
     448    'filter_content_types': True,
     449    'allowed_content_types': (),
     450    'allow_discussion': False,
     451    'cps_is_searchable': True,
     452    'cps_proxy_type': 'document',
     453    'cps_display_as_document_in_listing': True,
     454    'cps_is_portalbox': False,
     455    'schemas': ['student_eligibility'],
     456    'layouts': ['student_eligibility'],
     457    'flexible_layouts': (),
     458    'storage_methods': (),
     459    'cps_workspace_wf': 'workspace_content_wf',
     460    'cps_section_wf': 'section_content_wf',
     461    'actions': (
     462         {'id': 'view',
     463          'name': 'Standard View',
     464          'action': 'temporary_view_all',
     465          'permission': (View,),
     466          'category': 'object',
     467          'visible': True,},
     468         {'id': 'edit',
     469          'name': 'action_edit',
     470          'action': 'string:${object_url}/student_eligibility_edit_form',
     471          'permission': (ModifyPortalContent,),
     472          'category': 'object',
     473          'visible': True,},
     474         {'id': 'metadata',
     475          'name': 'action_metadata',
     476          'action': 'cpsdocument_metadata',
     477          'condition': "python:member and 'Manager' in member.getRoles()",
     478          'permissions': (UniversityManage,)},
     479          )
     480}
     481###)
     482
    439483student_documents = { ###(
    440484    'title': "Students documents data",
     
    934978types['Student'] = student_type
    935979types['StudentDocuments'] = student_documents
     980types['StudentEligibility'] = student_eligibility_type
    936981types['StudentPersonal'] = student_personal_type
    937982types['StudyLevel'] = study_level_folder
  • waeup_product/trunk/skins/waeup_student/eligibility.py

    r176 r179  
    1 ##parameters=REQUEST
     1##parameters=REQUEST=None
    22# $Id$
    33"""
     
    55return html renderer + psm
    66"""
    7 type_name = 'Jamb'
    8 ti = context.portal_types[type_name]
    9 
    10 REQUEST.set('type_name',type_name)
    11 
    12 validate = REQUEST.has_key("cpsdocument_edit_button")
     7request = REQUEST
     8rget = request.get
     9rset = request.set
     10fget = request.form.get
     11fhas = request.form.has_key
    1312
    1413
     
    1615pr = context.portal_registration
    1716pm = context.portal_membership
     17eli = context.ELIGIBILITY.getContent()
     18sr = eli.schoolresults
    1819
    19 jamb = getattr(context,'JAMB')
    20 jamb_rendered = jamb.getContent().render(layout_id = 'admission_slip',
    21                                layout_mode = 'view',
    22                                schema_id = 'jamb')
    23 
    24 res,psm,ds = lt.renderLayout(layout_id= 'student_eligibility',
     20res,psm,ds = lt.renderLayout(layout_id= 'student_schoolresults',
    2521                      schema_id= 'student_eligibility',
    2622                      context=context,
    27                       mapping=validate and REQUEST,
     23                      mapping=request,
    2824                      ob={},
    2925                      layout_mode='create',
     26                      formaction = "eligibility",
     27                      schoolresults = sr,
    3028                      )
    31 res = jamb_rendered + res
    32 if psm == 'invalid':
    33     return context.eligibility_form(rendered = res,
     29
     30inr = 0
     31if fhas('add') and (fget('type') or fget('subject') or fget('result')):
     32    sr.append((fget('type'),fget('subject'),fget('result')))
     33    psm = "new result added"
     34elif fhas('change') and fget('keys'):
     35    for k in fget('keys'):
     36        sr[int(k)] = (fget('type_%s' % k),fget('subject_%s' % k),fget('result_%s' % k))
     37        inr += 1
     38    psm = "%s items changed" % inr
     39elif fhas('delete') and fget('keys'):
     40    new = []
     41    todelete = fget('keys')
     42    for k in range(len(sr)):
     43        if str(k) not in todelete:
     44            new.append(sr[k])
     45    inr = len(todelete)
     46    sr = new
     47    psm = "%s items deleted" % inr
     48else:
     49    psm = ''
     50eli.edit(mapping={'schoolresults': sr})
     51res,dummy,ds = lt.renderLayout(layout_id= 'student_schoolresults',
     52                      schema_id= 'student_eligibility',
     53                      context=context,
     54                      mapping=request,
     55                      ob={},
     56                      layout_mode='create',
     57                      formaction = "eligibility",
     58                      schoolresults = sr,
     59                      )
     60
     61return context.eligibility_form(rendered = res,
    3462                                 #psm = str(ds),
    35                                  psm = "Please correct your input",
    36                                  ds = ds,
     63                                 psm = psm,
    3764                                 )
    38 elif psm == '':
    39     return context.eligibility_form(rendered = res,
    40                                  psm = None,
    41                                  ds = ds,
    42                                  )
    43 elif psm == 'valid':
    44     s_personal = context.PERSONAL.getContent()
    45     s_personal.edit(mapping={'email': ds.get('email')})
    46     #pw = REQUEST.get("widget__pw")
    47     #pm.setPassword(pw)
    48 psm = 'Email has been successfully set.'
    49 return context.REQUEST.RESPONSE.redirect('%s' % context.portal_url.getUrlFromRpath('/students'))
    50 
    51 ##return context.eligibility_form(rendered = res,
    52 ##                                 psm = psm,
     65##elif psm == '':
     66##    return context.eligibility_form(rendered = res,
     67##                                 psm = None,
    5368##                                 ds = ds,
    5469##                                 )
     70##elif psm == 'valid':
     71##    s_personal = context.PERSONAL.getContent()
     72##    s_personal.edit(mapping={'email': ds.get('email')})
     73##    #pw = REQUEST.get("widget__pw")
     74##    #pm.setPassword(pw)
     75##psm = 'Email has been successfully set.'
     76##return context.REQUEST.RESPONSE.redirect('%s' % context.portal_url.getUrlFromRpath('/students'))
     77##
     78####return context.eligibility_form(rendered = res,
     79####                                 psm = psm,
     80####                                 ds = ds,
     81####                                 )
  • waeup_product/trunk/skins/waeup_student/eligibility_form.pt

    r164 r179  
    11<tal:block define="rendered_main options/rendered;
    22                   portal_status_message options/psm;
    3                    data_storage options/ds;
    43                   jamb options/jamb/getContent|nothing;
    54                   edition python:1;"
     
    1413    </metal:block>
    1514      <metal:block fill-slot="main">
    16         <h1> Fill in your Email and give a new Password </h1>
     15        <h1> Fill in your post-primary school results</h1>
    1716        <div tal:replace="structure rendered_main" />
    1817      </metal:block>
  • waeup_product/trunk/skins/waeup_student/layout_results_create.pt

    r175 r179  
    1010             edit_form     python:ti and ti.getActionById('edit',   'cpsdocument_edit_form') or  'cpsdocument_edit_form';
    1111             metadata_form python:ti and ti.getActionById('metadata', 'cpsdocument_metadata') or 'cpsdocument_metadata';
    12              formaction string:check_admission_form;
     12             formaction options/formaction;
    1313             first_layout options/first_layout|python:0;
    1414             last_layout options/last_layout|python:0;
    1515             is_flexible options/is_flexible;
    1616             cpsmcat nocall:here/translation_service;
     17             results options/schoolresults;
    1718             "
    1819             >
    19   <form action='eligibility' method='post'
     20  <form action='eligibility' method='post' tal:attributes="action formaction"
    2021        enctype='multipart/form-data' class='workflow'>
    21     <div class='group'>
    22       <div class='documentFields'>
    23         <table width="100%" cellpadding="2" cellspacing="2" summary="Form layout">
    24           <tr tal:repeat="row layout/rows" valign="top">
    25             <td tal:repeat="cell row"
    26                 tal:attributes="colspan cell/ncols">
    27               <tal:block define="widget cell/widget;
    28               wid widget/getWidgetId;
    29               dm options/datastructure/getDataModel;
    30               err python:ds.getError(wid);
    31               err_mapping python:ds.getErrorMapping(wid);
    32               is_required widget/is_required|nothing;
    33               tooltip_id python:wid + '_help';
    34               widget_css_class cell/widget_css_class|nothing;
    35               widget_css_class python:test(is_flexible, 'group', widget_css_class);
    36               css_class python:test(err, 'row error',
    37               test(is_flexible, 'group', 'row'))"
    38               >
    39                 <div tal:attributes="class widget_css_class;
    40                 id python:widget.getHtmlWidgetId()+'_widget';"
    41                 >
    42                   <div class="label" tal:condition="widget/label_edit"
    43                        tal:attributes="class python:test(is_required, 'label required','label')">
    44                     <label i18n:translate="" tal:condition="widget/is_i18n"
    45                            tal:content="widget/label_edit"
    46                            tal:attributes="for cell/widget_input_area_id|nothing;">label</label>
    47                     <label tal:condition="not:widget/is_i18n"
    48                            tal:content="widget/label_edit"
    49                            tal:attributes="for cell/widget_input_area_id|nothing;">label</label>
    50                   </div>
    51                   <button type="button" class="tooltipControl"
    52                           tal:condition="widget/help"
    53                           tal:attributes="onclick python:'toggleElementVisibility(\'%s\')' % tooltip_id;"> ? </button>
    54                   <div class="field">
    55                     <div tal:replace="structure cell/widget_rendered"/>
    56                   </div>
    57                   <div class="tooltipArea" style="visibility: hidden;"
    58                        tal:condition="widget/help"
    59                        tal:attributes="id tooltip_id;
    60                        onclick python:'showElement(false, \'%s\')' % tooltip_id;"
    61                        >
    62                     <tal:block i18n:translate="" tal:condition="widget/is_i18n"
    63                                tal:content="widget/help">i18_key-help_for_this_field</tal:block>
    64                     <tal:block tal:condition="not:widget/is_i18n"
    65                                tal:content="widget/help">This is the help for this field</tal:block>
    66                   </div>
    67                   <tal:block condition="err">
    68                     <tal:block define="msg python:cpsmcat(err, mapping=err_mapping)">
    69                       <br /><em style="color: red"
    70                                 tal:content="msg">err</em>
    71                     </tal:block>
    72                   </tal:block>
    73                 </div>
    74               </tal:block>
    75             </td>
    76           </tr>
    77         </table>
    78         <input type="submit" class="standalone" name="cpsdocument_edit_button" value="submit" />
    79       </div>       
    80     </div>
     22    <table cellspacing="0" cellpadding="2" border="0" width="100%" tal:condition="results|nothing">
     23      <tr>
     24        <td align="left" valign="top">
     25          &nbsp;
     26        </td>
     27        <td align="left" valign="top">
     28          <div>Type</div>
     29        </td>
     30        <td align="left" valign="top">
     31          <div>Subject</div>
     32        </td>
     33        <td align="left" valign="top">
     34          <div>Result</div>
     35        </td>
     36      </tr>
     37      <span tal:repeat="row results" tal:omit-tag="">
     38        <tr tal:define="rindex repeat/row/index">
     39          <td align="left" valign="top">
     40            <input type="checkbox" name="keys:list" value="100" tal:attributes="value string:${repeat/row/index}"/>
     41          </td>
     42          <td align="left" valign="top">
     43            <div>
     44              <input type="text" name="key_0" value="100" size="20"
     45                     tal:attributes="name string:type_${rindex};value python:row[0]" />
     46            </div>
     47          </td>
     48          <td align="left">
     49            <div class="form-item">
     50              <input type="text" name="label_0" value="Year 1 (100 Level)" size="40"
     51                     tal:attributes="name string:subject_${rindex};value python:row[1]" />
     52            </div>
     53          </td>
     54          <td align="left">
     55            <div class="form-item">
     56              <input type="text" name="msgid_0" value="" size="10"
     57                     tal:attributes="name string:result_${rindex};value python:row[2]" />
     58            </div>
     59          </td>
     60        </tr>
     61      </span>
     62      <tr>
     63        <td align="left" colspan="3">
     64          <input type="submit" name="change" value=" Change " />
     65          <input type="submit" name="delete" value=" Delete " />
     66        </td>
     67      </tr>
     68    </table>
     69    <table cellspacing="0" cellpadding="2" border="0" width="100%">
     70      <tr>
     71        <td align="left" valign="top" colspan="2">
     72          <div>Add a new postprimary school result</div>
     73        </td>
     74      </tr>
     75      <tr>
     76        <td align="left" valign="top">
     77          &nbsp;
     78        </td>
     79        <td align="left" valign="top">
     80          <div>Type</div>
     81        </td>
     82        <td align="left" valign="top">
     83          <div>Subject</div>
     84        </td>
     85        <td align="left" valign="top">
     86          <div>Result</div>
     87        </td>
     88      </tr>
     89      <tr>
     90        <td align="left" valign="top">
     91          &nbsp;
     92        </td>
     93        <td align="left" valign="top">
     94          <div>
     95            <input type="text" name="type" value="" size="20" />
     96          </div>
     97        </td>
     98        <td align="left">
     99          <div class="form-item">
     100            <input type="text" name="subject" value="" size="40" />
     101          </div>
     102        </td>
     103        <td align="left">
     104          <div class="form-item">
     105            <input type="text" name="result" value="" size="10" />
     106          </div>
     107        </td>
     108      </tr>
     109      <tr>
     110        <td align="left" colspan="3">
     111          <input type="submit" name="add" value=" Add " />
     112        </td>
     113      </tr>
     114    </table>
    81115  </form>
    82116</metal:block>
  • waeup_product/trunk/skins/waeup_student/personal_addon.py

    r176 r179  
    2222                               schema_id = 'jamb')
    2323
    24 res,psm,ds = lt.renderLayout(layout_id= 'student_eligibility',
    25                       schema_id= 'student_eligibility',
     24res,psm,ds = lt.renderLayout(layout_id= 'student_personal_addon',
     25                      schema_id= 'student_personal',
    2626                      context=context,
    2727                      mapping=validate and REQUEST,
     
    3131res = jamb_rendered + res
    3232if psm == 'invalid':
    33     return context.eligibility_form(rendered = res,
     33    return context.personal_addon_form(rendered = res,
    3434                                 #psm = str(ds),
    3535                                 psm = "Please correct your input",
     
    3737                                 )
    3838elif psm == '':
    39     return context.eligibility_form(rendered = res,
     39    return context.personal_addon_form(rendered = res,
    4040                                 psm = None,
    4141                                 ds = ds,
     
    4646    #pw = REQUEST.get("widget__pw")
    4747    #pm.setPassword(pw)
    48 psm = 'Email has been successfully set.'
    49 return context.REQUEST.RESPONSE.redirect('%s' % context.portal_url.getUrlFromRpath('/students'))
     48psm = 'Email has been successfully set. '
     49##return context.REQUEST.RESPONSE.redirect('%s' % context.portal_url.getUrlFromRpath('/students'))
    5050
    51 ##return context.eligibility_form(rendered = res,
    52 ##                                 psm = psm,
    53 ##                                 ds = ds,
    54 ##                                 )
     51return context.eligibility()
  • waeup_product/trunk/skins/waeup_student/personal_addon_form.pt

    r175 r179  
    1414    </metal:block>
    1515      <metal:block fill-slot="main">
    16         <h1> Fill in your Email and give a new Password </h1>
     16        <h1> Fillin Your Email</h1>
    1717        <div tal:replace="structure rendered_main" />
    1818      </metal:block>
  • waeup_product/trunk/skins/waeup_student/process_waeup_login.py

    r166 r179  
    3232pkw['aggregate'] = getattr(jc,'aggregate')
    3333pkw['faculty'] = getattr(jc,'faculty')
     34pkw['course'] = getattr(jc,'course')
    3435pkw['age'] = getattr(jc,'age')
     36pkw['jamb_results'] = getattr(jc,'exam_results')
     37pkw['jamb_aggregate'] = getattr(jc,'aggregate')
     38pkw['jamb_listing_date'] = getattr(jc,'listing_date')
    3539pkw['state'] = getattr(jc,'state')
    3640
     
    4347context.notifyCPSDocumentCreation(ob=pd)
    4448
    45 return response.redirect("%s/eligibility" % ma.absolute_url())
    46 return ma.eligibility(REQUEST=context.REQUEST)
     49pdid = 'ELIGIBILITY'
     50ma.invokeFactory('StudentEligibility', pdid)
     51pd = getattr(ma,pdid)
     52pd.getContent().edit(mapping=pkw)
     53context.notifyCPSDocumentCreation(ob=pd)
    4754
     55return response.redirect("%s/personal_addon" % ma.absolute_url())
     56#return ma.personal_addon(REQUEST=context.REQUEST)
     57
  • waeup_product/trunk/skins/waeup_student/register_level.py

    r164 r179  
    2828                                 create = 1,
    2929                                 type_name = type_name,
    30                                  psm = str(ds),
    31                                  #psm = 'Please correct your errors',
     30                                 psm = 'Please correct your errors',
    3231                                 )
    3332elif psm == '':
     
    3635                                 type_name = type_name,
    3736                                 psm = psm,
    38                                  #psm = str(ds),
    3937                                 )
    4038   
Note: See TracChangeset for help on using the changeset viewer.