Changeset 12016 for main/waeup.ikoba/trunk/src/waeup/ikoba/customers
- Timestamp:
- 21 Nov 2014, 05:08:19 (10 years ago)
- Location:
- main/waeup.ikoba/trunk/src/waeup/ikoba/customers
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/browser.py
r12015 r12016 752 752 grok.name('index') 753 753 grok.require('waeup.viewCustomer') 754 grok.template('documentpage') 754 755 form_fields = grok.AutoFields(ICustomerDocument) 755 756 pnav = 4 … … 768 769 grok.context(ICustomerDocument) 769 770 grok.name('manage') 770 grok.require('waeup. viewCustomer')771 grok.require('waeup.manageCustomer') 771 772 form_fields = grok.AutoFields(ICustomerDocument) 772 773 pnav = 4 … … 778 779 'b':self.context.document_id}) 779 780 return self.context.document_id 781 782 @action(_('Save'), style='primary') 783 def save(self, **data): 784 msave(self, **data) 785 return -
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/browser_templates/documentsmanagepage.pt
r12015 r12016 7 7 <th> </th> 8 8 <th i18n:translate="">Document Id</th> 9 <th i18n:translate="">Title</th> 9 10 </tr> 10 11 </thead> … … 17 18 tal:condition="python: not view.unremovable(cl)" /> 18 19 </td> 19 <td> <a tal:attributes="href python: view.url(cl)"> 20 <span tal:content="cl/document_id">PDID</span></a></td> 20 <td> 21 <a tal:attributes="href python: view.url(cl)"> 22 <span tal:content="cl/document_id">DOCID</span></a> 23 </td> 24 <td> 25 <span tal:content="cl/title">TITLE</span> 26 </td> 21 27 </tr> 22 28 </tbody> -
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_browser.py
r12015 r12016 790 790 document = self.customer['documents']['d102'] 791 791 792 # Document can be edited 793 self.browser.getLink("d102").click() 794 self.browser.getLink("Manage").click() 795 self.browser.getControl(name="form.title").value = 'My second doc' 796 self.browser.getControl("Save").click() 797 self.assertTrue('Form has been saved.' in self.browser.contents) 798 self.browser.getLink("View").click() 799 self.assertEqual(self.browser.url, self.documents_path + '/d102/index') 800 792 801 # Documents can be removed 802 self.browser.getLink("Documents").click() 793 803 ctrl = self.browser.getControl(name='val_id') 794 804 ctrl.getControl(value=document.document_id).selected = True … … 802 812 803 813 self.assertTrue( 814 'INFO - zope.mgr - customers.browser.DocumentManageFormPage ' 815 '- K1000000 - saved: title' 816 in logcontent) 817 818 self.assertTrue( 804 819 'INFO - zope.mgr - customers.browser.DocumentAddFormPage ' 805 820 '- K1000000 - added: Generic Document %s' -
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/viewlets.py
r12015 r12016 27 27 from waeup.ikoba.customers.interfaces import ( 28 28 ICustomer, ICustomersContainer, 29 ICustomerDocumentsContainer )29 ICustomerDocumentsContainer, ICustomerDocument) 30 30 from waeup.ikoba.customers.browser import ( 31 31 CustomersContainerPage, CustomersContainerManagePage, 32 32 CustomerBaseDisplayFormPage, 33 DocumentsManageFormPage )33 DocumentsManageFormPage, DocumentDisplayFormPage, DocumentManageFormPage) 34 34 35 35 grok.context(IIkobaObject) # Make IIkobaObject the default context … … 266 266 target = 'edit_base' 267 267 268 268 269 class CustomerPasswordActionButton(ManageActionButton): 269 270 grok.order(2) … … 274 275 text = _('Change password') 275 276 target = 'changepassword' 277 276 278 277 279 class CustomerPassportActionButton(ManageActionButton): … … 295 297 text = _('Add document') 296 298 target = 'adddoc' 299 300 301 class DocumentManageActionButton(ManageActionButton): 302 grok.order(1) 303 grok.context(ICustomerDocument) 304 grok.view(DocumentDisplayFormPage) 305 grok.require('waeup.manageCustomer') 306 text = _('Manage') 307 target = 'manage' 308 309 class DocumentViewActionButton(ManageActionButton): 310 grok.order(1) 311 grok.context(ICustomerDocument) 312 grok.view(DocumentManageFormPage) 313 grok.require('waeup.manageCustomer') 314 text = _('View') 315 target = 'index' 316 icon = 'actionicon_view.png'
Note: See TracChangeset for help on using the changeset viewer.