Ignore:
Timestamp:
9 Dec 2011, 12:34:30 (13 years ago)
Author:
Henrik Bettermann
Message:

It seems that font attributes can't be defined in Tables if Paragraphs are being used. The latter have to be used to render the widgets properly.

Reorganise slip pages in students section.

Sort course lists by semester and course code.

File:
1 edited

Legend:

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

    r7310 r7318  
    9090    """
    9191    grok.context(IStudentsContainer)
    92     title = u'Students'
     92    title = 'Students'
    9393
    9494class StudentBreadcrumb(Breadcrumb):
     
    104104    """
    105105    grok.context(IStudentStudyCourse)
    106     title = u'Study Course'
     106    title = 'Study Course'
    107107
    108108class PaymentsBreadcrumb(Breadcrumb):
     
    110110    """
    111111    grok.context(IStudentPaymentsContainer)
    112     title = u'Payments'
     112    title = 'Payments'
    113113
    114114class OnlinePaymentBreadcrumb(Breadcrumb):
     
    125125    """
    126126    grok.context(IStudentAccommodation)
    127     title = u'Accommodation'
     127    title = 'Accommodation'
    128128
    129129    #@property
     
    536536    grok.require('waeup.viewStudent')
    537537    form_fields = grok.AutoFields(IStudentClearance).omit('clearance_locked')
     538    form_fields['date_of_birth'].custom_widget = FriendlyDateDisplayWidget('le')
    538539    prefix = 'form'
     540    title = 'Clearance Data'
    539541
    540542    @property
     
    547549        students_utils = getUtility(IStudentsUtils)
    548550        return students_utils.renderPDF(
    549             self,'Clearance', 'clearance.pdf',
     551            self, 'clearance.pdf',
    550552            self.context.getStudent(), studentview)
    551553
     
    819821    form_fields = grok.AutoFields(IStudentStudyLevel)
    820822    prefix = 'form'
     823    title = 'Level Data'
     824    content_title = 'Course List'
    821825
    822826    @property
     
    828832            self.request)
    829833        students_utils = getUtility(IStudentsUtils)
     834        tabledata = sorted(self.context.values(),
     835            key=lambda value: str(value.semester) + value.code)
    830836        return students_utils.renderPDF(
    831             self,'Course Registration', 'course_registration.pdf',
     837            self, 'course_registration.pdf',
    832838            self.context.getStudent(), studentview,
    833839            tableheader=[('Sem.','semester', 1.5),('Code','code', 2.5),
     
    838844                         ('Score', 'score', 1.5),('Auto', 'automatic', 1.5)
    839845                         ],
    840             tabledata=self.context.values())
     846            tabledata=tabledata)
    841847
    842848class StudyLevelManageActionButton(ManageActionButton):
     
    12551261    form_fields['payment_date'].custom_widget = FriendlyDateDisplayWidget('le')
    12561262    prefix = 'form'
     1263    title = 'Payment Data'
    12571264
    12581265    @property
     
    12681275            self.request)
    12691276        students_utils = getUtility(IStudentsUtils)
    1270         return students_utils.renderPDF(self,'Payment', 'payment_receipt.pdf',
     1277        return students_utils.renderPDF(self, 'payment_receipt.pdf',
    12711278            self.context.getStudent(), studentview)
    12721279
     
    14791486    form_fields['booking_date'].custom_widget = FriendlyDateDisplayWidget('le')
    14801487    prefix = 'form'
     1488    title = 'Bed Allocation Data'
    14811489
    14821490    @property
    14831491    def label(self):
    1484         return 'Bed Allocation %s' % self.context.bed_coordinates
     1492        return 'Bed Allocation: %s' % self.context.bed_coordinates
    14851493
    14861494    def render(self):
     
    14891497        students_utils = getUtility(IStudentsUtils)
    14901498        return students_utils.renderPDF(
    1491             self,'Bed Allocation', 'bed_allocation.pdf',
     1499            self, 'bed_allocation.pdf',
    14921500            self.context.getStudent(), studentview)
    14931501
Note: See TracChangeset for help on using the changeset viewer.