~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to ivle/webapp/groups/__init__.py

  • Committer: William Grant
  • Date: 2009-07-04 13:28:58 UTC
  • mto: (1294.4.2 ui-the-third)
  • mto: This revision was merged to the branch mainline in revision 1353.
  • Revision ID: grantw@unimelb.edu.au-20090704132858-yii1cu4x9ad1m5mu
Port GroupsView.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
Allows students and tutors to manage project groups.
22
22
'''
23
23
 
24
 
from ivle.database import Subject, Offering, Semester
 
24
from ivle.database import Offering
25
25
 
26
26
from ivle.webapp.base.plugins import ViewPlugin, MediaPlugin
27
27
from ivle.webapp.base.xhtml import XHTMLView
35
35
    tab = 'subjects'
36
36
    permission = 'edit'
37
37
 
38
 
    def __init__(self, req, subject, year, semester):
39
 
        """Find the given offering by subject, year and semester."""
40
 
        self.context = req.store.find(Offering,
41
 
            Offering.subject_id == Subject.id,
42
 
            Subject.short_name == subject,
43
 
            Offering.semester_id == Semester.id,
44
 
            Semester.year == year,
45
 
            Semester.semester == semester).one()
46
 
 
47
 
        if not self.context:
48
 
            raise NotFound()
49
 
 
50
38
    def populate(self, req, ctx):
51
39
        self.plugin_styles[Plugin] = ['groups.css']
52
40
        self.plugin_scripts[Plugin] = ['groups.js']
57
45
    """
58
46
    The Plugin class for the group admin plugin.
59
47
    """
60
 
    urls = [
61
 
        ('/subjects/:subject/:year/:semester/+groups/', GroupsView),
62
 
    ]
 
48
    views = [(Offering, '+groups', GroupsView)]
63
49
 
64
50
    media = 'media'
65
51
    help = {'Groups': 'help.html'}