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

« back to all changes in this revision

Viewing changes to ivle/webapp/admin/templates/subjects.html

  • Committer: William Grant
  • Date: 2009-05-26 03:06:53 UTC
  • Revision ID: grantw@unimelb.edu.au-20090526030653-axxawt0o5ws4icbt
Remove ivle.conf usage from ivle.studpath.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
    <title>Subjects</title>
5
5
  </head>
6
6
  <body>
 
7
    <py:def function="offering_url(offering)">/subjects/${offering.subject.short_name}/${offering.semester.year}/${offering.semester.semester}</py:def>
7
8
    <h1>Subjects</h1>
8
9
    <div id="ivle_padding">
9
10
      <p py:if="len(semesters) == 0">You are not currently enrolled in any subjects.</p>
10
 
      <py:for each="(semester, offerings) in semesters">
11
 
        <h2 py:attrs="{'class': 'subject_current' if semester.state == u'current' else None}">
12
 
          ${semester.year}, semester ${semester.semester}
13
 
        </h2>
 
11
      <py:for each="(semester, enrolments) in semesters">
 
12
        <py:choose test="semester.state">
 
13
          <h2 py:when="u'current'">${semester.year}, semester ${semester.semester}</h2>
 
14
          <h3 py:otherwise="">${semester.year}, semester ${semester.semester}</h3>
 
15
        </py:choose>
14
16
        <ul>
15
 
          <li py:for="offering in offerings">
16
 
            <a href="${req.publisher.generate(offering)}">${offering.subject.name}</a>
17
 
          </li>
 
17
          <py:for each="enrolment in enrolments">
 
18
            <li>
 
19
              <a href="${offering_url(enrolment.offering)}/+worksheets">${enrolment.offering.subject.name}</a>
 
20
              <py:if test="'edit' in enrolment.offering.get_permissions(user)">
 
21
                -
 
22
                <a href="${offering_url(enrolment.offering)}/+projects">(administer projects)</a>
 
23
                <a href="${offering_url(enrolment.offering)}/+enrolments/+new">(enrol users)</a>
 
24
              </py:if>
 
25
            </li>
 
26
          </py:for>
18
27
        </ul>
19
28
      </py:for>
20
 
      <py:if test="defined('subjects')">
21
 
        <h1>All subjects</h1>
22
 
        <table class="pretty_table">
23
 
          <thead><tr><th>Subject</th><th>Code</th><th>Actions</th></tr></thead>
24
 
          <tbody>
25
 
            <tr py:for="subject in subjects">
26
 
              <td>${subject.name}</td>
27
 
              <td>${subject.code}</td>
28
 
              <td>
29
 
                <a href="${req.publisher.generate(subject, SubjectEdit)}" title="Edit"><img src="${mediapath + 'interface/pencil.png'}" alt="Edit" /></a>
30
 
              </td>
31
 
            </tr>
32
 
          </tbody>
33
 
        </table>
34
 
        <p>
35
 
          <a class="addaction" href="/subjects/+new">Create new subject</a>
36
 
          <a class="addaction" href="/subjects/+new-offering">Create new offering</a>
37
 
        </p>
38
 
      </py:if>
39
29
    </div>
40
30
  </body>
41
31
</html>