-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathuser.html
135 lines (126 loc) · 3.88 KB
/
user.html
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
<div class="container">
<h1>
User's list:
</h1>
<a href="#/register">
Go to registration page
</a>
<table class="table table-hover">
<tr>
<td class="col-md-2">
<b>Login</b>
</td>
<td class="col-md-2">
<b>Full name</b>
</td>
<td class="col-md-2">
<b>E-mail address</b>
</td>
<td class="col-md-2">
<b>Roles</b>
</td>
<td class="col-md-2">
</td>
<td class="col-md-2">
</td>
<td class="col-md-1">
</td>
</tr>
<tr ng-repeat="user in Users track by $index" id="id-{{$index}}">
<td ng-show="!user.editing" class="col-md-1">
{{user.login}}
</td>
<td ng-show="!user.editing" class="col-md-1">
{{user.full}}
</td>
<td ng-show="!user.editing" class="col-md-1">
{{user.mail}}
</td>
<td ng-show="!user.editing" class="col-md-2">
{{user.role.join(', ')}}
</td>
<td ng-show="!user.editing" class="col-md-1">
<button class="btn btn-success" ng-click="Edit($index)">
Edit
</button>
</td>
<td ng-show="!user.editing" class="col-md-1">
<button class="btn btn-danger" ng-click="Delete($index)">
Delete
</button>
</td>
<td ng-show="!user.editing" class="col-md-1">
</td>
<!--USER EDITING BELOW-->
<td ng-show="user.editing" class="col-md-1">
<input placeholder="Login" class="form-control" ng-model="Users[$index].login" value="user.login">
</td>
<td ng-show="user.editing" class="col-md-1">
<input placeholder="Full name" class="form-control" ng-model="Users[$index].full" value="user.full">
</td>
<td ng-show="user.editing" class="col-md-1">
<input placeholder="Email" class="form-control" ng-model="Users[$index].mail" value="user.mail">
</td>
<td ng-show="user.editing" class="col-md-2">
<ui-select id="role-{{$index}}" multiple tagging tagging-label="false" ng-model="Users[$index].role" theme="bootstrap" ng-disabled="disabled" class="col-md-12">
<ui-select-match placeholder="Select roles...">
{{$item}}
</ui-select-match>
<ui-select-choices repeat="role in roles | filter:$select.search">
{{role}}
</ui-select-choices>
</ui-select>
</td>
<td ng-show="user.editing" class="col-md-1">
<button ng-click="Save($index)" class="btn btn-success">
Save
</button>
</td>
<td ng-show="user.editing" class="col-md-1">
</td>
<td ng-show="user.editing" class="col-md-1">
</td>
</tr>
<tr ng-show="registring">
<td class="col-md-1">
<input class="form-control col-md-12" ng-model="userCreation.login" placeholder="Login">
</td>
<td class="col-md-1">
<input class="form-control" ng-model="userCreation.full" placeholder="Full name">
</td>
<td class="col-md-1">
<input class="form-control" ng-model="userCreation.mail" placeholder="E-mail">
</td>
<td class="col-md-2">
<ui-select multiple tagging tagging-label="false" id="role_input" ng-model="userCreation.role" theme="bootstrap" ng-disabled="disabled">
<ui-select-match placeholder="Select roles...">
{{$item}}
</ui-select-match>
<ui-select-choices repeat="role in roles | filter:$select.search">
{{role}}
</ui-select-choices>
</ui-select>
</td>
<td class="col-md-1">
<input class="form-control col-md-12" type="password" ng-model="userCreation.password" placeholder="Password">
</td>
<td class="col-md-1">
<input class="form-control col-md-12" type="password" ng-model="userCreation.passwordConfirm" placeholder="Password again">
</td>
<td class="col-md-1">
<button type="button" ng-click="AddToArray()" class="btn btn-primary">
Add
</button>
</td>
</tr>
</table>
<div ng-show="isAdmin">
<div class="row">
<div class="col-md-offset-1">
<button ng-show="!registring" ng-click="Add()" class="btn btn-primary btn-lg">
Add user
</button>
</div>
</div>
</div>
</div>