Ignore:
Timestamp:
27 Oct 2012, 06:18:08 (12 years ago)
Author:
Henrik Bettermann
Message:

Viewlets should be in viewlets.py.

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

    r9395 r9439  
    2424from waeup.kofa.widgets.datewidget import FriendlyDatetimeDisplayWidget
    2525from waeup.kofa.browser.layout import KofaEditFormPage
    26 from waeup.kofa.browser.viewlets import ManageActionButton
    2726from waeup.kofa.browser.layout import action, jsaction
    2827from waeup.kofa.students.browser import (
    2928    StudentClearPage, StudentRejectClearancePage,
    30     StudyCourseDisplayFormPage,
    3129    StudyLevelEditFormPage,
    3230    msave, emit_lock_message)
     
    128126#        return
    129127
    130 class StudyCourseEditActionButton(ManageActionButton):
    131     grok.order(1)
    132     grok.context(ICustomStudentStudyCourse)
    133     grok.view(StudyCourseDisplayFormPage)
    134     grok.require('waeup.clearStudent')
    135     text = _('Edit level')
    136     target = 'edit_level'
    137 
    138     @property
    139     def target_url(self):
    140         if self.context.is_current and self.context.student.state == REQUESTED:
    141             return self.view.url(self.view.context, self.target)
    142         return False
    143 
    144128class StudyCourseCOEditFormPage(KofaEditFormPage):
    145129    """ Page to edit the student study course data by clearance officers.
  • main/waeup.uniben/trunk/src/waeup/uniben/students/viewlets.py

    r9382 r9439  
    1818
    1919import grok
     20from waeup.kofa.interfaces import REQUESTED
     21from waeup.kofa.browser.viewlets import ManageActionButton
     22from waeup.uniben.students.interfaces import ICustomStudentStudyCourse
    2023from waeup.kofa.students.viewlets import (
    2124    FileDisplay, FileUpload, Image)
    22 from waeup.kofa.students.browser import ExportPDFClearanceSlipPage
     25from waeup.kofa.students.browser import (
     26    ExportPDFClearanceSlipPage, StudyCourseDisplayFormPage)
    2327
    2428from kofacustom.nigeria.interfaces import MessageFactory as _
    2529
     30class StudyCourseEditActionButton(ManageActionButton):
     31    grok.order(1)
     32    grok.context(ICustomStudentStudyCourse)
     33    grok.view(StudyCourseDisplayFormPage)
     34    grok.require('waeup.clearStudent')
     35    text = _('Edit level')
     36    target = 'edit_level'
     37
     38    @property
     39    def target_url(self):
     40        if self.context.is_current and self.context.student.state == REQUESTED:
     41            return self.view.url(self.view.context, self.target)
     42        return False
    2643
    2744# JAMB Letter
Note: See TracChangeset for help on using the changeset viewer.