Changeset 13139 for main/waeup.ikoba


Ignore:
Timestamp:
5 Jul 2015, 07:42:57 (9 years ago)
Author:
Henrik Bettermann
Message:

Repair document manage form pages. Buttons were missing.

Location:
main/waeup.ikoba/trunk/src/waeup/ikoba/documents
Files:
2 edited

Legend:

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

    r13066 r13139  
    3636from waeup.ikoba.interfaces import MessageFactory as _
    3737from waeup.ikoba.interfaces import (
    38     IContactForm, IObjectHistory, IIkobaObject, IIkobaUtils, PUBLISHED)
     38    IContactForm, IIkobaObject, IIkobaUtils, PUBLISHED)
    3939from waeup.ikoba.browser.layout import (
    4040    IkobaPage, IkobaEditFormPage, IkobaAddFormPage, IkobaDisplayFormPage,
     
    278278    @action(_('Add local role'), validator=NullValidator)
    279279    def addLocalRole(self, **data):
    280         return add_local_role(self,2,**data)
     280        return add_local_role(self,3,**data)
    281281
    282282    @action(_('Remove selected local roles'))
    283283    def delLocalRoles(self, **data):
    284         return del_local_roles(self,2,**data)
     284        return del_local_roles(self,3,**data)
    285285
    286286
     
    299299        return
    300300
     301    # Actions must be repeated. They are not inherited from the parent class.
     302
     303    @action(_('Cancel'), validator=NullValidator)
     304    def cancel(self, **data):
     305        self.redirect(self.url(self.context))
     306        return
     307
     308    @action(_('Add local role'), validator=NullValidator)
     309    def addLocalRole(self, **data):
     310        return add_local_role(self,3,**data)
     311
     312    @action(_('Remove selected local roles'))
     313    def delLocalRoles(self, **data):
     314        return del_local_roles(self,3,**data)
     315
    301316
    302317class RESTDocumentManageFormPage(DocumentManageFormPage):
     
    313328        self.context.html_dict = rest2dict(html_multilingual, portal_language)
    314329        return
     330
     331    # Actions must be repeated. They are not inherited from the parent class.
     332
     333    @action(_('Cancel'), validator=NullValidator)
     334    def cancel(self, **data):
     335        self.redirect(self.url(self.context))
     336        return
     337
     338    @action(_('Add local role'), validator=NullValidator)
     339    def addLocalRole(self, **data):
     340        return add_local_role(self,3,**data)
     341
     342    @action(_('Remove selected local roles'))
     343    def delLocalRoles(self, **data):
     344        return del_local_roles(self,3,**data)
    315345
    316346
  • main/waeup.ikoba/trunk/src/waeup/ikoba/documents/tests/test_browser.py

    r12766 r13139  
    233233        self.assertTrue('HTML Document added.' in self.browser.contents)
    234234        document = self.app['documents']['DOC2']
    235 
     235        # All form action buttons are there
     236        self.assertTrue('value="Add local role"' in self.browser.contents)
     237        self.assertTrue('value="Save"' in self.browser.contents)
     238        self.assertTrue('value="Cancel"' in self.browser.contents)
    236239        # Document can be edited
    237240        self.browser.getControl(name="form.title").value = 'My second doc'
Note: See TracChangeset for help on using the changeset viewer.