~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-12-08 03:50:24 UTC
  • mfrom: (1294.2.143 ui-the-third)
  • Revision ID: grantw@unimelb.edu.au-20091208035024-wjx8zp54gth15ph8
Merge ui-the-third. This is another UI revamp.

The header is now thin! Thin! The yellow bar is gone. The tabs are gone.
Breadcrumbs are here. Routes is replaced (with an object publishing
mechanism). Views are less repetitive. etc.

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'}