Changeset 6324


Ignore:
Timestamp:
10 Jun 2011, 08:26:06 (13 years ago)
Author:
Henrik Bettermann
Message:

Provide application state as a (property) method of Applicant. This allows displaying the state of Applicant objects on ApplicantsContainer? form pages.

Location:
main/waeup.sirp/trunk/src/waeup/sirp/applicants
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/applicants.py

    r6322 r6324  
    5050        #Initialize workflow state...
    5151        IWorkflowInfo(self).fireTransition('init')
     52
     53    @property
     54    def getApplicationState(self):
     55        state = IWorkflowState(self).getState()
     56        return state
    5257
    5358# Set all attributes of Applicant required in IApplicant as field
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/browser.py

    r6322 r6324  
    470470        return 'not yet admitted'
    471471
    472     @property
    473     def getApplicationState(self):
    474         state = IWorkflowState(self.context).getState()
    475         return state
     472    #@property
     473    #def getApplicationState(self):
     474    #    state = IWorkflowState(self.context).getState()
     475    #    return state
    476476
    477477class ApplicantsManageActionButton(ManageActionButton):
     
    522522        return transitions
    523523
    524     @property
    525     def getApplicationState(self):
    526         state = IWorkflowState(self.context).getState()
    527         return state
     524    #@property
     525    #def getApplicationState(self):
     526    #    state = IWorkflowState(self.context).getState()
     527    #    return state
    528528
    529529    @grok.action('Save')
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/browser_templates/applicantscontainermanagepage.pt

    r6206 r6324  
    8282        </thead>
    8383        <tbody>
    84           <tr tal:repeat="appl context/values"> <td>
    85               <input type="checkbox" name="val_id" tal:attributes="value appl/__name__" /> </td> <td>
     84          <tr tal:repeat="appl context/values">
     85            <td>
     86              <input type="checkbox" name="val_id" tal:attributes="value appl/__name__" />
     87            </td>
     88            <td>
    8689              <a tal:attributes="href python: view.url(appl)"
    87                  tal:content="appl/__name__"> ID </a> </td> <td>
    88               <span tal:condition="not: appl/locked">in progress
    89               </span>
    90               <span tal:condition="appl/locked">submitted
    91               </span> </td>
     90                 tal:content="appl/__name__"> ID </a>
     91            </td>
     92            <td>
     93              <span tal:replace="appl/getApplicationState">state</span>
     94            </td>
    9295          </tr>
    9396        </tbody>
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/browser_templates/form_display.pt

    r6323 r6324  
    33    tal:content="view/label">Label</h2>
    44
    5 <h2> ... <span tal:replace="view/getApplicationState">Application State</span> ... </h2>
     5<h2> ... <span tal:replace="context/getApplicationState">Application State</span> ... </h2>
    66
    77<div class="workflow" tal:content="structure context/msgs">Application Workflow</div>
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/browser_templates/form_edit.pt

    r6323 r6324  
    66    tal:content="view/label">Label</h2>
    77
    8   <h2> ... <span tal:replace="view/getApplicationState">Application State</span> ... </h2>
     8  <h2> ... <span tal:replace="context/getApplicationState">Application State</span> ... </h2>
    99
    1010  <div class="workflow" tal:content="structure context/msgs">Application Workflow</div>
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/interfaces.py

    r6323 r6324  
    389389        )
    390390
     391    def getApplicationState():
     392        """
     393        Returns the application state of an applicant.
     394        """
     395
    391396class IApplicant(IApplicantBaseData):
    392397    """An applicant.
Note: See TracChangeset for help on using the changeset viewer.