Changeset 788 for WAeUP_SRP/trunk/skins/waeup_student
- Timestamp:
- 8 Nov 2006, 08:32:36 (18 years ago)
- Location:
- WAeUP_SRP/trunk/skins/waeup_student
- Files:
-
- 4 added
- 1 deleted
- 5 edited
- 1 copied
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/skins/waeup_student/application_edit.py
r784 r788 5 5 ##bind script=script 6 6 ##bind subpath=traverse_subpath 7 ##parameters=REQUEST, cluster=None, cpsdocument_edit_and_view_button=None, action=None7 ##parameters=REQUEST,proceed=None, cpsdocument_edit_button=None, action=None 8 8 ##title= 9 9 # $Id$ … … 17 17 18 18 # Until ajax posts directly to its own script... 19 if 'ajax_edit' in REQUEST.form:20 return context.cpsdocument_edit_ajax(REQUEST, cluster=cluster)19 ##if 'ajax_edit' in REQUEST.form: 20 ## return context.cpsdocument_edit_ajax(REQUEST, cluster=cluster) 21 21 22 22 # Check flexible controls … … 33 33 clear_doc = info['clear_doc'] 34 34 state = context.getStudentInfo()['review_state'] 35 36 if context.portal_type == "Student": 37 if app_doc.passport is None: 38 is_valid, ds = app_doc.validate(request=REQUEST, 39 proxy=app_doc, 40 layout_id = "student_application_fe", 41 layout_mode = 'edit', 42 use_session=True) 43 action = "/application_edit" 44 if is_valid: 45 if app_doc.passport is not None: 46 psm = 'You successfully uploaded your passport image.' 47 args = {'apply_button': 'Apply',} 48 else: 49 psm = "You didn't upload a passport image." 50 args = {} 51 else: 52 psm = 'psm_content_error' 53 args = getFormUidUrlArg(REQUEST) 54 elif 'apply_admission' not in REQUEST.form: 55 is_valid, ds = app_doc.validate(request=REQUEST, 56 proxy=app_doc, 57 layout_id = "student_application_fe", 58 layout_mode = 'edit', 59 use_session=True) 60 action = "/application_edit" 61 if is_valid: 62 args = {} 63 if 'apply_admission' not in REQUEST.form: 64 args = {'apply_button': 'Apply',} 65 psm = 'You successfully uploaded your passport image.' 66 else: 67 psm = 'You applied for admission.' 68 else: 69 args = getFormUidUrlArg(REQUEST) 70 psm = 'psm_content_error' 71 else: 72 psm = '' 73 args = {} 74 if info['review_state'] == "student_created": 75 student.content_status_modify(workflow_action="apply_for_admission") 76 wftool.doActionFor(app,'close',dest_container= app) 77 psm = 'You applied for admission.' 78 action = "/application_view" 79 elif info['review_state'] == "admitted": 80 student.content_status_modify(workflow_action="enter_clearance_pin") 81 #wftool.doActionFor(info['clear'],'open',dest_container=info['clear']) 82 app_doc = info['app_doc'] 83 dc = {} 84 dc['email'] = app_doc.app_email 85 info['clear_doc'].edit(mapping = dc) 86 wftool.doActionFor(app,'close',dest_container= app) 87 psm = 'You successfully started the clearance process.' 88 action = "/clearance_edit" 89 else: 90 action = "/clearance_view" 91 92 else: 93 is_valid, ds = app_doc.validate(request=REQUEST, proxy=context, cluster=cluster, 35 is_valid, ds = app_doc.validate(request=REQUEST, 36 schema_id = 'student_application', 37 layout_id = 'student_application_fe', 38 proxy=app, 94 39 use_session=True) 95 40 96 if action is None: 97 ti = app.getTypeInfo() 98 action = ti.queryMethodID('edit', 'cpsdocument_edit_form') 99 action = '/' + action 100 41 psm = "" 42 args = {} 43 action = "/application_edit_view" 44 if cpsdocument_edit_button: 101 45 if is_valid: 102 comments = REQUEST.get('comments') 103 context.cpsdocument_notify_modification(comments=comments) 104 if cpsdocument_edit_and_view_button is not None: 105 action = '' 106 psm = 'psm_content_changed' 107 args = {} 46 if app_doc.passport is not None: 47 args['proceed'] = 'Continue to Clearance' 48 psm = 'You successfully uploaded your passport image.' 49 else: 50 psm = "You didn't upload a passport image." 51 elif proceed: 52 if is_valid: 53 action = "/request_clearance" 108 54 else: 109 55 psm = 'psm_content_error' 110 args = getFormUidUrlArg(REQUEST)111 112 56 args['portal_status_message'] = psm 113 url = context.absolute_url() + action + '?' + urlencode(args)57 url = app.absolute_url() + action + '?' + urlencode(args) 114 58 REQUEST.RESPONSE.redirect(url) -
WAeUP_SRP/trunk/skins/waeup_student/check_admission.py
r785 r788 5 5 """ 6 6 import DateTime 7 from urllib import urlencode 7 8 current = DateTime.DateTime() 8 9 pr = context.portal_registration 9 10 11 10 type_name = 'StudentApplication' 12 11 ti = context.portal_types[type_name] … … 45 44 elif psm == 'valid': 46 45 s_id = ds.get('s_id') 46 email = ds.get('app_email') 47 47 student = getattr(context.campus.students, s_id) 48 48 review_state = wf.getInfoFor(student,'review_state',None) … … 51 51 return redirect(url) 52 52 pin = str(ds.get('app_ac_pin')) 53 return redirect("%s/logged_in?__ac_name=%s&__ac_password=%s&pin=%s" 54 % (context.absolute_url(),s_id,pin.split('-')[2],pin)) 55 return 53 args = {} 54 args['__ac_name'] = s_id 55 args['__ac_password'] = pin.split('-')[2] 56 args['pin'] = pin 57 args['email'] = email 58 url = "%s/logged_in?%s" % (context.absolute_url(),urlencode(args)) 59 return redirect(url) -
WAeUP_SRP/trunk/skins/waeup_student/clearance_edit_view.pt
r786 r788 1 1 <tal:block define=" 2 2 info context/getStudentInfo; 3 re s python:info['clear_doc'].renderEditDetailed(request=request,4 schema_id='student_clearance',5 layout_id='student_clearance_fe',6 layout_mode='edit',);7 rendered_main python: res[0];3 rendered_main python:info['clear_doc'].render(request=request, 4 layout_mode = 'edit', 5 schema_id='student_clearance', 6 layout_id='student_clearance_fe', 7 layout_mode='edit',); 8 8 form_action string:clearance_edit; 9 9 edition python:True; 10 creation python:False; 10 11 metadata nothing; 11 12 "> 12 13 <metal:block define-macro="edit_form"> 13 14 <metal:block use-macro="here/content_lib_master/macros/master"> 15 <metal:block fill-slot="style_slot"> 16 <link rel="Stylesheet" type="text/css" href="" 17 tal:attributes="href string:${base_url}document.css" /> 14 18 19 <metal:block define-macro="widgets_javascript"> 20 <!-- XXX this has to move to CPSSchemas --> 21 <style type="text/css" 22 tal:content="string:@import url(${base_url}calendar-win2k-1.css);"></style> 23 <script type="text/javascript" src="calendar.js" 24 tal:attributes="src string:${base_url}calendar.js"></script> 25 <script type="text/javascript" src="lang/calendar-en.js" 26 tal:define="local cpsmcat/getSelectedLanguage" 27 tal:attributes="src string:${base_url}lang/calendar-${local}.js"></script> 28 <script type="text/javascript" src="calendar-setup.js" 29 tal:attributes="src string:${base_url}calendar-setup.js"></script> 30 <script type="text/javascript" src="prototype.js" 31 tal:attributes="src string:${base_url}prototype.js"></script> 32 <script type="text/javascript" src="effects.js" 33 tal:attributes="src string:${base_url}effects.js"></script> 34 <script type="text/javascript" src="controls.js" 35 tal:attributes="src string:${base_url}controls.js"></script> 36 <script type="text/javascript" src="cpsdocument.js" 37 tal:attributes="src string:${base_url}cpsdocument.js"></script> 38 <tal:block condition="python:modules['Products.CPSUtil.integration'].isProductPresent('Products.FCKeditor')"> 39 <script type="text/javascript"> 40 var popup_editor_form = 'popup_fckeditor_form'; 41 var width = 640; 42 var height = 520; 43 </script> 44 </tal:block> 45 <tal:block condition="python:modules['Products.CPSUtil.integration'].isProductPresent('Products.Epoz')"> 46 <script type="text/javascript"> 47 var popup_editor_form = 'popup_rte_form'; 48 var width = 640; 49 var height = 480; 50 </script> 51 </tal:block> 52 <script type="text/javascript"> 53 function popup_rte(input_id, label_edit) { 54 var args, value; 55 value = document.getElementById(input_id).value; 56 args = '?input_id='+input_id+'&label_edit='+escape(label_edit); 57 str_window_features = 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,dependent=1,width=' + width + ',height=' + height; 58 popup = window.open(popup_editor_form + args, input_id, str_window_features); 59 if (!popup.opener) { 60 popup.opener = window; 61 } 62 return false; 63 } 64 </script> 65 </metal:block> 66 </metal:block> 15 67 16 <metal:block fill-slot="header"> 17 <h3> 18 Edit your Clearance Data! 19 </h3> 20 </metal:block> 68 <h1> Edit your clearance Data</h1> 21 69 22 70 <metal:block fill-slot="main"> … … 28 76 <tal:block define="getFormUidHtml nocall:modules/Products.CPSDocument.utils/getFormUidHtml" 29 77 replace="structure python:getFormUidHtml(request)"/> 30 31 78 <input type="hidden" id="button_placeholder" name="button_placeholder" value="" /> 32 79 <div id="rendered_main" tal:content="structure rendered_main"> … … 34 81 </div> 35 82 </div> 36 37 83 <metal:block use-macro="here/cpsdocument_edit_buttons/macros/buttons"/> 38 84 </div> 39 85 </form> 86 <div id="ajax_psm" style="display:none"> 87 ajax feedback 88 </div> 40 89 </metal:block> 41 90 -
WAeUP_SRP/trunk/skins/waeup_student/clearance_pin_form.pt
r766 r788 20 20 <ul> 21 21 <li>Buy a Clearance Scratch Card.</li> 22 <li>Enter your JAMB registration number and the Clearance PIN above.</li>23 <li>Upload your passport picture.</li>24 22 <li>Apply</li> 25 23 </ul> -
WAeUP_SRP/trunk/skins/waeup_student/defer_view.pt
r785 r788 30 30 <table tal:define="sc python: info['course_doc']"> 31 31 <tr> 32 <td tal:content="sc/title" /> <td>ID: <span tal:content="sc/study_course" /></td> 33 </tr> 34 <tr> 32 35 <td tal:content="sc/title" /> <td tal:content="sc/study_course" /> 33 36 </tr> 34 37 </table> 35 <span tal:condition="python:0" tal:omit-tag=""36 tal:content="structure python: info['course_doc'].render(proxy=info['course_doc'],37 layout_mode='view_student_course',38 layout_id='student_study_course')"39 />40 38 41 39 <form action="." method="post" class="group" … … 51 49 (cpsmcat('confirm that you defer'), )" 52 50 /> 53 <input type="submit" name=" request_clearance:method"54 class="context" value=" request Clearance"51 <input type="submit" name="application_edit:method" 52 class="context" value="upload Passport" 55 53 /> 56 54 </td> -
WAeUP_SRP/trunk/skins/waeup_student/layout_application_edit.pt
r710 r788 6 6 ds options/datastructure; 7 7 dm ds/getDataModel; 8 formaction options/formaction|string: student_edit;8 formaction options/formaction|string:application_edit; 9 9 creation creation|nothing; 10 10 metadata metadata|nothing; … … 12 12 ti python:type_name and getattr(here.portal_types,type_name,None) or getattr(here.portal_types,here.portal_type,None); 13 13 cpsmcat nocall:here/translation_service; 14 apply request/apply_button|nothing;14 proceed options/proceed|nothing; 15 15 widgets python:context.getRenderedWidgets(layout); 16 16 "> … … 121 121 id="cpsdocument_edit_button" 122 122 tal:condition="not:creation" /> 123 <input type="submit" class="standalone" name=" apply_admission"123 <input type="submit" class="standalone" name="proceed" 124 124 value="apply for admission" 125 125 id="cpsdocument_edit_and_view_button" 126 tal:condition=" apply"127 tal:attributes="value apply"/>126 tal:condition="proceed" 127 tal:attributes="value proceed"/> 128 128 <input type="submit" 129 129 class="standalone" -
WAeUP_SRP/trunk/skins/waeup_student/student_index.py
r785 r788 33 33 return redirect("%s/application_view" % student.absolute_url()) 34 34 elif state in ('application_pin_entered',): 35 return redirect("%s/application_edit" % student.absolute_url())35 return redirect("%s/application_edit" % info['app'].absolute_url()) 36 36 elif state in ('admitted',): 37 37 return redirect("%s/defer_view" % student.absolute_url())
Note: See TracChangeset for help on using the changeset viewer.