Changeset 166 for waeup_product/trunk/skins/waeup_student
- Timestamp:
- 12 Nov 2005, 14:45:08 (19 years ago)
- Location:
- waeup_product/trunk/skins/waeup_student
- Files:
-
- 2 deleted
- 5 edited
- 3 copied
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
waeup_product/trunk/skins/waeup_student/book_accommodation.py
r164 r166 4 4 book an accomodation 5 5 """ 6 import DateTime 7 current = DateTime.DateTime() 8 6 9 type_name = 'Student' 7 10 ti = context.portal_types[type_name] … … 16 19 17 20 res,psm,ds = lt.renderLayout(layout_id= 'accobook', 18 schema_id= 'student ',21 schema_id= 'student_accommodation', 19 22 context=context, 20 23 mapping=validate and REQUEST, 21 24 ob={}, 22 25 layout_mode='create', 23 create_action = 'book_accommodation', 26 submit = "book", 27 action = 'book_accommodation', 24 28 ) 25 29 if psm == 'invalid': … … 65 69 #psm = "Your not admitted" 66 70 psm = "h:%(heading)s free:%(nr_of_free)s %(beds_assigned)s" % dict 71 72 ds.set('sc_date',current) 73 sf.setScratchCardData('accommodation',ds) 74 67 75 return context.booked_accommodation(v=dict) -
waeup_product/trunk/skins/waeup_student/booked_accommodation.pt
r124 r166 8 8 > 9 9 You have successfully booked bed nr <span tal:content="acco/beds_assigned" /> in <span tal:content="acco/heading" />. 10 <br />Your next steps: 11 <ul> 12 <li>Buy a Hostel Scratch card</li> 13 <li>Login with your user_id and password </li> 14 <li>Klick on the pay Hostel Fee tab</li> 15 </ul> 10 16 </metal:block> 11 17 <metal:block fill-slot="sub"> -
waeup_product/trunk/skins/waeup_student/check_admission.py
r164 r166 5 5 return html renderer + psm 6 6 """ 7 import DateTime 8 current = DateTime.DateTime() 9 10 7 11 type_name = 'Jamb' 8 12 ti = context.portal_types[type_name] … … 22 26 ob={}, 23 27 layout_mode='create', 28 action = "check_admission", 29 submit = "check", 24 30 ) 25 31 if psm == 'invalid': … … 45 51 ds = ds, 46 52 ) 53 54 ds.set('sc_date',current) 47 55 student.getContent().setScratchCardData('adm_check',ds) 48 56 -
waeup_product/trunk/skins/waeup_student/clearence.py
r164 r166 5 5 return html renderer + psm 6 6 """ 7 import DateTime 8 current = DateTime.DateTime() 9 10 7 11 type_name = 'Jamb' 8 12 ti = context.portal_types[type_name] … … 22 26 ob={}, 23 27 layout_mode='create', 28 action = "clearence", 29 submit = "submit", 24 30 ) 31 25 32 if psm == 'invalid': 26 33 return context.clearence_form(rendered = res, … … 52 59 rset = REQUEST.set 53 60 student = getattr(context,s_id) 61 ds.set('sc_date',current) 54 62 student.getContent().setScratchCardData('clearence',ds) 55 63 sc_pin = ds.get('sc_pin') -
waeup_product/trunk/skins/waeup_student/layout_sc_create.pt
r160 r166 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/action; 13 submittext options/submit; 13 14 first_layout options/first_layout|python:0; 14 15 last_layout options/last_layout|python:0; … … 17 18 " 18 19 > 19 <form action='check_admission' method='post'20 <form action='check_admission' tal:attributes="action formaction" method='post' 20 21 enctype='multipart/form-data' class='workflow'> 21 22 <div class='group'> … … 76 77 </tr> 77 78 </table> 78 <input type="submit" class="standalone" name="cpsdocument_edit_button" value="check" /> 79 <input type="submit" class="standalone" name="cpsdocument_edit_button" 80 value="check" tal:attributes="value submittext"/> 79 81 </div> 80 82 </div> -
waeup_product/trunk/skins/waeup_student/pay_hostel_fee.py
r164 r166 4 4 book an accomodation 5 5 """ 6 import DateTime 7 current = DateTime.DateTime() 8 6 9 type_name = 'Student' 7 10 ti = context.portal_types[type_name] … … 15 18 pr = context.portal_registration 16 19 17 res,psm,ds = lt.renderLayout(layout_id= 'acco book',18 schema_id= 'student ',20 res,psm,ds = lt.renderLayout(layout_id= 'accopay', 21 schema_id= 'student_hostel_fee', 19 22 context=context, 20 23 mapping=validate and REQUEST, 21 24 ob={}, 22 25 layout_mode='create', 23 create_action = 'book_accommodation', 26 submit = "pay", 27 action = 'pay_hostel_fee', 24 28 ) 25 29 if psm == 'invalid': … … 35 39 elif psm == 'valid': 36 40 sf = context.getContent() 37 halls = getattr(context,'accommodation').contentValues() 38 beds = [] 39 student = context.PERSONAL.getContent() 40 sf = context.getContent() 41 for hall in halls: 42 h = hall.getContent() 43 ba = int(getattr(h,'beds_assigned',0)) 44 bal = getattr(h,'beds_assigned_list',[]) 45 nr_of_beds = int(h.nr_of_blocks) * int(h.nr_of_floors) * int(h.rooms_per_floor) * int(h.beds_per_room) 46 if h.which_sex == student.sex and nr_of_beds > len(bal): 47 break 48 dict = {'heading': h.heading, 49 'text': h.text, 50 'which_sex': h.which_sex, 51 'nr_of_blocks': h.nr_of_blocks, 52 'nr_of_floors': h.nr_of_floors, 53 'rooms_per_floor': h.rooms_per_floor, 54 'beds_per_room': h.beds_per_room, 55 'nr_of_free': nr_of_beds, 56 'beds_assigned': ba, 57 } 58 ba += 1 59 dict['beds_assigned'] = ba 60 bal.append(('%s:%d' % (pm.getAuthenticatedMember(),ba))) 61 dict['beds_assigned_list'] = bal 62 h.edit(mapping = dict) 63 ds.set('accommodation', "Bed # %(beds_assigned)s in %(heading)s" % dict) 64 sf.edit(mapping = ds) 65 #psm = "Your not admitted" 66 psm = "h:%(heading)s free:%(nr_of_free)s %(beds_assigned)s" % dict 67 return context.booked_accommodation(v=dict) 41 42 ds.set('sc_date',current) 43 sf.setScratchCardData('hostel_fee',ds) 44 45 return context.payed_hostel_fee(dict=ds) -
waeup_product/trunk/skins/waeup_student/payed_hostel_fee.pt
r160 r166 5 5 </metal:block> 6 6 <metal:block fill-slot="main" 7 tal:define="acco options/v" 7 tal:define="student context/getContent; 8 dict options/dict" 8 9 > 9 You have successfully booked bed nr <span tal:content="acco/beds_assigned" /> in <span tal:content="acco/heading" />. 10 You payed <span tal:content="student/accommodation" /><br /> 11 with Scratchcard PIN <span tal:content="dict/sc_pin" /> <br /> 12 on <span tal:content="dict/sc_date"/>. 13 10 14 </metal:block> 11 15 <metal:block fill-slot="sub"> -
waeup_product/trunk/skins/waeup_student/process_waeup_login.py
r164 r166 38 38 context.notifyCPSDocumentCreation(ob=pd) 39 39 40 pdid = 'DOCUMENTS' 41 ma.invokeFactory('StudentDocuments', pdid) 42 pd = getattr(ma,pdid) 43 context.notifyCPSDocumentCreation(ob=pd) 44 40 45 return response.redirect("%s/eligibility" % ma.absolute_url()) 41 46 return ma.eligibility(REQUEST=context.REQUEST)
Note: See TracChangeset for help on using the changeset viewer.