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

« back to all changes in this revision

Viewing changes to www/apps/subjects/toplevel_menu.html

ivle.webapp.testing: Add, with fake request and user.
ivle.webapp.base.test: Add! Test the JSONRESTView, using the new mocks.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
<html xmlns="http://www.w3.org/1999/xhtml"
2
 
      xmlns:py="http://genshi.edgewall.org/">
3
 
  <head>
4
 
    <title>Subjects</title>
5
 
  </head>
6
 
  <body>
7
 
    <py:def function="offering_url(offering)">/subjects/${offering.subject.short_name}/${offering.semester.year}/${offering.semester.semester}</py:def>
8
 
    <h1>Subjects</h1>
 
2
      xmlns:xi="http://www.w3.org/2001/XInclude"
 
3
      xmlns:py="http://genshi.edgewall.org/" py:strip="">
 
4
 
 
5
  <body py:strip="">
9
6
    <div id="ivle_padding">
10
 
      <p py:if="len(semesters) == 0">You are not currently enrolled in any subjects.</p>
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>
16
 
        <ul>
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)}/+groups">(administer groups)</a>
23
 
                <a href="${offering_url(enrolment.offering)}/+enrolments/+new">(enrol users)</a>
24
 
              </py:if>
25
 
            </li>
26
 
          </py:for>
27
 
        </ul>
28
 
      </py:for>
 
7
      <h2>IVLE Subject Homepages</h2>
 
8
      <py:if test="(len(enrolled_subjects) > 0)">
 
9
        <h2>Subjects</h2>
 
10
        <ul>
 
11
          <py:for each="subject in enrolled_subjects">
 
12
            <py:choose test="subject['url']">
 
13
              <py:when test="None">
 
14
                <li>${subject['name']} (no home page)</li>
 
15
              </py:when>
 
16
              <py:otherwise>
 
17
                <li><a href="${subject['url']}">${subject['name']}</a></li>
 
18
              </py:otherwise>
 
19
            </py:choose>
 
20
          </py:for>
 
21
        </ul>
 
22
      </py:if>
 
23
      <py:if test="(len(other_subjects) > 0)">
 
24
        <h3>Other Subjects</h3>
 
25
        <p>You are not currently enrolled in these subjects</p>
 
26
        <ul>
 
27
          <py:for each="subject in other_subjects">
 
28
            <py:choose test="subject['url']">
 
29
             <py:when test="None">
 
30
               <li>${subject['name']} (no home page)</li>
 
31
             </py:when>
 
32
             <py:otherwise>
 
33
               <li><a href="${subject['url']}">${subject['name']}</a></li>
 
34
             </py:otherwise>
 
35
            </py:choose>
 
36
          </py:for>
 
37
        </ul>
 
38
      </py:if>
29
39
    </div>
30
40
  </body>
31
41
</html>