Revision 57596
Added by Michele Artini over 4 years ago
users.html | ||
---|---|---|
1 | 1 |
<table class="table table-sm table-hover col-sm-12 col-md-10 col-lg-8"> |
2 | 2 |
<thead class="thead-light"> |
3 | 3 |
<tr class="d-flex"> |
4 |
<th class="col-4">User</th>
|
|
5 |
<th class="col-2 text-center">Valid</th>
|
|
6 |
<th class="col-2 text-center">Role</th>
|
|
4 |
<th class="col-5">User</th>
|
|
5 |
<th class="col-1 text-center">Enabled</th>
|
|
6 |
<th class="col-1 text-center">Is admin</th>
|
|
7 | 7 |
<th class="col-3">Countries</th> |
8 |
<th class="col-1"></th>
|
|
8 |
<th class="col-2"></th>
|
|
9 | 9 |
</tr> |
10 | 10 |
</thead> |
11 | 11 |
<tbody> |
12 |
<tr ng-repeat="u in users" class="d-flex"> |
|
13 |
<td class="col-4">{{u.email}}</td> |
|
14 |
<td class="col-2 text-center">{{u.valid}}</td> |
|
15 |
<td class="col-2 text-center">{{u.role}}</td> |
|
16 |
<td class="col-3">{{u.countries}}</td> |
|
17 |
<td class="col-1 text-right"><button type="button" class="btn btn-sm btn-outline-danger"><i class="fa fa-trash"></i></button></td> |
|
12 |
<tr ng-repeat="u in users" class="d-flex" ng-class="{'table-danger' : u.role == 'PENDING'}"> |
|
13 |
<th class="col-5" ng-class="{'text-secondary': !u.valid}">{{u.email}}</th> |
|
14 |
<td class="col-1 text-center text-success"> |
|
15 |
<i class="fa fa-check-circle" ng-if="u.valid"></i> |
|
16 |
</td> |
|
17 |
<td class="col-1 text-center"> |
|
18 |
<i class="fa fa-check-circle" ng-if="u.role == 'SUPERUSER'"></i> |
|
19 |
<span class="text-warning" ng-if="u.role == 'PENDING'">not configured</span> |
|
20 |
</td> |
|
21 |
<td class="col-3"> |
|
22 |
<span ng-if="u.role == 'USER'"> |
|
23 |
<img ng-src="resources/images/flags/{{c}}.gif" title="{{c}}" class="mr-1" ng-repeat="c in u.countries" /> |
|
24 |
<span class="text-warning" ng-if="u.countries.length == 0"><i class="fa fa-exclamation-triangle"></i> no countries</span> |
|
25 |
</span> |
|
26 |
<span class="text-muted" ng-if="u.role == 'SUPERUSER'">All countries</span> |
|
27 |
<span class="text-warning" ng-if="u.role == 'PENDING'">not configured</span> |
|
28 |
|
|
29 |
</td> |
|
30 |
<td class="col-2 text-right"> |
|
31 |
<a href="mailto:{{u.email}}" class="btn btn-sm btn-outline-info"><i class="fa fa-at"></i></a> |
|
32 |
<button type="button" class="btn btn-sm btn-outline-info" data-toggle="modal" data-target="#editUserModal" ng-click="setCurrentUser(u)"><i class="fa fa-edit"></i></button> |
|
33 |
<button type="button" class="btn btn-sm btn-outline-danger" ng-click="deleteUser(u.email)"><i class="fa fa-trash"></i></button> |
|
34 |
</td> |
|
18 | 35 |
</tr> |
19 | 36 |
</tbody> |
20 | 37 |
</table> |
21 | 38 |
|
22 | 39 |
|
40 |
<div class="modal fade" id="editUserModal" tabindex="-1" role="dialog"> |
|
41 |
<div class="modal-dialog modal-xl" role="document"> |
|
42 |
<div class="modal-content"> |
|
43 |
<div class="modal-header"> |
|
44 |
<h5 class="modal-title">Edit user</h5> |
|
45 |
<button type="button" class="close" data-dismiss="modal">×</button> |
|
46 |
</div> |
|
47 |
<div class="modal-body" style="min-height: 300px; max-height: 500px; overflow-y: auto;"> |
|
48 |
<form> |
|
49 |
<div class="form-group row"> |
|
50 |
<label class="col-sm-2 col-form-label">Email</label> |
|
51 |
<div class="col-sm-10"><a href="mailto:{{currentUser.email}}">{{currentUser.email}}</a></div> |
|
52 |
</div> |
|
53 |
<div class="form-group row"> |
|
54 |
<label class="col-sm-2 col-form-label">Enabled</label> |
|
55 |
<div class="col-sm-10"> |
|
56 |
<div class="form-check"> |
|
57 |
<input class="form-check-input" type="checkbox" ng-model="currentUser.valid" /> |
|
58 |
</div> |
|
59 |
</div> |
|
60 |
</div> |
|
61 |
<div class="form-group row" ng-if="currentUser.valid"> |
|
62 |
<label class="col-sm-2 col-form-label">Role</label> |
|
63 |
<div class="col-sm-10"> |
|
64 |
<div class="form-check form-check-inline"> |
|
65 |
<input class="form-check-input" type="radio" value="USER" ng-model="currentUser.role"> |
|
66 |
<label class="form-check-label">USER</label> |
|
67 |
</div> |
|
68 |
<div class="form-check form-check-inline"> |
|
69 |
<input class="form-check-input" type="radio" value="SUPERUSER" ng-model="currentUser.role"> |
|
70 |
<label class="form-check-label">SUPERUSER</label> |
|
71 |
</div> |
|
72 |
</div> |
|
73 |
</div> |
|
74 |
|
|
75 |
<div class="card mb-3" ng-if="currentUser.valid && currentUser.role == 'USER'"> |
|
76 |
<div class="card-header bg-primary text-white py-1">Countries</div> |
|
77 |
<div class="card-body"> |
|
78 |
<div class="form-group row"> |
|
79 |
<div class="col-sm-2" ng-repeat="c in vocs.countries"> |
|
80 |
<div class="form-check form-check-inline"> |
|
81 |
<input class="form-check-input" type="checkbox" checklist-model="currentUser.countries" checklist-value="c"/> |
|
82 |
<label class="form-check-label">{{c}}</label> |
|
83 |
</div> |
|
84 |
</div> |
|
85 |
</div> |
|
86 |
</div> |
|
87 |
</div> |
|
88 |
|
|
89 |
</form> |
|
90 |
</div> |
|
91 |
<div class="modal-footer"> |
|
92 |
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button> |
|
93 |
<button type="button" class="btn btn-primary" data-dismiss="modal" ng-click="saveUser(currentUser)">Save changes</button> |
|
94 |
</div> |
|
95 |
</div> |
|
96 |
</div> |
|
97 |
</div> |
|
23 | 98 |
|
99 |
|
|
100 |
|
|
101 |
|
Also available in: Unified diff
User Registration form