Ignore:
Timestamp:
11 Apr 2012, 13:52:36 (13 years ago)
Author:
Henrik Bettermann
Message:

Add more upload viewlets.

User our date widgets.

Location:
main/waeup.uniben/trunk/src/waeup/uniben/students
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.uniben/trunk/src/waeup/uniben/students/browser.py

    r8076 r8108  
    8585        if cm is not None and cm.startswith('pg'):
    8686            form_fields = grok.AutoFields(IPGStudentClearance).omit('clearance_locked')
     87            form_fields['emp_start'].custom_widget = FriendlyDateDisplayWidget('le')
     88            form_fields['emp_end'].custom_widget = FriendlyDateDisplayWidget('le')
     89            form_fields['emp2_start'].custom_widget = FriendlyDateDisplayWidget('le')
     90            form_fields['emp2_end'].custom_widget = FriendlyDateDisplayWidget('le')
    8791        else:
    8892            form_fields = grok.AutoFields(IUGStudentClearance).omit('clearance_locked')
    8993        form_fields['date_of_birth'].custom_widget = FriendlyDateDisplayWidget('le')
     94        form_fields['fst_sit_date'].custom_widget = FriendlyDateDisplayWidget('le')
     95        form_fields['scd_sit_date'].custom_widget = FriendlyDateDisplayWidget('le')
     96        form_fields['scd_sit_date'].custom_widget = FriendlyDateDisplayWidget('le')
     97        form_fields['alr_date'].custom_widget = FriendlyDateDisplayWidget('le')
    9098        return form_fields
    9199
     
    100108        if cm is not None and cm.startswith('pg'):
    101109            form_fields = grok.AutoFields(IPGStudentClearance).omit('clearance_locked')
     110            form_fields['emp_start'].custom_widget = FriendlyDateWidget('le-year')
     111            form_fields['emp_end'].custom_widget = FriendlyDateWidget('le-year')
     112            form_fields['emp2_start'].custom_widget = FriendlyDateWidget('le-year')
     113            form_fields['emp2_end'].custom_widget = FriendlyDateWidget('le-year')
    102114        else:
    103115            form_fields = grok.AutoFields(IUGStudentClearance).omit('clearance_locked')
    104116        form_fields['date_of_birth'].custom_widget = FriendlyDateDisplayWidget('le')
     117        form_fields['fst_sit_date'].custom_widget = FriendlyDateWidget('le-year')
     118        form_fields['scd_sit_date'].custom_widget = FriendlyDateWidget('le-year')
     119        form_fields['scd_sit_date'].custom_widget = FriendlyDateWidget('le-year')
     120        form_fields['alr_date'].custom_widget = FriendlyDateWidget('le-year')
    105121        return form_fields
    106122
     
    115131        if cm is not None and cm.startswith('pg'):
    116132            form_fields = grok.AutoFields(IPGStudentClearance)
     133            form_fields['emp_start'].custom_widget = FriendlyDateWidget('le-year')
     134            form_fields['emp_end'].custom_widget = FriendlyDateWidget('le-year')
     135            form_fields['emp2_start'].custom_widget = FriendlyDateWidget('le-year')
     136            form_fields['emp2_end'].custom_widget = FriendlyDateWidget('le-year')
    117137        else:
    118138            form_fields = grok.AutoFields(IUGStudentClearance)
    119139        form_fields['date_of_birth'].custom_widget = FriendlyDateWidget('le-year')
     140        form_fields['fst_sit_date'].custom_widget = FriendlyDateWidget('le-year')
     141        form_fields['scd_sit_date'].custom_widget = FriendlyDateWidget('le-year')
     142        form_fields['scd_sit_date'].custom_widget = FriendlyDateWidget('le-year')
     143        form_fields['alr_date'].custom_widget = FriendlyDateWidget('le-year')
     144
     145
    120146        return form_fields
    121147
     
    130156        if cm is not None and cm.startswith('pg'):
    131157            form_fields = grok.AutoFields(IPGStudentClearance).omit('clearance_locked')
     158            form_fields['emp_start'].custom_widget = FriendlyDateWidget('le-year')
     159            form_fields['emp_end'].custom_widget = FriendlyDateWidget('le-year')
     160            form_fields['emp2_start'].custom_widget = FriendlyDateWidget('le-year')
     161            form_fields['emp2_end'].custom_widget = FriendlyDateWidget('le-year')
    132162        else:
    133163            form_fields = grok.AutoFields(IUGStudentClearance).omit('clearance_locked')
    134164        form_fields['date_of_birth'].custom_widget = FriendlyDateWidget('le-year')
     165        form_fields['fst_sit_date'].custom_widget = FriendlyDateWidget('le-year')
     166        form_fields['scd_sit_date'].custom_widget = FriendlyDateWidget('le-year')
     167        form_fields['scd_sit_date'].custom_widget = FriendlyDateWidget('le-year')
     168        form_fields['alr_date'].custom_widget = FriendlyDateWidget('le-year')
    135169        return form_fields
    136170
  • main/waeup.uniben/trunk/src/waeup/uniben/students/viewlets.py

    r8107 r8108  
    3232    label = _(u'LGA Identification')
    3333    title = _(u'LGA Identification Scan')
    34     download_name = u'lga_identification'
     34    download_name = u'lga_ident'
    3535
    3636class LGAIdentificationSlip(LGAIdentificationDisplay):
     
    4444    title = _(u'LGA Identification Scan')
    4545    mus = 1024 * 150
    46     download_name = u'lga_identification'
     46    download_name = u'lga_ident'
    4747    tab_redirect = '?tab2'
    4848
     
    5050    """Renders LGA Identification scan.
    5151    """
    52     grok.name('lga_identification')
    53     download_name = u'lga_identification'
     52    grok.name('lga_ident')
     53    download_name = u'lga_ident'
     54
     55# First Sitting Result
     56
     57class FirstSittingResultDisplay(FileDisplay):
     58    """First Sitting Result display viewlet.
     59    """
     60    grok.order(1)
     61    label = _(u'First Sitting Result')
     62    title = _(u'First Sitting Result')
     63    download_name = u'fst_sit_scan'
     64
     65class FirstSittingResultSlip(FirstSittingResultDisplay):
     66    grok.view(ExportPDFClearanceSlipPage)
     67
     68class FirstSittingResultUpload(FileUpload):
     69    """First Sitting Result upload viewlet.
     70    """
     71    grok.order(2)
     72    label = _(u'First Sitting Result')
     73    title = _(u'First Sitting Result Scan')
     74    mus = 1024 * 150
     75    download_name = u'fst_sit_scan'
     76    tab_redirect = '?tab2'
     77
     78class FirstSittingResultImage(Image):
     79    """Renders First Sitting Result scan.
     80    """
     81    grok.name('fst_sit_scan')
     82    download_name = u'fst_sit_scan'
     83
     84# Second Sitting Result
     85
     86class SecondSittingResultDisplay(FileDisplay):
     87    """Second Sitting Result display viewlet.
     88    """
     89    grok.order(1)
     90    label = _(u'Second Sitting Result')
     91    title = _(u'Second Sitting Result')
     92    download_name = u'scd_sit_scan'
     93
     94class SecondSittingResultSlip(SecondSittingResultDisplay):
     95    grok.view(ExportPDFClearanceSlipPage)
     96
     97class SecondSittingResultUpload(FileUpload):
     98    """Second Sitting Result upload viewlet.
     99    """
     100    grok.order(2)
     101    label = _(u'Second Sitting Result')
     102    title = _(u'Second Sitting Result Scan')
     103    mus = 1024 * 150
     104    download_name = u'scd_sit_scan'
     105    tab_redirect = '?tab2'
     106
     107class SecondSittingResultImage(Image):
     108    """Renders Second Sitting Result scan.
     109    """
     110    grok.name('scd_sit_scan')
     111    download_name = u'scd_sit_scan'
     112
     113# Higher Qualification Result
     114
     115class HigherQualificationResultDisplay(FileDisplay):
     116    """Higher Qualification Result display viewlet.
     117    """
     118    grok.order(1)
     119    label = _(u'Higher Qualification Result')
     120    title = _(u'Higher Qualification Result')
     121    download_name = u'hq_scan'
     122
     123class HigherQualificationResultSlip(HigherQualificationResultDisplay):
     124    grok.view(ExportPDFClearanceSlipPage)
     125
     126class HigherQualificationResultUpload(FileUpload):
     127    """Higher Qualification Result upload viewlet.
     128    """
     129    grok.order(2)
     130    label = _(u'Higher Qualification Result')
     131    title = _(u'Higher Qualification Result Scan')
     132    mus = 1024 * 150
     133    download_name = u'hq_scan'
     134    tab_redirect = '?tab2'
     135
     136class HigherQualificationResultImage(Image):
     137    """Renders Higher Qualification Result scan.
     138    """
     139    grok.name('hq_scan')
     140    download_name = u'hq_scan'
     141
     142# 2nd Higher Qualification Result
     143
     144class SecondHigherQualificationResultDisplay(FileDisplay):
     145    """Second Higher Qualification Result display viewlet.
     146    """
     147    grok.order(1)
     148    label = _(u'Second Higher Qualification Result')
     149    title = _(u'Second Higher Qualification Result')
     150    download_name = u'hq_scan2'
     151
     152class SecondHigherQualificationResultSlip(SecondHigherQualificationResultDisplay):
     153    grok.view(ExportPDFClearanceSlipPage)
     154
     155class SecondHigherQualificationResultUpload(FileUpload):
     156    """Second Higher Qualification Result upload viewlet.
     157    """
     158    grok.order(2)
     159    label = _(u'Second Higher Qualification Result')
     160    title = _(u'Second Higher Qualification Result Scan')
     161    mus = 1024 * 150
     162    download_name = u'hq_scan2'
     163    tab_redirect = '?tab2'
     164
     165class SecondHigherQualificationResultImage(Image):
     166    """Renders Second Higher Qualification Result scan.
     167    """
     168    grok.name('hq_scan2')
     169    download_name = u'hq_scan2'
     170
     171# Evidence of Name
     172
     173class EvidenceOfNameDisplay(FileDisplay):
     174    """Evidence of Name display viewlet.
     175    """
     176    grok.order(1)
     177    label = _(u'Evidence of Name')
     178    title = _(u'Evidence of Name')
     179    download_name = u'evid'
     180
     181class EvidenceOfNameSlip(EvidenceOfNameDisplay):
     182    grok.view(ExportPDFClearanceSlipPage)
     183
     184class EvidenceOfNameUpload(FileUpload):
     185    """Evidence of Name upload viewlet.
     186    """
     187    grok.order(2)
     188    label = _(u'Evidence of Name')
     189    title = _(u'Evidence of Name Scan')
     190    mus = 1024 * 150
     191    download_name = u'evid'
     192    tab_redirect = '?tab2'
     193
     194class EvidenceOfNameImage(Image):
     195    """Renders Evidence of Name scan.
     196    """
     197    grok.name('evid')
     198    download_name = u'evid'
Note: See TracChangeset for help on using the changeset viewer.