freeipa/ipa-server/ipa-gui/ipagui/templates/groupnewform.kid
2007-11-01 16:15:32 -04:00

129 lines
3.5 KiB
Genshi

<div xmlns:py="http://purl.org/kid/ns#"
class="simpleroster">
<form action="${action}" name="${name}" method="${method}" class="tableform"
onsubmit="preSubmit()" >
<input type="submit" class="submitbutton" name="submit" value="Add Group"/>
<?python
from ipagui.helpers import ipahelper
?>
<script type="text/javascript" charset="utf-8"
src="${tg.url('/static/javascript/dynamicedit.js')}"></script>
<?python searchurl = tg.url('/group/edit_search') ?>
<script type="text/javascript">
function doSearch() {
$('searchresults').update("Searching...");
new Ajax.Updater('searchresults',
'${searchurl}',
{ asynchronous:true,
parameters: { criteria: $('criteria').value },
evalScripts: true });
return false;
}
</script>
<div py:for="field in hidden_fields"
py:replace="field.display(value_for(field), **params_for(field))"
/>
<h2 class="formsection">Group Details</h2>
<table class="formtable" cellpadding="2" cellspacing="0" border="0">
<tr>
<th>
<label class="fieldlabel" for="${group_fields.cn.field_id}"
py:content="group_fields.cn.label" />:
</th>
<td>
<span py:replace="group_fields.cn.display(value_for(group_fields.cn))" />
<span py:if="tg.errors.get('cn')" class="fielderror"
py:content="tg.errors.get('cn')" />
</td>
</tr>
<tr>
<th>
<label class="fieldlabel" for="${group_fields.description.field_id}"
py:content="group_fields.description.label" />:
</th>
<td>
<span py:replace="group_fields.description.display(value_for(group_fields.description))" />
<span py:if="tg.errors.get('description')" class="fielderror"
py:content="tg.errors.get('description')" />
</td>
</tr>
<tr>
<th>
<label class="fieldlabel" for="${group_fields.gidnumber.field_id}"
py:content="group_fields.gidnumber.label" />:
</th>
<td>
Generated by server
</td>
</tr>
</table>
<div style="clear:both">
<h2 class="formsection">Add Members</h2>
<div class="floatlist">
<div class="floatheader">To Add:</div>
<div id="newmembers">
</div>
</div>
<div>
<div id="search">
<input id="criteria" type="text" name="criteria"
onkeypress="return enterDoSearch(event);" />
<input type="button" value="Find"
onclick="return doSearch();"
/>
</div>
<div id="searchresults">
</div>
</div>
</div>
<hr />
<input type="submit" class="submitbutton" name="submit" value="Add Group"/>
</form>
<script type="text/javascript">
/*
* This section restores the contents of the add and remove lists
* dynamically if we have to refresh the page
*/
if ($('form_dn_to_info_json').value != "") {
dn_to_info_hash = new Hash($('form_dn_to_info_json').value.evalJSON());
}
</script>
<?python
dnadds = value.get('dnadd', [])
if not(isinstance(dnadds,list) or isinstance(dnadds,tuple)):
dnadds = [dnadds]
?>
<script py:for="dnadd in dnadds">
<?python
dnadd_esc = ipahelper.javascript_string_escape(dnadd)
?>
var dn = "${dnadd_esc}";
var info = dn_to_info_hash[dn];
var newdiv = addmember(dn, info);
if (newdiv != null) {
newdiv.style.display = 'block';
}
</script>
</div>