Ignore:
Timestamp:
28 Nov 2019, 08:21:23 (5 years ago)
Author:
Henrik Bettermann
Message:

Implement library clearance facilities.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/students/viewlets.py

    r15849 r15859  
    2323from waeup.kofa.students.interfaces import IStudent, IStudentsUtils
    2424from kofacustom.iuokada.students.interfaces import (
    25     ICustomStudentStudyCourse, ICustomStudentStudyLevel)
     25    ICustomStudentStudyCourse, ICustomStudentStudyLevel, ICustomStudent)
    2626from waeup.kofa.students.fileviewlets import (
    2727    StudentFileDisplay, StudentFileUpload, StudentImage)
     
    3131
    3232from kofacustom.nigeria.interfaces import MessageFactory as _
     33
     34class SwitchLibraryAccessActionButton(ManageActionButton):
     35    grok.order(7)
     36    grok.context(ICustomStudent)
     37    grok.view(StudentBaseDisplayFormPage)
     38    grok.require('waeup.switchLibraryAccess')
     39    text = _('Switch library access')
     40    target = 'switch_library_access'
     41    icon = 'actionicon_book.png'
     42
    3343
    3444class GetMatricNumberActionButton(ManageActionButton):
     
    5060            return ''
    5161        return self.view.url(self.view.context, 'get_matric_number')
     62
     63# Library
     64
     65class LibraryIdCardActionButton(ManageActionButton):
     66    grok.order(10)
     67    grok.context(ICustomStudent)
     68    grok.view(StudentBaseDisplayFormPage)
     69    grok.require('waeup.viewStudent')
     70    icon = 'actionicon_pdf.png'
     71    text = _('Download Library Id Card')
     72    target = 'lib_idcard.pdf'
     73
     74    @property
     75    def target_url(self):
     76        if self.context.library:
     77            return self.view.url(self.view.context, self.target)
     78        return
    5279
    5380# Signature
Note: See TracChangeset for help on using the changeset viewer.