Changeset 12368


Ignore:
Timestamp:
3 Jan 2015, 06:33:14 (10 years ago)
Author:
Henrik Bettermann
Message:

Render terms and conditions on contract slip.

Location:
main/waeup.ikoba/trunk/src/waeup/ikoba/customers
Files:
3 edited

Legend:

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

    r12363 r12368  
    15101510
    15111511    @property
     1512    def terms_and_conditions(self):
     1513        lang = self.request.cookies.get('ikoba.language')
     1514        html = self.context.tc_dict.get(lang,'')
     1515        if html =='':
     1516            portal_language = getUtility(IIkobaUtils).PORTAL_LANGUAGE
     1517            html = self.context.tc_dict.get(portal_language,'')
     1518        return html
     1519
     1520    @property
    15121521    def label(self):
    15131522        portal_language = getUtility(IIkobaUtils).PORTAL_LANGUAGE
  • main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_browser.py

    r12363 r12368  
    13481348        self.contract.document_object = self.document
    13491349        self.contract.product_object = self.product
     1350        self.contract.tc_dict = {'en': u'<strong>Hello world</strong>'}
    13501351        self.browser.open(self.customer_path + '/contracts/CON1')
    13511352        self.browser.getLink("Download contract slip").click()
  • main/waeup.ikoba/trunk/src/waeup/ikoba/customers/utils.py

    r12351 r12368  
    413413                    data.append(contenttable)
    414414
     415        # Insert terms and conditions
     416        if hasattr(view, 'terms_and_conditions'):
     417            tc_translation = trans(_('Terms and Conditions'), portal_language)
     418            data.append(Paragraph(tc_translation, HEADING_STYLE))
     419            tc = format_html(view.terms_and_conditions)
     420            data.append(Paragraph(tc, NOTE_STYLE))
     421
    415422        # Insert signatures
    416423        # XXX: We are using only sigs_in_footer in waeup.ikoba, so we
Note: See TracChangeset for help on using the changeset viewer.