blob: 8d9c6de0782a144a36116e9de1372ab0d06e0f3e (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
|
<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>
|