Ignore:
Timestamp:
12 Dec 2011, 14:11:21 (13 years ago)
Author:
Henrik Bettermann
Message:

Implement local CourseAdviser? roles. These roles can be assigned in departments and certificates. There are 6 different roles, one for each study level. getRolesForPrincipal grants the additional waeup.StudentsCourseAdviser? role only if the current level of a student corresponds with the level number in the external role name.

To do: Assign local roles on CertificateManageFormPage?. Add browser tests.

Location:
main/waeup.sirp/trunk/src/waeup/sirp/browser
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/browser/pages.py

    r7333 r7334  
    14071407            yield(dict(url=url, name=key, container=val))
    14081408
    1409 class ShowStudentsPage(SIRPPage):
     1409class ShowStudentsInDepartmentPage(SIRPPage):
    14101410    """Page that lists all students in the department.
    14111411    """
    14121412    grok.context(IDepartment)
    14131413    grok.require('waeup.showStudents')
    1414     grok.name('showstudents')
     1414    grok.name('showdepstudents')
     1415    grok.template('showstudentspage')
    14151416    pnav = 1
    14161417    label = 'Students'
     
    14291430        datatable.need()
    14301431        return
     1432
     1433class ShowStudentsInCertificatePage(ShowStudentsInDepartmentPage):
     1434    """Page that lists all students studying a certificate.
     1435    """
     1436    grok.context(ICertificate)
     1437    grok.require('waeup.showStudents')
     1438    grok.name('showcertstudents')
     1439    pnav = 1
     1440    label = 'Students'
     1441
     1442    @property
     1443    def getStudents(self):
     1444        hitlist = searchstudents(query=self.context.code,
     1445            searchtype='certcode', view=self)
     1446        return hitlist
    14311447
    14321448class DepartmentManageFormPage(SIRPEditFormPage):
  • main/waeup.sirp/trunk/src/waeup/sirp/browser/viewlets.py

    r7333 r7334  
    434434    icon = 'actionicon_student.png'
    435435    text = 'Show students'
    436     target = 'showstudents'
     436    target = 'showdepstudents'
    437437
    438438class ManageCourseActionButton(ManageActionButton):
     
    449449    grok.view(CertificatePage)
    450450    text = 'Manage certificate'
     451
     452class ShowCertificateStudentsActionButton(ManageActionButton):
     453    """ 'Show students' button for certificates.
     454    """
     455    grok.context(ICertificate)
     456    grok.view(CertificatePage)
     457    grok.require('waeup.showStudents')
     458    icon = 'actionicon_student.png'
     459    text = 'Show students'
     460    target = 'showcertstudents'
    451461
    452462class ManageCertificateCourseActionButton(ManageActionButton):
Note: See TracChangeset for help on using the changeset viewer.