You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
haproxy-wi/app/templates/ajax/new_user.html

76 lines
2.5 KiB

{% for user in users %}
<tr id="user-{{user.0}}" class="newuser">
<td class="padding10 first-collumn">
<input type="text" id="login-{{user.0}}" value="{{user.1}}" class="form-control">
</td>
<td>
{% if user.6 != 1%}
<span title="Change password" style="cursor: pointer">
<img src="/inc/images/edit.png" alt="Edit" width="15" style="margin-bottom: -3px; padding-left: 15px;" onclick="openChangeUserPasswordDialog('{{user.0}}')" />
</span>
{% endif %}
</td>
<td class="checkbox">
{% if user.7 == 1 %}
<label for="activeuser-{{user.0}}"></label><input type="checkbox" id="activeuser-{{user.0}}" checked>
{% else %}
<label for="activeuser-{{user.0}}"></label><input type="checkbox" id="activeuser-{{user.0}}">
{% endif %}
</td>
<td>
<input type="text" id="email-{{user.0}}" value="{{user.2}}" class="form-control">
</td>
<td>
<select id="role-{{user.0}}" name="role-{{user.0}}">
<option disabled selected>Choose role</option>
{% for role in roles %}
{% if user.4 == role.1 %}
<option value="{{ role.1 }}" selected>{{ role.1 }}</option>
{% else %}
<option value="{{ role.1 }}">{{ role.1 }}</option>
{% endif %}
{% endfor %}
</select>
</td>
{% if page != "servers.py" %}
{% if page != "servers.py#users" %}
<td>
<select id="usergroup-{{user.0}}" name="usergroup-{{user.0}}">
<option disabled selected>Choose group</option>
{% for group in groups %}
{% if user.5 == group.0|string() %}
<option value="{{ group.0 }}" selected>{{ group.1 }}</option>
{% else %}
<option value="{{ group.0 }}">{{ group.1 }}</option>
{% endif %}
{% endfor %}
</select>
</td>
{% endif %}
{% endif %}
<td>
<a class="add" onclick="cloneUser({{user.0}})" id="clone-{{user.0}}" title="Clone {{user.1}}" style="cursor: pointer;"></a>
</td>
<td><a class="delete" onclick="removeUser({{user.0}})" style="cursor: pointer;"></a></td>
</tr>
<script>
$( function() {
$("#role-{{user.0}}" ).selectmenu({
width: 100
});
$("#usergroup-{{user.0}}" ).selectmenu({
width: 100
});
});
</script>
{% endfor %}
<script>
$( "#ajax-users input" ).change(function() {
var id = $(this).attr('id').split('-');
updateUser(id[1])
});
$( "#ajax-users select" ).on('selectmenuchange',function() {
var id = $(this).attr('id').split('-');
updateUser(id[1])
});
</script>