summaryrefslogtreecommitdiffstats
path: root/ipa-server/ipa-gui/ipagui/templates/delegatelist.kid
blob: 7faeed4dab146a478067098253f0452ae755bd7f (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
<!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="'delegatelayout.kid'">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" py:replace="''"/>
<title>Delegations</title>
</head>
<body>

<?python
from ipagui.helpers import ipahelper
?>

  <script type="text/javascript" charset="utf-8" src="${tg.url('/static/javascript/tablekit.js')}"></script>

  <script type="text/javascript">
    function editDelegation(acistr) {
      $('edit_acistr').value = acistr;
      $('editform').submit();
      return false;
    }
  </script>

  <form style="display:none" id='editform'
    method="post" action="${tg.url('/delegate/edit')}">
    <input type="hidden" id="edit_acistr" name="acistr" value="" />
  </form>
  <h1>Delegations</h1>

  <table id="resultstable" class="details sortable resizable">
    <thead>
    <tr>
      <th>${fields.name.label}</th>
      <th>${fields.source_group_cn.label}</th>
      <th>${fields.attrs.label}</th>
      <th>${fields.dest_group_cn.label}</th>
    </tr>
    </thead>
    <tbody>
    <tr py:for='aci in aci_list'>
      <?python
      source_cn = group_dn_to_cn.get(aci.source_group)
      dest_cn = group_dn_to_cn.get(aci.dest_group)
      acistr = aci.orig_acistr
      acistr_esc = ipahelper.javascript_string_escape(acistr)
      ?>
      <td>
        <a href="#" onclick="return editDelegation('${acistr_esc}');"
        >${aci.name}</a>
      </td>
      <td>
        <a href="${tg.url('/group/show', cn=source_cn)}"
          >${source_cn}</a>
      </td>
      <td>
        ${", ".join(aci.attrs)}
      </td>
      <td>
        <a href="${tg.url('/group/show', cn=dest_cn)}"
          >${dest_cn}</a>
      </td>
    </tr>
    </tbody>
  </table>

  <table border="0">
    <tbody>
    <tr>
      <td>
        <a href="${tg.url('/delegate/new')}">add new delegation</a><br />
      </td>
    </tr>
    </tbody>
  </table>
</body>
</html>