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

« back to all changes in this revision

Viewing changes to www/apps/groups/__init__.py

  • Committer: William Grant
  • Date: 2009-01-19 00:52:31 UTC
  • mto: This revision was merged to the branch mainline in revision 1090.
  • Revision ID: grantw@unimelb.edu.au-20090119005231-c14s3smfoftzfpfo
www/apps/groups: Port show_groupadmin_panel to Storm.

Show diffs side-by-side

added added

removed removed

Lines of Context:
52
52
            show_subject_panel(req, db, enrolment.offering.id,
53
53
                enrolment.offering.subject.name)
54
54
        if req.user.hasCap(caps.CAP_MANAGEGROUPS):
55
 
            show_groupadmin_panel(req, db)
 
55
            show_groupadmin_panel(req)
56
56
        
57
57
        req.write("</div>\n")
58
58
    finally:
59
59
        db.close()
60
60
 
61
 
def show_groupadmin_panel(req, db):
 
61
def show_groupadmin_panel(req):
62
62
    """
63
63
    Shows the group admin panel
64
64
    """
65
65
    req.write("<hr/>\n")
66
66
    req.write("<h1>Group Administration</h1>")
67
67
    # Choose subject
68
 
    subjects = db.get_subjects()
 
68
    subjects = req.store.find(Subject)
69
69
    req.write("<label for=\"subject_select\">Subject:</label>\n")
70
70
    req.write("<select id=\"subject_select\">\n")
71
71
    for s in subjects:
72
72
        req.write("    <option value=\"%d\">%s (%s)</option>\n"%
73
 
            (s['subjectid'], s['subj_name'], s['subj_code']))
 
73
            (s.id, s.name, s.code))
74
74
    req.write("</select>\n")
75
75
    req.write("<input type=\"button\" value=\"Manage\" \
76
76
        onclick=\"manage_subject()\" />\n")