Changeset 12634 for main/waeup.ikoba/trunk/src/waeup/ikoba/customers
- Timestamp:
- 27 Feb 2015, 21:56:34 (10 years ago)
- Location:
- main/waeup.ikoba/trunk/src/waeup/ikoba/customers
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/browser.py
r12633 r12634 51 51 from waeup.ikoba.mandates.mandate import PasswordMandate 52 52 from waeup.ikoba.widgets.hrefwidget import HREFDisplayWidget 53 from waeup.ikoba.utils.helpers import get_current_principal, to_timezone, now 53 from waeup.ikoba.utils.helpers import ( 54 get_current_principal, to_timezone, now, format_date) 54 55 from waeup.ikoba.customers.interfaces import ( 55 56 ICustomer, ICustomersContainer, ICustomerRequestPW, ICustomersUtils, … … 1593 1594 1594 1595 @property 1596 def validity_period(self): 1597 if self.context.valid_from or self.context.valid_to: 1598 return "%s - %s" % (format_date(self.context.valid_from, self.request), 1599 format_date(self.context.valid_to, self.request)) 1600 return 1601 1602 @property 1595 1603 def label(self): 1596 1604 portal_language = getUtility(IIkobaUtils).PORTAL_LANGUAGE -
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/browser_templates/contractpage.pt
r12593 r12634 26 26 </tr> 27 27 <tal:widgets content="structure provider:widgets" /> 28 <tr> 29 <td i18n:translate="" class="fieldname"> 30 Validity Period: 31 </td> 32 <td> 33 <span tal:content="python: layout.formatDate(context.valid_from)"> 34 VALIDFROM 35 </span> - 36 <span tal:content="python: layout.formatDate(context.valid_to)"> 37 VALIDTO 38 </span> 39 </td> 40 </tr> 28 41 </tbody> 29 42 </table> -
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_browser.py
r12593 r12634 1444 1444 self.contract.product_object = self.product 1445 1445 self.contract.tc_dict = {'en': u'<strong>Hello world</strong>'} 1446 self.contract.valid_from = date(2015, 12, 4) 1447 self.contract.valid_to = 'anything' 1446 1448 self.contract.title = u'Contract Title' 1447 1449 self.browser.open(self.customer_path + '/contracts/CON1') -
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/utils.py
r12526 r12634 410 410 data.extend(creator.fromStringList(customer.history.messages)) 411 411 412 # Insert validity period 413 if getattr(view, 'validity_period', None): 414 vp_translation = trans(_('Validity Period'), portal_language) 415 data.append(Paragraph(vp_translation, HEADING_STYLE)) 416 vp = view.validity_period 417 data.append(Paragraph(vp, NOTE_STYLE)) 418 412 419 # Insert content tables (optionally on second page) 413 if hasattr(view, 'tabletitle'):420 if getattr(view, 'tabletitle', None): 414 421 for i in range(len(view.tabletitle)): 415 422 if tabledata[i] and tableheader[i]: … … 422 429 423 430 # Insert terms and conditions 424 if hasattr(view, 'terms_and_conditions'):431 if getattr(view, 'terms_and_conditions', None): 425 432 tc_translation = trans(_('Terms and Conditions'), portal_language) 426 433 data.append(Paragraph(tc_translation, HEADING_STYLE))
Note: See TracChangeset for help on using the changeset viewer.