Changeset 179 for waeup_product/trunk/skins/waeup_student
- Timestamp:
- 16 Nov 2005, 16:44:13 (19 years ago)
- Location:
- waeup_product/trunk/skins/waeup_student
- Files:
-
- 4 edited
- 3 copied
Legend:
- Unmodified
- Added
- Removed
-
waeup_product/trunk/skins/waeup_student/eligibility.py
r176 r179 1 ##parameters=REQUEST 1 ##parameters=REQUEST=None 2 2 # $Id$ 3 3 """ … … 5 5 return html renderer + psm 6 6 """ 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") 7 request = REQUEST 8 rget = request.get 9 rset = request.set 10 fget = request.form.get 11 fhas = request.form.has_key 13 12 14 13 … … 16 15 pr = context.portal_registration 17 16 pm = context.portal_membership 17 eli = context.ELIGIBILITY.getContent() 18 sr = eli.schoolresults 18 19 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', 20 res,psm,ds = lt.renderLayout(layout_id= 'student_schoolresults', 25 21 schema_id= 'student_eligibility', 26 22 context=context, 27 mapping= validate and REQUEST,23 mapping=request, 28 24 ob={}, 29 25 layout_mode='create', 26 formaction = "eligibility", 27 schoolresults = sr, 30 28 ) 31 res = jamb_rendered + res 32 if psm == 'invalid': 33 return context.eligibility_form(rendered = res, 29 30 inr = 0 31 if 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" 34 elif 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 39 elif 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 48 else: 49 psm = '' 50 eli.edit(mapping={'schoolresults': sr}) 51 res,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 61 return context.eligibility_form(rendered = res, 34 62 #psm = str(ds), 35 psm = "Please correct your input", 36 ds = ds, 63 psm = psm, 37 64 ) 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, 53 68 ## ds = ds, 54 69 ## ) 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 1 1 <tal:block define="rendered_main options/rendered; 2 2 portal_status_message options/psm; 3 data_storage options/ds;4 3 jamb options/jamb/getContent|nothing; 5 4 edition python:1;" … … 14 13 </metal:block> 15 14 <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> 17 16 <div tal:replace="structure rendered_main" /> 18 17 </metal:block> -
waeup_product/trunk/skins/waeup_student/layout_results_create.pt
r175 r179 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;12 formaction options/formaction; 13 13 first_layout options/first_layout|python:0; 14 14 last_layout options/last_layout|python:0; 15 15 is_flexible options/is_flexible; 16 16 cpsmcat nocall:here/translation_service; 17 results options/schoolresults; 17 18 " 18 19 > 19 <form action='eligibility' method='post' 20 <form action='eligibility' method='post' tal:attributes="action formaction" 20 21 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 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 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 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> 81 115 </form> 82 116 </metal:block> -
waeup_product/trunk/skins/waeup_student/personal_addon.py
r176 r179 22 22 schema_id = 'jamb') 23 23 24 res,psm,ds = lt.renderLayout(layout_id= 'student_ eligibility',25 schema_id= 'student_ eligibility',24 res,psm,ds = lt.renderLayout(layout_id= 'student_personal_addon', 25 schema_id= 'student_personal', 26 26 context=context, 27 27 mapping=validate and REQUEST, … … 31 31 res = jamb_rendered + res 32 32 if psm == 'invalid': 33 return context. eligibility_form(rendered = res,33 return context.personal_addon_form(rendered = res, 34 34 #psm = str(ds), 35 35 psm = "Please correct your input", … … 37 37 ) 38 38 elif psm == '': 39 return context. eligibility_form(rendered = res,39 return context.personal_addon_form(rendered = res, 40 40 psm = None, 41 41 ds = ds, … … 46 46 #pw = REQUEST.get("widget__pw") 47 47 #pm.setPassword(pw) 48 psm = 'Email has been successfully set. '49 return context.REQUEST.RESPONSE.redirect('%s' % context.portal_url.getUrlFromRpath('/students'))48 psm = 'Email has been successfully set. ' 49 ##return context.REQUEST.RESPONSE.redirect('%s' % context.portal_url.getUrlFromRpath('/students')) 50 50 51 ##return context.eligibility_form(rendered = res, 52 ## psm = psm, 53 ## ds = ds, 54 ## ) 51 return context.eligibility() -
waeup_product/trunk/skins/waeup_student/personal_addon_form.pt
r175 r179 14 14 </metal:block> 15 15 <metal:block fill-slot="main"> 16 <h1> Fill in your Email and give a new Password</h1>16 <h1> Fillin Your Email</h1> 17 17 <div tal:replace="structure rendered_main" /> 18 18 </metal:block> -
waeup_product/trunk/skins/waeup_student/process_waeup_login.py
r166 r179 32 32 pkw['aggregate'] = getattr(jc,'aggregate') 33 33 pkw['faculty'] = getattr(jc,'faculty') 34 pkw['course'] = getattr(jc,'course') 34 35 pkw['age'] = getattr(jc,'age') 36 pkw['jamb_results'] = getattr(jc,'exam_results') 37 pkw['jamb_aggregate'] = getattr(jc,'aggregate') 38 pkw['jamb_listing_date'] = getattr(jc,'listing_date') 35 39 pkw['state'] = getattr(jc,'state') 36 40 … … 43 47 context.notifyCPSDocumentCreation(ob=pd) 44 48 45 return response.redirect("%s/eligibility" % ma.absolute_url()) 46 return ma.eligibility(REQUEST=context.REQUEST) 49 pdid = 'ELIGIBILITY' 50 ma.invokeFactory('StudentEligibility', pdid) 51 pd = getattr(ma,pdid) 52 pd.getContent().edit(mapping=pkw) 53 context.notifyCPSDocumentCreation(ob=pd) 47 54 55 return 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 28 28 create = 1, 29 29 type_name = type_name, 30 psm = str(ds), 31 #psm = 'Please correct your errors', 30 psm = 'Please correct your errors', 32 31 ) 33 32 elif psm == '': … … 36 35 type_name = type_name, 37 36 psm = psm, 38 #psm = str(ds),39 37 ) 40 38
Note: See TracChangeset for help on using the changeset viewer.