Ignore:
Timestamp:
18 Sep 2018, 19:41:05 (6 years ago)
Author:
Henrik Bettermann
Message:

Add StudentTranscriptSignView? which does nothing so far.
Add SignTranscriptActionButton?.

Location:
main/waeup.kofa/branches/henrik-transcript-workflow/src/waeup/kofa/students
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/branches/henrik-transcript-workflow/src/waeup/kofa/students/browser.py

    r15143 r15146  
    11651165        return
    11661166
     1167class StudentTranscriptSignView(UtilityView, grok.View):
     1168    """ View to sign transcript
     1169    """
     1170    grok.context(IStudentStudyCourse)
     1171    grok.name('sign_transcript')
     1172    grok.require('waeup.signTranscript')
     1173
     1174    def update(self, SUBMIT=None):
     1175        if self.context.student.state != TRANSVAL:
     1176            self.flash(_('Student is in wrong state.'), type="warning")
     1177            self.redirect(self.url(self.context))
     1178            return
     1179        self.flash(_('Transcript signed.'))
     1180        self.redirect(self.url(self.context))
     1181        return
     1182
     1183    def render(self):
     1184        return
     1185
    11671186class StudentTranscriptReleaseFormPage(KofaEditFormPage):
    11681187    """ Page to release transcript
     
    12301249    """ Page to display the student's transcript.
    12311250    """
    1232     grok.context(IStudentStudyCourseTranscript)
     1251    grok.context(IStudentStudyCourse)
    12331252    grok.name('transcript')
    12341253    grok.require('waeup.viewTranscript')
  • main/waeup.kofa/branches/henrik-transcript-workflow/src/waeup/kofa/students/viewlets.py

    r15140 r15146  
    3232    OnlinePaymentDisplayFormPage, BedTicketDisplayFormPage,
    3333    StudentClearanceEditFormPage, StudentPersonalEditFormPage,
    34     PaymentsManageFormPage, StudyCourseTranscriptPage, EditScoresPage,)
     34    PaymentsManageFormPage, StudyCourseTranscriptPage, EditScoresPage)
    3535from waeup.kofa.students.interfaces import (
    3636    IStudentsContainer, IStudent, IStudentStudyCourse, IStudentStudyLevel,
     
    797797            "validation. \\n\\n"
    798798            "You really want to validate the transcript?'")
     799
     800class SignTranscriptActionButton(ManageActionButton):
     801    grok.order(9)
     802    grok.context(IStudentStudyCourse)
     803    grok.view(StudyCourseTranscriptPage)
     804    grok.require('waeup.signTranscript')
     805    text = _('Sign transcript')
     806    target = 'sign_transcript'
     807    icon = 'actionicon_transcript.png'
     808
     809    @property
     810    def target_url(self):
     811        if self.context.student.state != TRANSVAL:
     812            return ''
     813        return self.view.url(self.view.context, self.target)
     814
     815    @property
     816    def onclick(self):
     817        return "return window.confirm(%s);" % _(
     818            "'Signing a transcript cannot be revoked."
     819            "\\n\\n"
     820            "You really want to sign the transcript?'")
    799821
    800822
Note: See TracChangeset for help on using the changeset viewer.