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

« back to all changes in this revision

Viewing changes to ivle/webapp/groups/template.html

ivle.webapp.groups: Remove most of the view code; the template now accesses
    the objects directly. Also fix a few double-encodings and typos.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
<html xmlns="http://www.w3.org/1999/xhtml"
2
2
      xmlns:py="http://genshi.edgewall.org/">
3
3
  <head>
4
 
    <title>Groupz</title>
 
4
    <title>Groups</title>
5
5
  </head>
6
6
  <body>
7
7
    <div id="ivle_padding">
8
 
      <p py:if="no_enrolments">Error: You are not currently enrolled in any subjects.</p>
 
8
      <p py:if="not enrolments">Error: You are not currently enrolled in any subjects.</p>
9
9
      <py:for each="enrolment in enrolments">
10
 
        <div id="subject${enrolment.offering_id}" class="subject">
11
 
          <h1>${enrolment.offering_name}</h1>
12
 
          <py:for each="group in enrolment['groups']">
13
 
            <h2>${group['nick']} (${group['name']})</h2>
14
 
            <py:choose test="group['is_member']">
15
 
              <py:when test="True">
 
10
        <div id="subject${enrolment.offering.id}" class="subject">
 
11
          <h1>${enrolment.offering.subject.name}</h1>
 
12
          <py:for each="group in get_user_groups(enrolment.offering)">
 
13
            <h2>${group.nick} (${group.name})</h2>
 
14
            <!-- Need proper test (for invite/membership). -->
 
15
            <!-- <py:choose test="group">
 
16
              <py:when test="True"> -->
16
17
                <p>You are a member of this group.</p>
17
 
              </py:when>
 
18
              <!--</py:when>
18
19
              <py:otherwise>
19
20
                <p>You have been invited to this group.</p>
20
21
                <p>
21
22
                  <input type="button" 
22
 
                      onclick="accept(&quot;${group['name']}&quot;)" 
 
23
                      onclick="accept(&quot;${group.name}&quot;)" 
23
24
                      value="Accept" />
24
25
                  <input type="button"
25
 
                      onclick="decline(&quot;${group['name']}&quot;)"
 
26
                      onclick="decline(&quot;${group.name}&quot;)"
26
27
                      value="Decline" />
27
28
                </p>
28
29
              </py:otherwise>
29
 
            </py:choose>
 
30
            </py:choose>-->
30
31
            <h3>Members</h3>
31
32
            <ul>
32
 
              <py:for each="member in group['members']">
33
 
                <li>${member['fullname']} (${member['login']})</li>
 
33
              <py:for each="member in group.members">
 
34
                <li>${member.fullname} (${member.login})</li>
34
35
              </py:for>
35
36
            </ul>
36
37
          </py:for>
37
38
        </div>
38
39
      </py:for>
39
 
      <py:if test="manage_groups">
 
40
      <py:if test="manage_subjects">
40
41
        <hr />
41
42
        <h1>Group Administration</h1>
42
43
        <label for="subject_select">Subject:</label>
43
44
        <select id="subject_select">
44
45
          <py:for each="subject in manage_subjects">
45
 
            <option value="${subject['id']}">${subject['name']} (${subject['code']})</option>
 
46
            <option value="${subject.id}">${subject.name} (${subject.code})</option>
46
47
          </py:for>
47
48
        </select>
48
49
        <input type="button" value="Manage" onclick="manage_subject()" />