Changeset 535 for WAeUP_SRP/trunk/skins


Ignore:
Timestamp:
19 Sep 2006, 07:53:21 (18 years ago)
Author:
joachim
Message:

student apply admission should work now
the default_view for campus is now home_index.py
for students and student student_index.py
these script redirect to the appropriate PT

Location:
WAeUP_SRP/trunk/skins
Files:
12 added
1 deleted
8 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/skins/waeup_custom/logged_in.py

    r524 r535  
    1313$Id: logged_in.py 34693 2006-03-23 17:44:22Z ogrisel $
    1414"""
     15import DateTime
     16current = DateTime.DateTime()
    1517
    1618from urllib import unquote
     
    2628    return to_member_home, to_workspaces
    2729
     30request = context.REQUEST
     31response = request.RESPONSE
    2832utool = context.portal_url
    2933mtool = context.portal_membership
     
    4347    if not is_anon:
    4448        if "Student" in member.getRoles():
    45             member_id = str(member)
    46             student = getattr(context.campus.students,member_id,)
    47             if context.portal_workflow.getInfoFor(student,
    48                                                'review_state',
    49                                                None) == "created":
     49            to_waeup_student_home = True
     50            info = context.getStudentInfo()
     51            student = info['student']
     52##            member_id = str(member)
     53##            student = getattr(context.campus.students,member_id,)
     54##            if context.portal_workflow.getInfoFor(student,
     55##                                               'review_state',
     56##                                               None) == "created":
     57            if info['review_state'] == "created":
    5058                student.content_status_modify(workflow_action="enter_application_pin")
    5159                da = {}
     
    5361                da['app_ac_pin'] = pin
    5462                da['app_ac_date'] = current
    55                 application.getContent().edit(mapping = da)
    56                 to_waeup_student_home = True
     63                info['app_doc'].edit(mapping = da)
    5764        elif "Manager" in member.getRoles():
    5865            pass
  • WAeUP_SRP/trunk/skins/waeup_custom/standard_error_message.pt

    r531 r535  
    1515<tal:haserror condition="error_type">
    1616  <tal:NotFound condition="python:error_type == 'NotFound'">
    17     <metal:block use-macro="here/not_found/macros/not_found" />
     17    <metal:block use-macro="here/error_not_found/macros/not_found" />
    1818  </tal:NotFound>
    1919
    20   <tal:default condition="python:0 and error_type != 'NotFound'">
    21     <metal:block use-macro="here/error_lib_other/macros/other" />
     20  <tal:default condition="python:error_type != 'NotFound'">
     21    <metal:block use-macro="here/error_other/macros/other" />
    2222  </tal:default>
    2323
    24   <tal:debugging condition="python:0 and checkPerm('Manage portal', here)">
     24  <tal:debugging condition="python:checkPerm('Manage portal', here)">
    2525    <table width="100%" cellpadding="2" cellspacing="2">
    2626      <tr>
  • WAeUP_SRP/trunk/skins/waeup_default/portlet_session_info.pt

    r486 r535  
    44           roles member/getRoles;
    55           backend python:'Manager' in roles or 'SectionManager' in roles;
    6            frontend python:'Student' in roles or isAnon;"
     6           frontend python:'Student' in roles or isAnon;
     7           info context/getStudentInfo;"
    78           >
    89  <tal:block condition="not:isAnon">
    9        <strong> <span tal:content="python:member.getProperty('fullname',None)" />
     10       <strong> <span tal:condition="info" tal:content="python:info['per_doc'].lastname" />
     11       <span tal:condition="not: info" tal:content="python:member.getProperty('fullname',None)" />
    1012       </strong>
    1113  </tal:block>
  • WAeUP_SRP/trunk/skins/waeup_student/home_student.pt

    r530 r535  
    1 <metal:html tal:define="info context/get_student_info">
     1<metal:html tal:define="info context/getStudentInfo">
    22
    3 <metal:body use-macro="here/main_template/macros/master">
     3  <metal:body use-macro="here/main_template/macros/master">
    44
    5 <metal:main fill-slot="main">
    6 <span tal:condition="isAnon">
    7   <h2>Welcome to the     
    8    
    9   <br />Student Registration Portal of the University of Benin, Nigeria</h2>
    10  
    11   <br />
    12  
    13   <p>This is the frontpage of Uniben's Student Registration Portal (SRP) which is part of the West African e-University Project.
    14   For further information see
    15   <a href="" tal:attributes="href string:http://waeup.org">waeup.org</a>.</p>
    16  
    17   <p><strong>Fresh Students</strong>, who register for the first time, proceed to the respective application
    18   entrance page (UME, DE or Local Programmes). Later they can login to check their admission status and to
    19   proceed with the admission and clearance process.</p>
    20  
    21   <p><strong>Returning Students</strong> can login to check the course results of the previous session,
    22   to register courses for the current session, to pay their school fees and to book accommodation.</p>
    23  
    24   <p>This site is best seen in Firefox browser.</p>
    25 </span>
    26 <span tal:condition="python:not isAnon and info">
    27     <h3 tal:content="info/review_state|nothing"></h3>
    28    <span tal:omit-tag="" tal:condition="python:info['review_state'] == 'admission_applied'"
    29           tal:content="structure python: info['app_doc'].render(proxy=info['app_doc'],
    30                                                                layout_mode='view',
    31                                                                layout_id='student_application_fe')" />
    32      
    33 
    34 </span> 
    35 </metal:main>
    36 </metal:body>
     5    <metal:main fill-slot="main">
     6      <span tal:condition="isAnon">
     7        <h2>Welcome to the     
     8          <br />Student Registration Portal of the University of Benin, Nigeria</h2>
     9        <br />
     10        <p>This is the frontpage of Uniben's Student Registration Portal (SRP) which is part of the West African e-University Project.
     11          For further information see
     12          <a href="" tal:attributes="href string:http://waeup.org">waeup.org</a>.</p>
     13        <p><strong>Fresh Students</strong>, who register for the first time, proceed to the respective application
     14          entrance page (UME, DE or Local Programmes). Later they can login to check their admission status and to
     15        proceed with the admission and clearance process.</p>
     16        <p><strong>Returning Students</strong> can login to check the course results of the previous session,
     17        to register courses for the current session, to pay their school fees and to book accommodation.</p>
     18        <p>This site is best seen in Firefox browser.</p>
     19      </span>
     20      <span tal:condition="python:not isAnon and info"
     21            tal:define="review_state info/review_state">
     22        <h3 tal:content="info/review_state|nothing"></h3>
     23        <span tal:omit-tag="" tal:condition="python:review_state == 'admission_applied'"
     24              tal:content="structure python: info['app_doc'].render(proxy=info['app_doc'],
     25              layout_mode='view',
     26              layout_id='student_application_fe')"
     27              />
     28        <span tal:omit-tag="" tal:condition="python: review_state == 'application_pin_entered'"
     29              tal:content="structure python: info['app_doc'].render(proxy=info['app_doc'],
     30              layout_mode='edit',
     31              layout_id='student_application_fe')"
     32              />
     33      </span> 
     34      <span tal:condition="python:not isAnon and not info">
     35        <table tal:define="students python: context.objectValues()">
     36          <tr tal:repeat="student students">
     37            <span tal:omit-tag="" tal:define="info python: context.getStudentInfo(student)">
     38            <td><span tal:replace="python: info['per_doc'].lastname" /></td>   
     39            <td><span tal:replace="python: info['app_doc'].jamb_reg_no" /></td>   
     40            <td><span tal:replace="info/review_state" /></td>   
     41            </span>
     42          </tr>
     43        </table>
     44      </span>
     45    </metal:main>
     46  </metal:body>
    3747</metal:html>
  • WAeUP_SRP/trunk/skins/waeup_student/layout_application_edit.pt

    r502 r535  
    1212  ti python:type_name and getattr(here.portal_types,type_name,None) or getattr(here.portal_types,here.portal_type,None);
    1313  cpsmcat nocall:here/translation_service;
     14  apply request/apply_button|nothing;
    1415  ">
    1516
     
    7273  <br />
    7374  <input type="submit" class="standalone" name="cpsdocument_edit_button"
    74     value="button_change" i18n:attributes="value" id="cpsdocument_edit_button"
    75     tal:condition="not:creation" />
    76   <input type="submit" class="standalone" name="cpsdocument_edit_and_view_button"
    77     value="button_change_and_view" i18n:attributes="value"
    78     id="cpsdocument_edit_and_view_button"
    79     tal:condition="python:0 and not creation" />
     75         value="button_change"
     76         id="cpsdocument_edit_button"
     77         tal:condition="not:creation" />
     78  <input type="submit" class="standalone" name="apply_admission"
     79         value="apply for admission"
     80         id="cpsdocument_edit_and_view_button"
     81         tal:condition="apply"
     82         tal:attributes="value apply"/>
    8083  <input type="submit"
    8184         class="standalone"
     
    8790</form>
    8891</metal:block>
    89 
    90 
  • WAeUP_SRP/trunk/skins/waeup_student/layout_application_view.pt

    r524 r535  
    11<!-- a layout_lib macro -->
    22<!-- $Id: layout_lib_default_view.pt 34052 2006-03-06 14:59:24Z atchertchian $ -->
    3 
    43<metal:block define-macro="default_view"
    54  tal:define="layout options/layout;
    65              dm options/datastructure/getDataModel;
    76              widgets python:context.getRenderedWidgets(layout);
    8              ">
    9              <span tal:condition="nothing" tal:replace="structure widgets" />
    10 <table width="100%" cellpadding="2" cellspacing="2" summary="layout">
    11   <tr tal:repeat="row layout/rows">
    12     <td tal:repeat="cell row" tal:attributes="colspan cell/ncols">
    13       <tal:block define="widget cell/widget">
    14       <div tal:attributes="class cell/widget_css_class|nothing;
    15                            id python:widget.getHtmlWidgetId()+'_widget';
    16                           ">
    17         <tal:block condition="widget/label">
    18           <span class="dlabel" i18n:translate="" tal:condition="widget/is_i18n"
    19                 tal:content="widget/label">label</span>
    20           <span class="dlabel" tal:condition="not:widget/is_i18n"
    21                 tal:content="widget/label">label</span>
     7              fields python:('jamb_reg_no',
     8                                 'app_ac_pin',
     9                                 'app_ac_date',
     10                                 'jamb_lastname',
     11                                 'jamb_sex',
     12                                 'jamb_first_cos',
     13                                 'jamb_second_cos',)"
     14                                 >
     15  <span tal:condition="nothing" tal:replace="structure widgets" />
     16  <table width="100%" cellpadding="2" cellspacing="2" summary="layout">
     17    <tr tal:repeat="field fields">
     18      <td tal:define="cell python: widgets[field]">
     19        <tal:block define="widget cell/widget">
     20          <div tal:attributes="class cell/widget_css_class|nothing;
     21          id python:widget.getHtmlWidgetId()+'_widget';"
     22          >
     23            <tal:block condition="widget/label">
     24              <span class="dlabel"
     25                    tal:content="widget/label">label</span>
     26            </tal:block>
     27            <tal:block replace="structure cell/widget_rendered" />
     28          </div>
    2229        </tal:block>
    23         <tal:block replace="structure cell/widget_rendered" />
    24       </div>
    25       </tal:block>
    26     </td>
    27   </tr>
    28 </table>
     30      </td>
     31    </tr>
     32    <tr>
     33      <td tal:define="cell widgets/passport">
     34        <tal:block define="widget cell/widget">
     35          <div tal:attributes="class cell/widget_css_class|nothing;
     36          id python:widget.getHtmlWidgetId()+'_widget';"
     37          >
     38            <tal:block condition="widget/label">
     39              <span class="dlabel"
     40                    tal:content="widget/label">label</span>
     41            </tal:block>
     42            <img src="img" tal:attributes="src string:${context/aq_parent/absolute_url}/passport" />
     43          </div>
     44        </tal:block>
     45      </td>
     46    </tr>   
     47  </table>
    2948</metal:block>
  • WAeUP_SRP/trunk/skins/waeup_student/portlet_student_workflow_display.pt

    r522 r535  
    55                   roles member/getRoles;
    66                   item nocall:options/context_obj;
    7                    info item/get_student_info;"
     7                   info item/getStudentInfo;"
    88           condition="python:'Student' in roles
    99           ">
  • WAeUP_SRP/trunk/skins/waeup_student/student_edit.py

    r523 r535  
    3333# Validate the document and write it if it's valid
    3434# (We don't call getEditableContent here, validate does it when needed.)
    35 doc = context.getContent()
     35info = context.getStudentInfo()
    3636
    37 if context.portal_type == "StudentApplication":
    38     student = context.aq_parent
    39     state = context.portal_workflow.getInfoFor(student,'review_state',None)
     37student = info['student']
     38app = info['app']
     39app_doc = info['app_doc']
     40state = context.getStudentInfo()['review_state']
     41
     42if context.portal_type == "Student":
    4043    if state == "application_pin_entered":
    4144        student.content_status_modify(workflow_action="apply_for_admission")
    42     if doc.passport is None:
    43         is_valid, ds = doc.validate(request=REQUEST,
    44                                     proxy=context,
     45    if app_doc.passport is None:
     46        is_valid, ds = app_doc.validate(request=REQUEST,
     47                                    proxy=app_doc,
    4548                                    layout_id = "student_application_fe",
    4649                                    layout_mode = 'edit',
    4750                                    use_session=True)
    4851   
    49         action = '/application_form'
     52        action = "/student_edit"
    5053        if is_valid:
    51             comments = REQUEST.get('comments')
    52             context.cpsdocument_notify_modification(comments=comments)
    53             if cpsdocument_edit_and_view_button is not None:
    54                 action = ''
    5554            psm = 'You successfully uploaded your passport image.'
    5655            args = {}
    57             action = "/view"
    5856        else:
    5957            psm = 'psm_content_error'
    6058            args = getFormUidUrlArg(REQUEST)
     59    elif 'apply_admission' not in REQUEST.form:
     60        is_valid, ds = app_doc.validate(request=REQUEST,
     61                                    proxy=app_doc,
     62                                    layout_id = "student_application_fe",
     63                                    layout_mode = 'edit',
     64                                    use_session=True)
     65        action = "/passport_entry_view"
     66        if is_valid:
     67            args = {}
     68            if 'apply_admission' not in REQUEST.form:
     69                args = {'apply_button': 'Save and Apply',}
     70                psm = 'You successfully uploaded your passport image.'
     71            else:
     72                psm = 'You applied for admission.'
     73        else:
     74            args = getFormUidUrlArg(REQUEST)
     75            #psm = 'psm_content_error'
     76            psm = '%s' % ds
    6177    else:
    6278        args = {}
    63         psm = "You successfully applied for admission."
    64         action = "/view"
     79        psm = 'You applied for admission.'
     80        action = "/application_view"
    6581else:
    66     is_valid, ds = doc.validate(request=REQUEST, proxy=context, cluster=cluster,
     82    is_valid, ds = app_doc.validate(request=REQUEST, proxy=context, cluster=cluster,
    6783                                use_session=True)
    6884
    6985    if action is None:
    70         ti = doc.getTypeInfo()
     86        ti = app.getTypeInfo()
    7187        action = ti.queryMethodID('edit', 'cpsdocument_edit_form')
    7288        action = '/' + action
Note: See TracChangeset for help on using the changeset viewer.