Ignore:
Timestamp:
6 Oct 2007, 16:50:28 (17 years ago)
Author:
joachim
Message:

apply_admission improvements

Location:
WAeUP_SRP/base/skins/waeup_student
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/base/skins/waeup_student/apply_admission.py

    r2322 r2323  
    5151#application_type = ""
    5252without_reg_no = False
    53 if traverse_subpath and traverse_subpath[0] == "prence":
    54     layout = "application_prence"
    55     application_type = "prence"
    56     without_reg_no = True
    57 elif traverse_subpath and traverse_subpath[0] == "pume":
    58     layout = "application_pume"
    59     application_type = "pume"
    60 elif traverse_subpath and traverse_subpath[0] == "pce":
    61     layout = "application_pce"
    62     application_type = "pce"
    63 elif traverse_subpath and traverse_subpath[0] == "pde":
    64     layout = "application_pde"
    65     application_type = "pde"
    66 elif traverse_subpath and traverse_subpath[0] == "cest":
    67     layout = "application_cest"
    68     application_type = "cest"
     53
     54# if traverse_subpath and traverse_subpath[0] == "prence":
     55#     layout = "application_prence"
     56#     application_type = "prence"
     57#     without_reg_no = True
     58# elif traverse_subpath and traverse_subpath[0] == "pume":
     59#     layout = "application_pume"
     60#     application_type = "pume"
     61# elif traverse_subpath and traverse_subpath[0] == "pce":
     62#     layout = "application_pce"
     63#     application_type = "pce"
     64# elif traverse_subpath and traverse_subpath[0] == "pde":
     65#     layout = "application_pde"
     66#     application_type = "pde"
     67# elif traverse_subpath and traverse_subpath[0] == "cest":
     68#     layout = "application_cest"
     69#     application_type = "cest"
     70# else:
     71#     return request.RESPONSE.redirect("%s/srp_anonymous_view" % context.portal_url())
     72application_types = ('prence','pume','pce','pde','cest')
     73headings = {}
     74headings['pume'] = 'Apply for Post UME Screening Test (2007/2008)! '
     75headings['pde'] = 'Apply for Post DE Screening Test(2007/2008)! '
     76headings['prence'] = 'Apply for Pre-NCE Programme (2007/2008)! '
     77headings['pce'] = 'Apply for PCE Screening (2007/2008)! '
     78headings['cest'] = 'Apply for Common Entrance Screening Test (2007/2008)! '
     79info = {}
     80if traverse_subpath and traverse_subpath[0] in application_types:
     81    application_type = info['application_type'] = traverse_subpath[0]
     82    info['heading'] = headings[application_type]
     83    layout = "application_%s" % application_type
     84    without_reg_no = application_type in ('prence',)
     85   
    6986else:
    7087    return request.RESPONSE.redirect("%s/srp_anonymous_view" % context.portal_url())
    71 
    72 
    7388lt = context.portal_layouts
    7489
    7590pin = request.form.get('pin','')
    76 
    77 
    7891reg_no = request.get('widget__reg_no','').upper()
    7992if not reg_no:
     
    97110            return request.RESPONSE.redirect("%s/srp_anonymous_view" % context.portal_url())
    98111
    99 
    100112        # For the next application session it should be reverted to
    101113        # (see comment 09/06/07 16:40:52 in ticket #328):
     
    117129                             commit = False,
    118130                            )
    119                            
    120                        
    121 
    122131if slip:
    123132    return context.apply_admission_slip(rendered = res,
    124                                    psm = "",
    125                                    #psm = "%s, %s" % (psm,ds),
    126                                    mode = mode,
    127                                    ds = ds,
    128                                    application_type = application_type,
    129                                   )
    130 
     133                                        psm = "",
     134                                        mode = mode,
     135                                        ds = ds,
     136                                        info = info,
     137                                       )
    131138if psm == 'invalid':
    132139    return context.apply_admission_form(rendered = res,
    133                                    psm = "Please correct your input!",
    134                                    #psm = "%s, %s" % (psm,ds),
    135                                    mode = mode,
    136                                    ds = ds,
    137                                    application_type = application_type,
    138                                   )
     140                                        psm = "Please correct your input!",
     141                                        mode = mode,
     142                                        ds = ds,
     143                                        info = info,
     144                                       )
    139145elif psm == '' and not manage:
    140146    return context.apply_admission_form(rendered = res,
    141                                    psm = psm,
    142                                    ds = ds,
    143                                    mode = mode,
    144                                    application_type = application_type,
    145                                   )
    146 elif psm == 'valid' or (psm == '' and manage):
    147     pass
     147                                        psm = psm,
     148                                        ds = ds,
     149                                        mode = mode,
     150                                        info = info,
     151                                       )
     152# elif psm == 'valid' or (psm == '' and manage):
     153#     pass
    148154if without_reg_no:
    149155    reg_no = ds.get('reg_no')
    150    
    151  
    152156data = {}
    153157dm = ds.getDataModel()
     
    157161data['reg_no'] = reg_no
    158162data['screening_type'] = application_type
    159 
    160 
    161 
    162163if apply_admission:
    163164    if submitted:
     
    263264
    264265return context.apply_admission_form(rendered = res,
    265                                psm = psm,
    266                                #psm = "%s, %s" % (psm,ds),
    267                                mode = mode,
    268                                show_submit = passport_uploaded,
    269                                ds = ds,
    270                                application_type = application_type,
     266                                    psm = psm,
     267                                    mode = mode,
     268                                    show_submit = passport_uploaded,
     269                                    ds = ds,
     270                                    info = info,
    271271                              )
    272 
    273 
  • WAeUP_SRP/base/skins/waeup_student/apply_admission_form.pt

    r2322 r2323  
    22           portal_status_message options/psm;
    33           ds options/ds;
    4            application_type options/application_type;
    54           mode options/mode;
    65           expired python:False;
    76           show_submit options/show_submit|nothing;
     7           info options/info;
    88           "
    99           >
     
    1212      <metal:block fill-slot="main">
    1313        <span tal:condition="python:not mode=='view' and not expired">
    14           <h3 tal:condition="python:application_type=='pume'">Apply for Post UME Screening Test (2007/2008)! </h3>
    15           <h3 tal:condition="python:application_type=='pde'">Apply for Post DE Screening Test(2007/2008)! </h3>
    16           <h3 tal:condition="python:application_type=='prence'">Apply for Pre-NCE Programme (2007/2008)! </h3>
    17           <h3 tal:condition="python:application_type=='pce'">Apply for PCE Screening (2007/2008)! </h3>
    18           <h3 tal:condition="python:application_type=='cest'">Apply for Common Entrance Screening Test (2007/2008)! </h3>
     14          <h3 tal:content="info/heading" />
    1915        </span>
    2016        <span tal:condition="expired">
     
    2622        <form action="" id="editForm" method="post"
    2723              enctype="multipart/form-data" class="workflow"
    28               tal:attributes="action string:${context/absolute_url}/apply_admission/${application_type}"
     24              tal:attributes="action string:${context/absolute_url}/apply_admission/${info/application_type}"
    2925              >
     26          <input type="hidden" name="application_type"
     27                 tal:attributes="value info/application_type|nothing"
     28                 tal:condition="info/application_type|nothing"/>
    3029          <input type="hidden" name="reg_no"
    3130                 tal:attributes="value ds/reg_no|nothing"
     
    6665            <p>Instructions :</p>
    6766            <ul>
    68               <li>Enter your <span tal:condition="python:not application_type=='prence'">JAMB Registration Number and the</span> Application PIN.</li>
     67              <li>Enter your <span tal:condition="python:not info['application_type']=='prence'">JAMB Registration Number and the</span> Application PIN.</li>
    6968              <li>Fill the form and upload your Passport Photograph with red background in jpg format.</li>
    7069              <li>Save and preview picture.
Note: See TracChangeset for help on using the changeset viewer.