Changeset 7686 for main/waeup.sirp/trunk


Ignore:
Timestamp:
23 Feb 2012, 09:34:11 (13 years ago)
Author:
Henrik Bettermann
Message:

Enable translation of application_state.

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

Legend:

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

    r7652 r7686  
    3535from waeup.sirp.utils.helpers import attrs_to_fields
    3636from waeup.sirp.applicants.interfaces import IApplicant, IApplicantEdit
     37from waeup.sirp.applicants.workflow import application_states_dict
    3738
    3839class Applicant(grok.Container):
     
    5455    @property
    5556    def state(self):
    56         state = IWorkflowState(self).getState()
    57         return state
     57        return IWorkflowState(self).getState()
     58
     59    @property
     60    def translated_state(self):
     61        return application_states_dict[self.state]
    5862
    5963    @property
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/browser_templates/applicantscontainermanagepage.pt

    r7669 r7686  
    8787            </td>
    8888            <td>
    89               <span tal:replace="appl/state">State
     89              <span tal:replace="appl/translated_state">State
    9090              </span>
    9191            </td>
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/workflow.py

    r7652 r7686  
    2323from waeup.sirp.applicants.interfaces import IApplicantBaseData
    2424from waeup.sirp.interfaces import IObjectHistory, ISIRPWorkflowInfo
     25from waeup.sirp.interfaces import MessageFactory as _
    2526from waeup.sirp.workflow import SIRPWorkflow, SIRPWorkflowInfo
    2627
     
    3233NOT_ADMITTED = 'not admitted'
    3334CREATED = 'created'
     35
     36application_states_dict = {
     37    INITIALIZED: _('initialized'),
     38    STARTED: _('started'),
     39    PAID: _('paid'),
     40    SUBMITTED: _('submitted'),
     41    ADMITTED: _('admitted'),
     42    NOT_ADMITTED: _('not admitted'),
     43    CREATED: _('created'),
     44    }
     45
    3446
    3547APPLICATION_TRANSITIONS = (
Note: See TracChangeset for help on using the changeset viewer.