blob: 8d9c6de0782a144a36116e9de1372ab0d06e0f3e (
plain) (
tree)
|
|
<h2>{{lang_userlist}}</h2>
{{{pagenav}}}
<form method="get">
<input type="hidden" name="do" value="adduser">
<input type="hidden" name="show" value="edituser">
<table class="table">
<thead>
<tr>
<th>{{lang_login}}</th>
<th>{{lang_name}}</th>
<th>{{lang_phone}}</th>
<th>{{lang_email}}</th>
<th width="1"></th>
</tr>
</thead>
<tbody>
{{#list}}
<tr>
<td id="user-{{userid}}">{{login}}</td>
<td>{{fullname}}</td>
<td>{{phone}}</td>
<td>{{email}}</td>
<td class="text-nowrap">
<button class="btn btn-primary btn-xs" {{perms.user.edit.disabled}} type="submit" name="userid" value="{{userid}}">
<span class="glyphicon glyphicon-edit"></span>
</button>
{{^hide_delete}}
<button type="button" {{perms.user.remove.disabled}} class="btn btn-danger btn-xs del-user-btn"
data-target="#delete-modal" data-toggle="modal" data-user="{{userid}}">
<span class="glyphicon glyphicon-trash"></span>
</button>
{{/hide_delete}}
</td>
</tr>
{{/list}}
</tbody>
</table>
<div class="text-right">
<a class="btn btn-success {{perms.user.add.disabled}}" href="?do=adduser&show=adduser">
<span class="glyphicon glyphicon-plus"></span>
{{lang_addUser}}
</a>
</div>
</form>
<script>
document.addEventListener('DOMContentLoaded', function() {
$('.del-user-btn').click(function (e) {
var uid = $(this).data('user');
if (!uid) {
alert('ERROR');
return false;
}
$('#delete-userid').val(uid);
$('#delete-user-field').text($('#user-' + uid).text());
});
});
</script>
<!-- Modals -->
<div class ="modal fade" id="delete-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<form method="post">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="myModalLabel">{{lang_confirmDelete}}: <span id="delete-user-field"></span></h4>
</div>
<div class="modal-body">
<p>{{lang_userDeleteConfirm}}</p>
</div>
<div class="modal-footer">
<input type="hidden" name="action" value="deleteuser">
<input type="hidden" name="token" value="{{token}}">
<button type="button" class="btn btn-default" data-dismiss="modal">{{lang_cancel}}</button>
<button type="submit" id="delete-userid" name="userid" value="" class="btn btn-danger">
<span class="glyphicon glyphicon-trash"></span>
{{lang_delete}}
</button>
</div>
</form>
</div>
</div>
</div>
|