Changeset 537 for WAeUP_SRP


Ignore:
Timestamp:
20 Sep 2006, 06:40:54 (18 years ago)
Author:
joachim
Message:

added WAeUPImage Widget

Location:
WAeUP_SRP/trunk
Files:
3 added
11 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/PatchCatalogToolXMLAdapter.py

    r502 r537  
    4343            not_found = True
    4444    if not_found:
    45         self._initProperties(node)
    46         self._initObjects(node)
    47         self._initIndexes(node)
    48         self._initColumns(node)
     45        #self._initProperties(node)
     46        #self._initObjects(node)
     47        #self._initIndexes(node)
     48        #self._initColumns(node)
    4949        self._refreshCatalog()
    5050
  • WAeUP_SRP/trunk/Widgets.py

    r535 r537  
    66##from Products.CPSSchemas.Widget import CPSWidgetType
    77from Products.CMFCore.utils import getToolByName
    8 from Products.CPSSchemas.BasicWidgets import CPSWidget, CPSStringWidget, CPSEmailWidget
     8from Products.CPSSchemas.BasicWidgets import CPSWidget, CPSStringWidget, CPSEmailWidget,CPSImageWidget
    99from Products.CPSSchemas.BasicWidgets import renderHtmlTag,CPSSelectWidget, CPSStringWidget
    1010from Products.CPSSchemas.ExtendedWidgets import CPSDateTimeWidget
     
    380380###)
    381381
     382class WAeUPImageWidget(CPSImageWidget):
     383    """Photo widget."""
     384    meta_type = 'WAeUP Image Widget'
     385
     386    def render(self, mode, datastructure, **kw):
     387        render_method = 'widget_waeup_image_render'
     388        meth = getattr(self, render_method, None)
     389        if meth is None:
     390            raise RuntimeError("Unknown Render Method %s for widget type %s"
     391                               % (render_method, self.getId()))
     392        img_info = self.getImageInfo(datastructure)
     393        return meth(mode=mode, datastructure=datastructure, **img_info)
     394
     395
     396
     397InitializeClass(WAeUPImageWidget)
     398
     399widgetRegistry.register(WAeUPImageWidget)
     400
     401
    382402###########
    383403
  • WAeUP_SRP/trunk/__init__.py

    r511 r537  
    1313import PatchCPSWorkflowWorkflowDefinition
    1414import PatchCatalogToolXMLAdapter
     15import PatchCPSSchemasAttributeStorageAdapter
    1516# Only for CPS 3.4.1. In 3.4.2 and later this should be fixed.
    1617import PatchCPSDefaultImportExport
  • WAeUP_SRP/trunk/profiles/default/layouts/student_application.xml

    r515 r537  
    22<object name="student_application" meta_type="CPS Layout">
    33 <property name="layout_create_method"></property>
    4  <property name="layout_edit_method"></property>
     4 <property name="layout_edit_method">layout_application_print</property>
    55 <property name="layout_view_method"></property>
    66 <property name="style_prefix">layout_waeup_</property>
     
    219219  <property name="hidden_readonly_layout_modes"/>
    220220 </widget>
    221  <widget name="passport" meta_type="Image Widget">
     221 <widget name="passport" meta_type="WAeUPImage Widget">
    222222  <property name="title">Passport Picture</property>
    223223  <property name="fields">
     
    324324  </row>
    325325  <row>
     326   <cell name="entry_mode" ncols="3"/>
     327  </row>
     328  <row>
    326329   <cell name="jamb_first_cos" ncols="3"/>
    327330  </row>
  • WAeUP_SRP/trunk/profiles/default/layouts/student_application_fe.xml

    r515 r537  
    160160  <property name="hidden_readonly_layout_modes"/>
    161161 </widget>
    162  <widget name="passport" meta_type="Image Widget">
     162 <widget name="passport" meta_type="WAeUPImage Widget">
    163163  <property name="title">Passport Picture</property>
    164164  <property name="fields">
  • WAeUP_SRP/trunk/profiles/default/workflows/waeup_student_subobject_wf/definition.xml

    r535 r537  
    3030  <exit-transition transition_id="close"/>
    3131  <permission-map name="Modify portal content"
    32                   acquired="True">
     32                  acquired="False">
     33   <permission-role>Owner</permission-role>
    3334   <permission-role>SectionManager</permission-role>
     35   <permission-role>Manager</permission-role>
    3436  </permission-map>
    3537  <permission-map name="WAeUPModify own content"
     
    3739   <permission-role>Owner</permission-role>
    3840  </permission-map>
    39   <permission-map name="View" acquired="True">
     41  <permission-map name="View" acquired="False">
     42   <permission-role>Owner</permission-role>
    4043  </permission-map>
    4144 </state>
  • WAeUP_SRP/trunk/skins/waeup_custom/logged_in.py

    r535 r537  
    8282if to_waeup_student_home:
    8383    member.setProperties(last_login_time=current,login_time=current)
     84    if info['review_state'] == "application_pin_entered":
     85        return response.redirect("%s/passport_entry_view" % student.absolute_url())
    8486    return response.redirect("%s" % student.absolute_url())
    8587   
  • WAeUP_SRP/trunk/skins/waeup_student/application_slip.pt

    r516 r537  
    1 <html metal:use-macro="here/content_lib_master/macros/master">
    2   <metal:block fill-slot="head_slot">
    3   </metal:block>
    4 
    5   <metal:block fill-slot="css_slot">
    6     <link rel="Stylesheet" type="text/css" href=""
    7       tal:attributes="href string:${base_url}document.css" />
    8   </metal:block>
    9  
    10   <metal:block fill-slot="header">
    11   </metal:block>
    12 
    13   <metal:block fill-slot="main">
    14 
    15     <tal:block tal:condition="python:context.portal_type == 'StudentApplication'" tal:omit-tag="">
    16     <h3>Post UME Acknowledegement Slip</h3>
    17         <br />
    18        
    19       <tal:block tal:define="application_data python:context.getContent();">
    20      
    21      
    22       <table cellpadding="10em" cellspacing="">
    23       <tr>
    24       <td valign="top">
    25         <img tal:condition="application_data/passport|nothing"
    26              tal:attributes="src string:${context/absolute_url}/passport"/>
    27               <span tal:condition="nothing" tal:replace="structure application_data/passport" />
    28       </td>
    29 
    30       <td>
    31      
    32       <table width="" cellpadding="2" cellspacing="0" summary="Form layout">
    33       <tr><td>Access Code: </td><td><span tal:content="application_data/app_ac_pin" /></td></tr>
    34       <tr><td>Application Date: </td><td><span tal:content="python:application_data.app_ac_date.aCommonZ()" /></td></tr>
    35       <tr><td>JAMB Registration Number: </td><td><span tal:content="application_data/jamb_reg_no" /></td></tr>
    36       <tr><td>Student's Name: </td><td><span tal:content="application_data/jamb_firstname" /> <span tal:content="application_data/jamb_middlename" /> <span tal:content="application_data/jamb_lastname" /></td></tr>
    37       <tr><td>Sex: </td><td><span tal:content="application_data/jamb_sex" /></td></tr>
    38       <tr><td>Mode of Entry: </td><td><span tal:content="application_data/entry_mode" /></td></tr>
    39       <tr><td>Course of Study: </td><td><span tal:content="application_data/jamb_first_cos" />, <span tal:content="application_data/jamb_second_cos" /></td></tr>
    40       <tr><td>State of Origin: </td><td><span tal:content="application_data/jamb_state" /> / <span tal:content="application_data/jamb_lga" /></td></tr>
    41       <tr><td>Post UME Examination Date: </td><td></td></tr>
    42       </table>
    43 
    44       </td>
    45       </tr>
    46       </table>
    47      
    48       </tal:block>
    49     </tal:block>
    50     <tal:block condition="python:context.portal_type != 'StudentApplication'">
    51       Please do not manipulate the URL! This is not an application object.
    52     </tal:block> 
    53  
    54   </metal:block>
    55 
    56   <metal:block fill-slot="sub">
    57   </metal:block>
    58 </html>
     1<metal:html tal:define="info context/getStudentInfo">
     2  <metal:body use-macro="here/main_template/macros/master">
     3    <metal:main fill-slot="main">
     4      <span tal:condition="not: info">
     5        <metal:block use-macro="here/error_not_found/macros/not_found" />
     6      </span>
     7      <span tal:condition="info"
     8            tal:define="review_state info/review_state">
     9        <span tal:omit-tag=""
     10              tal:content="structure python: info['app_doc'].render(proxy=info['app_doc'],
     11              layout_mode='view',
     12              layout_id='student_application')"
     13              />
     14      </span>
     15    </metal:main>
     16  </metal:body>
     17</metal:html>
  • WAeUP_SRP/trunk/skins/waeup_student/layout_application_edit.pt

    r535 r537  
    1313  cpsmcat nocall:here/translation_service;
    1414  apply request/apply_button|nothing;
     15  widgets python:context.getRenderedWidgets(layout);
    1516  ">
    16 
     17  <span tal:condition="python: 0" tal:replace="structure widgets" />
    1718  <form action="" id="editForm" method="post"
    1819        enctype="multipart/form-data" class="workflow"
     
    2021       
    2122        >
    22   <table width="" cellpadding="2" cellspacing="0" summary="Form layout"
     23  <table class="layoutDefault" summary="Form layout"
    2324         tal:condition="layout/rows">
    24     <tr tal:repeat="row layout/rows" valign="top" >
    25       <span tal:repeat="cell row"
    26           tal:attributes="colspan cell/ncols">
    27         <tal:block define="widget cell/widget;
     25    <span tal:repeat="row python: layout['rows']" valign="top" >
     26      <span tal:repeat="cell row">
     27        <tr tal:define="widget cell/widget;
    2828              wid widget/getWidgetId;
    2929              err python:ds.getError(wid);
     
    3333              widget_css_class cell/widget_css_class|nothing;
    3434              css_class python:test(err, 'row error','row')"
     35              tal:condition="python: wid != 'passport'"
    3536              >
    3637          <div tal:attributes="class widget_css_class;
     
    6768            </td>
    6869          </div>
    69         </tal:block>
    70        </span>
    71       </tr>
    72     </table>
     70        </tr>
     71      </span>
     72    </span>
     73    <tr tal:condition="widgets/passport|nothing" tal:define="cell widgets/passport|nothing;">
     74      <tal:block tal:define="widget cell/widget;
     75      wid widget/getWidgetId;
     76      err python:ds.getError(wid);
     77      err_mapping python:ds.getErrorMapping(wid);
     78      is_required python: widget.is_required and creation and ('create' not in widget.readonly_layout_modes);
     79      tooltip_id python:wid + '_help';
     80      widget_css_class widget/widget_css_class|nothing;
     81      css_class python:test(err, 'row error','row')"
     82      >
     83        <div tal:attributes="class widget_css_class;
     84        id python:widget.getHtmlWidgetId()+'_widget';"
     85        >
     86          <td>
     87            <div class="label" tal:condition="widget/label_edit"
     88                 tal:attributes="class python:test(is_required, 'label required','label')">
     89              <label tal:content="widget/label_edit"
     90                     tal:attributes="for cell/widget_input_area_id|nothing;">label</label>:
     91            </div>
     92            <button type="button" class="tooltipControl"
     93                    tal:condition="widget/help"
     94                    tal:attributes="onclick python:'toggleElementVisibility(\'%s\')' % tooltip_id;"> ? </button>
     95          </td>
     96          <td>
     97            <span class="field">
     98              <div tal:replace="structure cell/widget_rendered"/>
     99            </span>
     100            <div class="tooltipArea" style="visibility: hidden;"
     101                 tal:condition="widget/help"
     102                 tal:attributes="id tooltip_id;
     103                 onclick python:'showElement(false, \'%s\')' % tooltip_id;"
     104                 >
     105              <tal:block tal:content="widget/help">This is the help for this field
     106              </tal:block>
     107            </div>
     108            <tal:block condition="err">
     109              <tal:block define="msg python:cpsmcat(err, mapping=err_mapping)">
     110                <br /><em style="color: red"
     111                          tal:content="msg">err</em>
     112              </tal:block>
     113            </tal:block>
     114          </td>
     115        </div>
     116      </tal:block>
     117    </tr>
     118  </table>
    73119  <br />
    74120  <input type="submit" class="standalone" name="cpsdocument_edit_button"
    75          value="button_change"
     121         value="Save"
    76122         id="cpsdocument_edit_button"
    77123         tal:condition="not:creation" />
  • WAeUP_SRP/trunk/skins/waeup_student/layout_application_view.pt

    r536 r537  
    1313                                 'jamb_second_cos',)"
    1414                                 >
    15   <span tal:condition="nothing" tal:replace="structure widgets" />
    1615  <table cellpadding="2" cellspacing="2" summary="layout">
    1716    <tr tal:repeat="field fields">
    1817      <tal:block tal:define="cell python: widgets[field]">
    1918        <tal:block define="widget cell/widget">
    20           <div tal:attributes="class cell/widget_css_class|nothing;
     19          <div tal:attributes="class cell/widget_css_class|string:label;
    2120            id python:widget.getHtmlWidgetId()+'_widget';">
    2221            <td >
     
    4039            <td valign="top">
    4140            <tal:block condition="widget/label">
    42               <span class="dlabel"
     41              <span class="label"
    4342                    tal:content="widget/label">label</span>:
    4443            </tal:block>
    4544            </td>
    4645            <td>
    47               <img src="img" tal:attributes="src string:${context/aq_parent/absolute_url}/passport" />
     46              <img src="img" tal:replace="structure cell/widget_rendered">
    4847            </td>
    4948          </div>
  • WAeUP_SRP/trunk/skins/waeup_student/student_edit.py

    r535 r537  
    9696        args = {}
    9797    else:
     98        info['app'].content_status_modify(workflow_action="close")
    9899        psm = 'psm_content_error'
    99100        args = getFormUidUrlArg(REQUEST)
Note: See TracChangeset for help on using the changeset viewer.