Changeset 6054


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

Enable new Friendly Date Widgets and remove trash from here.

File:
1 edited

Legend:

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

    r6053 r6054  
    4848    PassportWidget, PassportDisplayWidget
    4949    )
     50from waeup.sirp.widgets.datewidget import (
     51    FriendlyDateWidget, FriendlyDateDisplayWidget)
     52
    5053#from zope.formlib.objectwidget import ObjectWidget
    5154from zope.formlib.sequencewidget import ListSequenceWidget, SequenceDisplayWidget
     
    7477list_results_display_widget = CustomWidgetFactory(
    7578    MultiListDisplayWidget, subwidget=results_display_widget)
    76 
    77 #: A date widget that renders with CSS class `datepicker` thus
    78 #  enabling : the jQuery datepicker for this field if the form loaded
    79 #  the jQuery code.
    80 FriendlyDateWidget = CustomWidgetFactory(
    81     DateWidget, cssClass='datepicker')
    8279
    8380class ApplicationsPage(WAeUPPage):
     
    226223        return self.view.application_url('applicants')
    227224
    228 from waeup.sirp.widgets.datewidget import (
    229     FormattedDateWidget, FormattedDateDisplayWidget,)
    230 
    231 FriendlyDateWidget = CustomWidgetFactory(
    232     FormattedDateWidget,
    233     cssClass='datepicker-le-year',
    234     date_format='%d/%m/%Y')
    235 FriendlyDateDisplayWidget = CustomWidgetFactory(
    236     FormattedDateDisplayWidget,
    237     date_format='%d/%m/%Y')
    238 
    239225class ApplicantsContainerPage(WAeUPDisplayFormPage):
    240226    """The standard view for regular applicant containers.
     
    247233    form_fields = grok.AutoFields(IApplicantsContainer)
    248234    # Use friendlier date widget...
    249     form_fields['startdate'].custom_widget = FriendlyDateDisplayWidget
    250     form_fields['enddate'].custom_widget = FriendlyDateDisplayWidget
     235    form_fields['startdate'].custom_widget = FriendlyDateDisplayWidget('le')
     236    form_fields['enddate'].custom_widget = FriendlyDateDisplayWidget('le')
    251237
    252238    @property
     
    277263    form_fields = grok.AutoFields(IApplicantsContainer)
    278264    # Use friendlier date widget...
    279     form_fields['startdate'].custom_widget = FriendlyDateWidget
    280     form_fields['enddate'].custom_widget = FriendlyDateWidget
     265    form_fields['startdate'].custom_widget = FriendlyDateWidget('le')
     266    form_fields['enddate'].custom_widget = FriendlyDateWidget('le')
    281267
    282268    @property
     
    382368    form_fields['fst_sit_results'].custom_widget = list_results_display_widget
    383369    form_fields['passport'].custom_widget = ThumbnailWidget
     370    form_fields['date_of_birth'].custom_widget = FriendlyDateDisplayWidget('le')
    384371    label = 'Applicant'
    385372    title = 'Applicant'
     
    394381    form_fields = grok.AutoFields(IApplicantPDEEditData).omit('locked')
    395382    form_fields['passport'].custom_widget = EncodingImageFileWidget
    396     form_fields['date_of_birth'].custom_widget = FriendlyDateWidget
     383    form_fields['date_of_birth'].custom_widget = FriendlyDateWidget('le-year')
    397384    grok.template('form_edit_pde')
    398385
     
    462449    form_fields = grok.AutoFields(IApplicantPDEEditData).omit('locked')
    463450    form_fields['passport'].custom_widget = EncodingImageFileWidget
    464     form_fields['date_of_birth'].custom_widget = FriendlyDateWidget
     451    form_fields['date_of_birth'].custom_widget = FriendlyDateWidget('le-year')
    465452    grok.template('form_edit_full')
    466453
Note: See TracChangeset for help on using the changeset viewer.