summaryrefslogtreecommitdiffstats
path: root/ipa-server/ipa-gui/ipagui/templates/groupshow.kid
blob: f0d1ddfbb0947ff7239181afcd33127ce44ff8ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:py="http://purl.org/kid/ns#"
    py:extends="'grouplayout.kid'">
<head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type" py:replace="''"/>
    <title>View Group</title>
</head>
<body>
<?python
edit_url = tg.url('/group/edit', cn=group.get('cn')[0])
?>
<div id="details">
    <h1>View Group</h1>

    <input class="submitbutton" type="button"
      onclick="document.location.href='${edit_url}'"
      value="Edit Group" />

    <h2 class="formsection">Group Details</h2>
    <table class="formtable" cellpadding="2" cellspacing="0" border="0">
        <tr>
          <th>
            <label class="fieldlabel" py:content="fields.cn.label" />:
          </th>
          <td>
          <table cellpadding="2" cellspacing="0" border="0">
            <tbody>
              <?python
                index = 0
                values = group.get("cn")      
                if isinstance(values, str):
                    values = [values]
               ?>
              <tr py:for="index in range(len(values))">
              <td>${values[index]}</td>
              </tr>
            </tbody>
          </table>
          </td>
        </tr>

        <tr>
          <th>
            <label class="fieldlabel" py:content="fields.description.label" />:
          </th>
          <td>${group.get("description")}</td>
        </tr>

        <tr>
          <th>
            <label class="fieldlabel" py:content="fields.gidnumber.label" />:
          </th>
          <td>${group.get("gidnumber")}</td>
        </tr>
    </table>

    <h2 class="formsection">Group Members</h2>
    <div py:for="member in members">
      <?python

      member_uid = member.get('uid')
      if member_uid:
          member_cn = "%s %s" % (member.get('givenName', ''), member.get('sn', ''))
          member_desc = "(%s)" % member_uid
          member_type = "user"
          view_url = tg.url('/user/show', uid=member_uid)
      else:
          member_cn = "%s" % member.get('cn')[0]
          member_desc = "[group]"
          member_type = "group"
          view_url = tg.url('/group/show', cn=member_cn)
      ?>
      <span py:if='member_type == "user"'>
        <a href="${view_url}"
          >${member_cn}</a> ${member_desc}
      </span>
      <span py:if='member_type == "group"'>
        <i>
          <a href="${view_url}"
            >${member_cn}</a> ${member_desc}
        </i>
      </span>
    </div>

    <br/>
<hr />
    <input class="submitbutton" type="button"
      onclick="document.location.href='${edit_url}'"
      value="Edit Group" />
</div>
</body>
</html>