Ignore:
Timestamp:
26 Nov 2011, 06:49:16 (13 years ago)
Author:
Henrik Bettermann
Message:

academics: Show students in departments.

students: Search for students in department.

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

Legend:

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

    r7202 r7205  
    5454    IPasswordValidator)
    5555from waeup.sirp.permissions import get_users_with_local_roles, get_all_roles
     56from waeup.sirp.students.catalog import search as searchstudents
    5657from waeup.sirp.university.catalog import search
    5758from waeup.sirp.university.vocabularies import course_levels
     
    13691370            yield(dict(url=url, name=key, container=val))
    13701371
     1372class ShowStudentsPage(WAeUPPage):
     1373    """Page that lists all students in the department.
     1374    """
     1375    grok.context(IDepartment)
     1376    grok.require('waeup.showStudents')
     1377    grok.name('showstudents')
     1378    pnav = 1
     1379    label = 'Students'
     1380
     1381    @property
     1382    def title(self):
     1383        return self.context.longtitle()
     1384
     1385    @property
     1386    def getStudents(self):
     1387        hitlist = searchstudents(query=self.context.code,
     1388            searchtype='depcode', view=self)
     1389        return hitlist
     1390
     1391    def update(self, *args, **kw):
     1392        datatable.need()
     1393        return
     1394
    13711395class DepartmentManageFormPage(WAeUPEditFormPage):
    13721396    """Manage the basic properties of a `Department` instance.
  • main/waeup.sirp/trunk/src/waeup/sirp/browser/viewlets.py

    r7202 r7205  
    416416    text = 'Manage department'
    417417
     418class ShowDepartmentStudentsActionButton(ManageActionButton):
     419    """ 'Show students' button for departments.
     420    """
     421    grok.context(IDepartment)
     422    grok.view(DepartmentPage)
     423    grok.require('waeup.showStudents')
     424    icon = 'actionicon_student.png'
     425    text = 'Show students'
     426    target = 'showstudents'
     427
    418428class ManageCourseActionButton(ManageActionButton):
    419429    """ 'Edit settings' button for courses.
Note: See TracChangeset for help on using the changeset viewer.