Changeset 8099


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

Define separator headlines on clearance forms.

Catch ConstraintNotSatisfied? exception if selected level is wrong.

Location:
main/waeup.kofa/trunk/src/waeup/kofa
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/browser/templates/default_waeup_display_form.pt

    r7634 r8099  
    11<table class="form-table">
    22  <tbody>
    3     <tal:block repeat="widget view/widgets">
    4       <tr>
    5         <td class="fieldname">
    6           <tal:block content="widget/label"/>:
    7         </td>
    8         <td>
    9           <input tal:replace="structure widget" />
    10         </td>
    11       </tr>
    12     </tal:block>
     3    <tal:widgets content="structure provider:widgets" />
    134    <tal:files content="structure provider:files" />
    145  </tbody>
  • main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py

    r8082 r8099  
    2727from zope.catalog.interfaces import ICatalog
    2828from zope.component import queryUtility, getUtility, createObject
     29from zope.schema.interfaces import ConstraintNotSatisfied
    2930from zope.formlib.textwidgets import BytesDisplayWidget
    3031from hurry.workflow.interfaces import IWorkflowInfo, IWorkflowState
     
    407408
    408409    @property
     410    def separators(self):
     411        return getUtility(IStudentsUtils).SEPARATORS_DICT
     412
     413    @property
    409414    def form_fields(self):
    410415        cm = getattr(self.context,'current_mode', None)
     
    469474    label = _('Manage clearance data')
    470475    pnav = 4
     476
     477    @property
     478    def separators(self):
     479        return getUtility(IStudentsUtils).SEPARATORS_DICT
    471480
    472481    @property
     
    634643    @action(_('Save'), style='primary')
    635644    def save(self, **data):
    636         msave(self, **data)
     645        try:
     646            msave(self, **data)
     647        except ConstraintNotSatisfied:
     648            # The selected level might not exist in certificate
     649            self.flash(_('Current level not available for certificate.'))
     650            return
    637651        notify(grok.ObjectModifiedEvent(self.context.__parent__))
    638652        return
  • main/waeup.kofa/trunk/src/waeup/kofa/students/utils.py

    r7993 r8099  
    385385        'C': 'Student on probation',
    386386        }
     387
     388    SEPARATORS_DICT = {
     389        }
Note: See TracChangeset for help on using the changeset viewer.