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

« back to all changes in this revision

Viewing changes to ivle/webapp/admin/subject.py

Merged my changes with those of Will's up-to-date branch.

I will now branch these changes to allow for a merge proposal to go
ahead without me poisoning it with new code.

Show diffs side-by-side

added added

removed removed

Lines of Context:
124
124
        ctx['offering'] = self.context
125
125
        ctx['errors'] = errors
126
126
 
 
127
class SubjectProjectSetView(XHTMLView):
 
128
    """View the ProjectSets for a subject."""
 
129
    template = 'subject_projects.html'
 
130
    permission = 'edit'
 
131
    
 
132
    def __init__(self, req, subject, year, semester):
 
133
        self.context = req.store.find(Offering,
 
134
            Offering.subject_id == Subject.id,
 
135
            Subject.short_name == subject,
 
136
            Offering.semester_id == Semester.id,
 
137
            Semester.year == year,
 
138
            Semester.semester == semester).one()
 
139
 
 
140
        if not self.context:
 
141
            raise NotFound()
 
142
    
 
143
    def populate(self, req, ctx):
 
144
        self.plugin_styles[Plugin] = ["project.css"]
 
145
        ctx['offering'] = self.context
 
146
 
 
147
class ProjectSetView(XHTMLView):
 
148
    """View the submissions for a ProjectSet"""
 
149
    template = 'projectsubmissions.html'
 
150
    permission = 'edit'
127
151
 
128
152
class Plugin(ViewPlugin, MediaPlugin):
129
153
    urls = [
130
154
        ('subjects/', SubjectsView),
131
155
        ('subjects/:subject/:year/:semester/+enrolments/+new', EnrolView),
 
156
        ('subjects/:subject/:year/:semester/+projects', SubjectProjectSetView),
 
157
        #API Views
 
158
        
132
159
    ]
133
160
 
134
161
    tabs = [