Ignore:
Timestamp:
12 Mar 2011, 14:27:34 (14 years ago)
Author:
uli
Message:
  • Remove applicantscontainer manage page and replace it with a form-based one.
  • Make applicants container manage page dynamically present the correct title.
  • Render description field of applicants containers from rst to HTML on applicants container entry (index) page.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/browser.py

    r5847 r5850  
    5050from zope.formlib.sequencewidget import ListSequenceWidget, SequenceDisplayWidget
    5151from zope.formlib.widget import CustomWidgetFactory
     52from waeup.sirp.utils.helpers import ReST2HTML
    5253from waeup.sirp.widgets.objectwidget import (
    5354    WAeUPObjectWidget, WAeUPObjectDisplayWidget)
     
    225226    grok.context(IApplicantsContainer)
    226227    grok.name('index')
    227 
     228    pnav = 3
     229   
    228230    @property
    229231    def title(self):
     
    234236    def label(self):
    235237        return self.title
    236     pnav = 3
     238
     239    def descriptionToHTML(self):
     240        return ReST2HTML(self.context.description)
    237241
    238242class ManageApplicantsContainerActionButton(ManageActionButton):
     
    245249    """
    246250    grok.context(IApplicantsContainer)
    247     grok.name('manage')
     251    grok.name('manage2')
    248252
    249253    @property
     
    303307class ManageApplicantsContainer(WAeUPEditFormPage):
    304308    grok.context(IApplicantsContainer)
    305     grok.name('edit')
     309    grok.name('manage')
    306310    form_fields = grok.AutoFields(IApplicantsContainer)
    307311    # Use friendlier date widget...
    308312    form_fields['startdate'].custom_widget = FriendlyDateWidget
    309313    form_fields['enddate'].custom_widget = FriendlyDateWidget
    310     label = 'Edit container'
    311     title = label
     314
     315    @property
     316    def title(self):
     317        return "Manage applicants container: %s" % getattr(
     318            self.context, '__name__', 'unnamed')
     319   
     320    @property
     321    def label(self):
     322        return self.title
     323
    312324    pnav = 3
    313325
    314326    def update(self):
    315         datepicker.need()
     327        datepicker.need() # Enable jQuery datepicker in date fields.
    316328        return super(ManageApplicantsContainer, self).update()
    317329
    318     @grok.action('Apply')
     330    @grok.action('Save')
    319331    def apply(self, **data):
    320332        self.applyData(self.context, **data)
Note: See TracChangeset for help on using the changeset viewer.