Commit 20c0a351 by wolf

Add user search in group settings

	modified:   Manager/Manager/templates/edit_group.html
parent 022fc6f6
{% extends "structure_group.html" %}
{% block body %}
<TABLE class='GroupForm'>
<script type="text/javascript">
function userChange () {
var searchedID = document.getElementById("ID").value.toLowerCase();
var rows = document.getElementsByClassName("userRow"); //get all row of the table
for(var i =0;i<rows.length;i++){ //for each row
row = rows[i];
row.style.display = "none";
cells = row.getElementsByTagName('td');
id = cells[1].innerHTML.toLowerCase()
if (id.indexOf(searchedID)!=-1){
row.style.display = null;
}
}
}
</script>
<TABLE class='GroupForm'>
<form action="{{ url_for('edit_group',id=id) }}" method=post>
{{ form.hidden_tag() }}
<TR>
......@@ -9,16 +29,30 @@
<TD></TD>
</TR>
<TR>
<TD style="text-align:left;">
<label for="id">Identifiant : </label>
</TD>
<TD>
<!-- <div class='UserSearchForm'> -->
<input style="width:100%" type="text" value="" name="id" id="ID" onkeyup="userChange()";>
<!-- </div> -->
</TD>
</TR>
<TR>
<TD class="userSelectionLabel">Utilisateurs : </TD>
<TD class="userSelectionElement">
<TABLE>
{%for u in form.users%}
{{u}}
{{u.label}}
<a href="{{url_for('edit_user',id=u.object_data.__str__().split(",")[0].replace("cn=",""))}}">[Edit]</a>
<br>
<TR class="userRow">
<TD> {{u}} </TD>
<TD> {{u.label}} </TD>
<TD> <a href="{{url_for('edit_user',id=u.object_data.__str__().split(",")[0].replace("cn=",""))}}">[Edit]</a></TD>
</TR>
{% endfor %}
</TABLE>
</TD>
<TD class=error>{% if form.errors.users%} {{form.errors.users[0]}} {%endif%}</TD>
</TR>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment