Changeset 12754
- Timestamp:
- 12 Mar 2015, 20:17:34 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.ikoba/trunk/src/waeup/ikoba/browser/breadcrumbs.py
r12525 r12754 30 30 ICompany, IUsersContainer, IDataCenter, 31 31 ) 32 from waeup.ikoba.payments.interfaces import IPayment 33 from waeup.ikoba.payments.payment import find_payable_from_payable_id 32 34 from waeup.ikoba.reports import IReportsContainer 33 35 … … 148 150 parent_viewname = 'administration' 149 151 target = None 152 153 154 class PaymentBreadcrumb(Breadcrumb): 155 """A breadcrumb for payment. 156 """ 157 grok.context(IPayment) 158 parent = grok.getSite() 159 target = None 160 161 @property 162 def title(self): 163 id_part = self.context.payment_id[4:12] 164 return _(u"Payment ${id}", mapping={'id': id_part}) 165 166 @property 167 def parent(self): 168 """We display the payments payable as parent. 169 """ 170 payment = self.context 171 payable = find_payable_from_payable_id(payment.payable_id) 172 if payable is None: 173 # fallback: display site home as parent 174 return (grok.getSite(), 'index') 175 return (payable, 'index') 176 150 177 151 178 def getBreadcrumb(obj, viewname=None):
Note: See TracChangeset for help on using the changeset viewer.