Ignore:
Timestamp:
18 Feb 2016, 11:52:18 (9 years ago)
Author:
Henrik Bettermann
Message:

Add flash_notice field.

File:
1 edited

Legend:

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

    r13610 r13711  
    414414    grok.template('basepage')
    415415    form_fields = grok.AutoFields(IStudentBase).omit(
    416         'password', 'suspended', 'suspended_comment')
     416        'password', 'suspended', 'suspended_comment', 'flash_notice')
    417417    pnav = 4
    418418
     
    430430            return _('set')
    431431        return _('unset')
     432
     433    def update(self):
     434        if self.context.flash_notice:
     435            self.flash(self.context.flash_notice, type="warning")
     436        super(StudentBaseDisplayFormPage, self).update()
     437        return
    432438
    433439class StudentBasePDFFormPage(KofaDisplayFormPage):
     
    492498    prefix = 'form'
    493499
    494     omit_fields = ('date_of_birth', 'current_level')
     500    omit_fields = ('date_of_birth', 'current_level', 'flash_notice')
    495501
    496502    form_fields = grok.AutoFields(IStudentBase).select('student_id', 'reg_number')
     
    664670        'suspended', 'phone',
    665671        'adm_code', 'suspended_comment',
    666         'date_of_birth', 'current_level')
     672        'date_of_birth', 'current_level',
     673        'flash_notice')
    667674
    668675    @property
     
    12061213        'department', 'faculty', 'current_mode', 'entry_session', 'certificate',
    12071214        'password', 'suspended', 'phone', 'email',
    1208         'adm_code', 'suspended_comment', 'current_level')
     1215        'adm_code', 'suspended_comment', 'current_level', 'flash_notice')
    12091216
    12101217    def update(self):
     
    13561363    omit_fields = (
    13571364        'password', 'suspended', 'phone', 'date_of_birth',
    1358         'adm_code', 'sex', 'suspended_comment', 'current_level')
     1365        'adm_code', 'sex', 'suspended_comment', 'current_level',
     1366        'flash_notice')
    13591367
    13601368    @property
     
    19191927    omit_fields = (
    19201928        'password', 'suspended', 'phone', 'date_of_birth',
    1921         'adm_code', 'sex', 'suspended_comment', 'current_level')
     1929        'adm_code', 'sex', 'suspended_comment', 'current_level',
     1930        'flash_notice')
    19221931
    19231932    @property
     
    22032212    omit_fields = (
    22042213        'password', 'suspended', 'phone', 'adm_code',
    2205         'suspended_comment', 'date_of_birth', 'current_level')
     2214        'suspended_comment', 'date_of_birth', 'current_level',
     2215        'flash_notice')
    22062216
    22072217    @property
Note: See TracChangeset for help on using the changeset viewer.