Changeset 12761


Ignore:
Timestamp:
14 Mar 2015, 06:17:25 (10 years ago)
Author:
Henrik Bettermann
Message:

Add browser module in payments. We need this module for payments management.

Move breadcrumbs PaymentBreadcrumb? into this module.

Location:
main/waeup.ikoba/trunk/src/waeup/ikoba
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.ikoba/trunk/src/waeup/ikoba/browser/breadcrumbs.py

    r12755 r12761  
    2828    ICompany, IUsersContainer, IDataCenter,
    2929    )
    30 from waeup.ikoba.payments.interfaces import IPayment
    31 from waeup.ikoba.payments.payment import find_payable_from_payable_id
    3230from waeup.ikoba.reports import IReportsContainer
    3331
     
    156154    parent_viewname = 'administration'
    157155    target = None
    158 
    159 
    160 class PaymentBreadcrumb(Breadcrumb):
    161     """A breadcrumb for payment.
    162     """
    163     grok.context(IPayment)
    164     parent = grok.getSite()
    165     target = None
    166 
    167     @property
    168     def title(self):
    169         id_part = self.context.payment_id[4:12]
    170         return _(u"Payment ${id}", mapping={'id': id_part})
    171 
    172     @property
    173     def parent(self):
    174         """We display the payments payable as parent.
    175         """
    176         payment = self.context
    177         payable = find_payable_from_payable_id(payment.payable_id)
    178         if payable is None:
    179             # fallback: display site home as parent
    180             return (grok.getSite(), 'index')
    181         return (payable, 'index')
    182156
    183157
Note: See TracChangeset for help on using the changeset viewer.