Changeset 8563 for main/waeup.kofa/trunk/src/waeup/kofa/applicants
- Timestamp:
- 30 May 2012, 19:24:51 (13 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/applicants
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser.py
r8562 r8563 286 286 return self.context.p_id 287 287 288 class ApplicantsStatisticsPage(KofaDisplayFormPage): 289 """Some statistics about applicants in a container. 290 """ 291 grok.context(IApplicantsContainer) 292 grok.name('statistics') 293 grok.require('waeup.manageApplication') 294 grok.template('applicantcontainerstatistics') 295 296 @property 297 def label(self): 298 return "%s" % self.context.title 299 288 300 class ApplicantsContainerPage(KofaDisplayFormPage): 289 301 """The standard view for regular applicant containers. -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/container.py
r8543 r8563 28 28 ) 29 29 from waeup.kofa.utils.helpers import attrs_to_fields 30 from waeup.kofa.applicants.workflow import (INITIALIZED, 31 STARTED, PAID, ADMITTED, NOT_ADMITTED, SUBMITTED, CREATED) 30 32 31 33 def generate_applicant_id(container=None): … … 95 97 return 96 98 99 @property 100 def statistics(self): 101 statistics = {INITIALIZED:0, STARTED:0, PAID:0, SUBMITTED:0, 102 ADMITTED:0, NOT_ADMITTED:0, CREATED:0} 103 for key in self.keys(): 104 statistics[self[key].state] += 1 105 return statistics 106 97 107 ApplicantsContainer = attrs_to_fields(ApplicantsContainer) 98 108 -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/viewlets.py
r8435 r8563 23 23 from waeup.kofa.applicants.interfaces import ( 24 24 IApplicant, IApplicantsRoot, IApplicantsContainer, 25 IApplicantOnlinePayment ,25 IApplicantOnlinePayment 26 26 ) 27 27 from waeup.kofa.applicants.browser import ( 28 28 ApplicantsRootPage, ApplicantsContainerPage, ApplicantManageFormPage, 29 ApplicantDisplayFormPage, OnlinePaymentDisplayFormPage 29 ApplicantDisplayFormPage, OnlinePaymentDisplayFormPage, 30 ApplicantsContainerManageFormPage, ApplicantsStatisticsPage 30 31 ) 31 32 … … 98 99 text = _('Manage application section') 99 100 100 #class ApplicantsContainerManageActionButton(ManageActionButton):101 # grok.order(1)102 # grok.context(IApplicantsContainer)103 # grok.view(ApplicantsContainerPage)104 # grok.require('waeup.manageApplication')105 # text = _('Manage application records')106 107 101 class ApplicantRegisterActionButton(ManageActionButton): 108 grok.order( 2)102 grok.order(1) 109 103 grok.context(IApplicantsContainer) 110 104 grok.view(ApplicantsContainerPage) … … 114 108 target = 'register' 115 109 110 class ApplicantsContainerStatisticsActionButton(ManageActionButton): 111 grok.order(1) 112 grok.context(IApplicantsContainer) 113 grok.view(ApplicantsContainerManageFormPage) 114 grok.require('waeup.manageApplication') 115 icon = 'actionicon_statistics.png' 116 text = _('Container statistics') 117 target = 'statistics' 118 119 class ApplicantsContainerStatisticsActionButton2(ApplicantsContainerStatisticsActionButton): 120 grok.order(3) 121 grok.view(ApplicantsContainerPage) 122 123 class ApplicantsContainerManageActionButton(ManageActionButton): 124 grok.order(2) 125 grok.context(IApplicantsContainer) 126 grok.view(ApplicantsContainerPage) 127 grok.require('waeup.manageApplication') 128 text = _('Manage container') 129 target = 'manage' 130 116 131 class ApplicantViewActionButton(ManageActionButton): 117 132 grok.context(IApplicant)
Note: See TracChangeset for help on using the changeset viewer.