Changeset 12593 for main/waeup.ikoba/trunk/src/waeup
- Timestamp:
- 11 Feb 2015, 14:26:10 (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
r12580 r12593 1393 1393 1394 1394 @property 1395 def terms_and_conditions(self): 1396 lang = self.request.cookies.get('ikoba.language') 1397 html = self.context.tc_dict.get(lang,'') 1398 if html =='': 1399 portal_language = getUtility(IIkobaUtils).PORTAL_LANGUAGE 1400 html = self.context.tc_dict.get(portal_language,'') 1401 return html 1402 1403 @property 1395 1404 def form_fields(self): 1396 1405 return grok.AutoFields(self.context.form_fields_interface).omit( … … 1416 1425 pnav = 4 1417 1426 deletion_warning = _('Are you sure?') 1427 terms_and_conditions = None 1418 1428 1419 1429 @property … … 1449 1459 @action(_('Apply now (final submit)'), warning=WARNING_CON) 1450 1460 def finalsubmit(self, **data): 1461 if not self.request.form.get('confirm_tc', False): 1462 self.flash(_('Please read the terms and conditions and ' 1463 'confirm your acceptance of these by ticking ' 1464 'the confirmation box.'), type="danger") 1465 return 1451 1466 msave(self, **data) 1452 1467 IWorkflowInfo(self.context).fireTransition('submit') -
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/browser_templates/contracteditpage.pt
r12118 r12593 11 11 <br /> 12 12 13 <tal:tc condition="python: view.terms_and_conditions and view.__name__ == 'edit'"> 14 <h4 i18n:domain="waeup.ikoba"> 15 <span i18n:translate="">Terms and Conditions</span> 16 </h4> 17 <tal:tc content="structure view/terms_and_conditions" /> 18 <br /> 19 <input id="confirm_tc" name="confirm_tc" type="checkbox" value="True"/> 20 <span i18n:translate=""> 21 I confirm that I have read, understood and accepted the Terms & Conditions. 22 </span> 23 <br /><br /> 24 </tal:tc> 25 13 26 <div tal:condition="view/availableActions"> 14 27 <input tal:repeat="action view/actions" -
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/browser_templates/contractpage.pt
r12363 r12593 29 29 </table> 30 30 31 <h4 i18n:domain="waeup.ikoba"> 32 <span i18n:translate="">Terms and Conditions</span> 33 </h4> 34 35 <tal:tc content="structure view/terms_and_conditions" /> 31 <tal:tc condition="view/terms_and_conditions"> 32 <h4 i18n:domain="waeup.ikoba"> 33 <span i18n:translate="">Terms and Conditions</span> 34 </h4> 35 <tal:tc content="structure view/terms_and_conditions" /> 36 </tal:tc> -
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_browser.py
r12585 r12593 1414 1414 '<a href="http://localhost/app/customers/K1000000/documents/DOC1">DOC1 -' 1415 1415 in self.browser.contents) 1416 # Customer can submit the form. The form is also saved. 1416 # Customer can submit the form if confirmation box is ticket. 1417 # The form is also saved. 1417 1418 self.browser.getLink("Edit").click() 1419 self.browser.getControl("Apply").click() 1420 self.assertTrue('confirm your acceptance of these by ticking' in self.browser.contents) 1421 self.assertEqual(contract.state, 'created') 1422 self.browser.getControl(name="confirm_tc").value = True 1418 1423 self.browser.getControl("Apply").click() 1419 1424 self.assertEqual(contract.state, 'submitted')
Note: See TracChangeset for help on using the changeset viewer.