diff options
author | Kevin McCarthy <kmccarth@redhat.com> | 2007-10-15 16:21:10 -0700 |
---|---|---|
committer | Kevin McCarthy <kmccarth@redhat.com> | 2007-10-15 16:21:10 -0700 |
commit | 1592229c3c4bb53106cf35371fad5cd03ae76759 (patch) | |
tree | 2249f610000a25b4de94c57a0f0c845f921a055a /ipa-server | |
parent | 60e78feebade26722701860570676d38da3fa36f (diff) | |
download | freeipa-1592229c3c4bb53106cf35371fad5cd03ae76759.tar.gz freeipa-1592229c3c4bb53106cf35371fad5cd03ae76759.tar.xz freeipa-1592229c3c4bb53106cf35371fad5cd03ae76759.zip |
Fixes to acilist: make use POST, use field labels.
Diffstat (limited to 'ipa-server')
4 files changed, 33 insertions, 19 deletions
diff --git a/ipa-server/ipa-gui/ipagui/forms/delegate.py b/ipa-server/ipa-gui/ipagui/forms/delegate.py index 0d418eabc..c25d6c0cb 100644 --- a/ipa-server/ipa-gui/ipagui/forms/delegate.py +++ b/ipa-server/ipa-gui/ipagui/forms/delegate.py @@ -44,7 +44,7 @@ aci_checkbox_attrs = [(field.name, field.label) for field in aci_attrs] aci_name_to_label = dict(aci_checkbox_attrs) 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") dest_group_dn = widgets.HiddenField(name="dest_group_dn") diff --git a/ipa-server/ipa-gui/ipagui/subcontrollers/delegation.py b/ipa-server/ipa-gui/ipagui/subcontrollers/delegation.py index 32f7c8c31..3f9752345 100644 --- a/ipa-server/ipa-gui/ipagui/subcontrollers/delegation.py +++ b/ipa-server/ipa-gui/ipagui/subcontrollers/delegation.py @@ -193,7 +193,8 @@ class DelegationController(IPAController): ipagui.forms.delegate.aci_name_to_label.get(name, name), 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") @identity.require(identity.not_anonymous()) diff --git a/ipa-server/ipa-gui/ipagui/templates/delegateform.kid b/ipa-server/ipa-gui/ipagui/templates/delegateform.kid index ee40648fa..e414e4443 100644 --- a/ipa-server/ipa-gui/ipagui/templates/delegateform.kid +++ b/ipa-server/ipa-gui/ipagui/templates/delegateform.kid @@ -52,12 +52,12 @@ <th> <input type="submit" class="submitbutton" name="submit" value="${actionname} Delegation"/> - <br /> + <br/><br/> </th> <td> <input type="submit" class="submitbutton" name="submit" value="Cancel ${actionname}"/> - <br /> + <br/><br/> </td> </tr> </table> @@ -150,10 +150,12 @@ <table class="formtable" cellpadding="2" cellspacing="0" border="0"> <tr> <th> + <br/> <input type="submit" class="submitbutton" name="submit" value="${actionname} Delegation"/> </th> <td> + <br/> <input type="submit" class="submitbutton" name="submit" value="Cancel ${actionname}"/> </td> diff --git a/ipa-server/ipa-gui/ipagui/templates/delegatelist.kid b/ipa-server/ipa-gui/ipagui/templates/delegatelist.kid index 7e3374252..99bd1bb49 100644 --- a/ipa-server/ipa-gui/ipagui/templates/delegatelist.kid +++ b/ipa-server/ipa-gui/ipagui/templates/delegatelist.kid @@ -6,18 +6,35 @@ <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> + <h2>Delegations</h2> <table id="resultstable" class="sortable resizable"> <thead> <tr> - <th>Name</th> - <th>People in Group</th> - <th>Can Modify</th> - <th>For People in Group</th> - <th>Action</th> + <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> @@ -25,9 +42,12 @@ <?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> - ${aci.name} + <a href="#" onclick="return editDelegation('${acistr_esc}');" + >${aci.name}</a> </td> <td> <a href="${tg.url('/group/show', cn=source_cn)}" @@ -40,15 +60,6 @@ <a href="${tg.url('/group/show', cn=dest_cn)}" >${dest_cn}</a> </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> </tbody> </table> |