mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2024-12-28 18:01:23 -06:00
Fixes to acilist: make use POST, use field labels.
This commit is contained in:
parent
60e78feeba
commit
1592229c3c
@ -44,7 +44,7 @@ aci_checkbox_attrs = [(field.name, field.label) for field in aci_attrs]
|
|||||||
aci_name_to_label = dict(aci_checkbox_attrs)
|
aci_name_to_label = dict(aci_checkbox_attrs)
|
||||||
|
|
||||||
class DelegateFields():
|
class DelegateFields():
|
||||||
name = widgets.TextField(name="name", label="ACI Name")
|
name = widgets.TextField(name="name", label="Name")
|
||||||
|
|
||||||
source_group_dn = widgets.HiddenField(name="source_group_dn")
|
source_group_dn = widgets.HiddenField(name="source_group_dn")
|
||||||
dest_group_dn = widgets.HiddenField(name="dest_group_dn")
|
dest_group_dn = widgets.HiddenField(name="dest_group_dn")
|
||||||
|
@ -193,7 +193,8 @@ class DelegationController(IPAController):
|
|||||||
ipagui.forms.delegate.aci_name_to_label.get(name, name),
|
ipagui.forms.delegate.aci_name_to_label.get(name, name),
|
||||||
aci.attrs)
|
aci.attrs)
|
||||||
|
|
||||||
return dict(aci_list=aci_list, group_dn_to_cn=group_dn_to_cn)
|
return dict(aci_list=aci_list, group_dn_to_cn=group_dn_to_cn,
|
||||||
|
fields=ipagui.forms.delegate.DelegateFields())
|
||||||
|
|
||||||
@expose("ipagui.templates.delegategroupsearch")
|
@expose("ipagui.templates.delegategroupsearch")
|
||||||
@identity.require(identity.not_anonymous())
|
@identity.require(identity.not_anonymous())
|
||||||
|
@ -52,12 +52,12 @@
|
|||||||
<th>
|
<th>
|
||||||
<input type="submit" class="submitbutton" name="submit"
|
<input type="submit" class="submitbutton" name="submit"
|
||||||
value="${actionname} Delegation"/>
|
value="${actionname} Delegation"/>
|
||||||
<br />
|
<br/><br/>
|
||||||
</th>
|
</th>
|
||||||
<td>
|
<td>
|
||||||
<input type="submit" class="submitbutton" name="submit"
|
<input type="submit" class="submitbutton" name="submit"
|
||||||
value="Cancel ${actionname}"/>
|
value="Cancel ${actionname}"/>
|
||||||
<br />
|
<br/><br/>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
@ -150,10 +150,12 @@
|
|||||||
<table class="formtable" cellpadding="2" cellspacing="0" border="0">
|
<table class="formtable" cellpadding="2" cellspacing="0" border="0">
|
||||||
<tr>
|
<tr>
|
||||||
<th>
|
<th>
|
||||||
|
<br/>
|
||||||
<input type="submit" class="submitbutton" name="submit"
|
<input type="submit" class="submitbutton" name="submit"
|
||||||
value="${actionname} Delegation"/>
|
value="${actionname} Delegation"/>
|
||||||
</th>
|
</th>
|
||||||
<td>
|
<td>
|
||||||
|
<br/>
|
||||||
<input type="submit" class="submitbutton" name="submit"
|
<input type="submit" class="submitbutton" name="submit"
|
||||||
value="Cancel ${actionname}"/>
|
value="Cancel ${actionname}"/>
|
||||||
</td>
|
</td>
|
||||||
|
@ -6,18 +6,35 @@
|
|||||||
<title>Delegations</title>
|
<title>Delegations</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<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" 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>
|
||||||
|
|
||||||
<h2>Delegations</h2>
|
<h2>Delegations</h2>
|
||||||
|
|
||||||
<table id="resultstable" class="sortable resizable">
|
<table id="resultstable" class="sortable resizable">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Name</th>
|
<th>${fields.name.label}</th>
|
||||||
<th>People in Group</th>
|
<th>${fields.source_group_cn.label}</th>
|
||||||
<th>Can Modify</th>
|
<th>${fields.attrs.label}</th>
|
||||||
<th>For People in Group</th>
|
<th>${fields.dest_group_cn.label}</th>
|
||||||
<th>Action</th>
|
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@ -25,9 +42,12 @@
|
|||||||
<?python
|
<?python
|
||||||
source_cn = group_dn_to_cn.get(aci.source_group)
|
source_cn = group_dn_to_cn.get(aci.source_group)
|
||||||
dest_cn = group_dn_to_cn.get(aci.dest_group)
|
dest_cn = group_dn_to_cn.get(aci.dest_group)
|
||||||
|
acistr = aci.orig_acistr
|
||||||
|
acistr_esc = ipahelper.javascript_string_escape(acistr)
|
||||||
?>
|
?>
|
||||||
<td>
|
<td>
|
||||||
${aci.name}
|
<a href="#" onclick="return editDelegation('${acistr_esc}');"
|
||||||
|
>${aci.name}</a>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<a href="${tg.url('/group/show', cn=source_cn)}"
|
<a href="${tg.url('/group/show', cn=source_cn)}"
|
||||||
@ -40,15 +60,6 @@
|
|||||||
<a href="${tg.url('/group/show', cn=dest_cn)}"
|
<a href="${tg.url('/group/show', cn=dest_cn)}"
|
||||||
>${dest_cn}</a>
|
>${dest_cn}</a>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
|
||||||
<?python
|
|
||||||
# it's probably a bad idea to use a GET string here.
|
|
||||||
# orig_acistr may be quite long
|
|
||||||
# TODO - change to use a form/POST
|
|
||||||
#
|
|
||||||
?>
|
|
||||||
<a href="${tg.url('/delegate/edit', acistr=aci.orig_acistr)}">edit</a><br />
|
|
||||||
</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
Loading…
Reference in New Issue
Block a user