Ignore:
Timestamp:
11 May 2011, 23:27:21 (14 years ago)
Author:
uli
Message:

Try out new date display widget.

File:
1 edited

Legend:

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

    r6051 r6053  
    226226        return self.view.application_url('applicants')
    227227
     228from waeup.sirp.widgets.datewidget import (
     229    FormattedDateWidget, FormattedDateDisplayWidget,)
     230
     231FriendlyDateWidget = CustomWidgetFactory(
     232    FormattedDateWidget,
     233    cssClass='datepicker-le-year',
     234    date_format='%d/%m/%Y')
     235FriendlyDateDisplayWidget = CustomWidgetFactory(
     236    FormattedDateDisplayWidget,
     237    date_format='%d/%m/%Y')
     238
    228239class ApplicantsContainerPage(WAeUPDisplayFormPage):
    229240    """The standard view for regular applicant containers.
     
    233244    grok.template('applicantscontainerpage')
    234245    pnav = 3
    235    
     246
     247    form_fields = grok.AutoFields(IApplicantsContainer)
     248    # Use friendlier date widget...
     249    form_fields['startdate'].custom_widget = FriendlyDateDisplayWidget
     250    form_fields['enddate'].custom_widget = FriendlyDateDisplayWidget
     251
    236252    @property
    237253    def title(self):
     
    253269    grok.view(ApplicantsContainerPage)
    254270    text = 'Manage'
    255 
    256 from waeup.sirp.widgets.datewidget import FormattedDateWidget
    257 FriendlyDateWidget = CustomWidgetFactory(
    258     FormattedDateWidget,
    259     cssClass='datepicker-le-year',
    260     date_format='%d/%m/%Y')
    261271
    262272
Note: See TracChangeset for help on using the changeset viewer.