Project

General

Profile

1
<div class="well" ng-app="usersUI" ng-controller="usersCtrl">
2
	<div>
3
		<form class="form-inline" role="form" ng-submit="addUser(newUser)">
4
			<div class="form-group">
5
				<label class="sr-only" for="userAdd">new user</label>
6
				<input id="userAdd" class="form-control" type="text" placeholder="new user" ng-model="newUser">
7
			</div>
8
			<button class="btn btn-default" type="submit">
9
				<span class="glyphicon glyphicon-plus"></span>
10
			</button>
11
			<button class="btn btn-primary" ng-click="saveUsers()" type="button">
12
				<span class="glyphicon glyphicon-save"></span> save
13
			</button>
14
		</form>
15
		{{newUser}}
16
	</div>
17
	<br />
18
	<table class="table table-condensed">
19
		<thead>
20
			<tr>
21
				<th>#</th>
22
				<th>User</th>
23
				#foreach($l in $availableLevels)
24
					<th class="text-center" title="$l.details">$l.label</th>
25
				#end
26
				<th></th>
27
			</tr>
28
		</thead>
29
		<tbody>
30
			<tr ng-repeat="user in users">
31
				<td>{{\$index + 1}}</td>
32
				<td><b>{{user.id}}</b></td>
33
				#foreach($l in $availableLevels)
34
					<td class="text-center"><input type="checkbox" ng-checked="user.permissionLevels.indexOf('$l.level') >= 0" ng-click="updateUser(\$index, '$l.level', \$event.target.checked)"></td>
35
				#end
36
				<td class="text-right">
37
					<button class="btn btn-danger btn-xs" ng-click="dropUser(\$index)" type="button">
38
						<span class="glyphicon glyphicon-minus"></span>
39
					</button>
40
				</td>
41
			</tr>
42
		</tbody>
43
	</table>
44
</div>
(1-1/2)