-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
185 lines (163 loc) · 7.16 KB
/
index.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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="icon" type="image/png" href="favicon.png" type="image/x-icon">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<link rel="stylesheet" href="bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"
integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
<title>User Management</title>
<link rel="stylesheet" href="index.css">
</head>
<body>
<div class="container">
<h1>✨ Users ✨</h1>
<div id="shortcuts">
<input type="text" id="searchBar" name="searchBar" placeholder="search by name, email or phone"
class="form-control form-control-ig" />
<button type="button" class="btn btn-default " data-action="addUser" id="addUser">Add User</button>
<!------------ Filters ------------>
<!-- for Status filter -->
<div class="dropdown">
<button class="btn btn-default" type="button" data-toggle="dropdown">Status
<span id="selected" class="caret"></span>
</button>
<ul class="dropdown-menu" id="dropdown-menu-status">
<li><a onclick="statusFilter('any')">Any</a></li>
<li><a onclick="statusFilter('active')">Active</a></li>
<li><a onclick="statusFilter('inActive')">In-Active</a></li>
</ul>
</div>
<!-- for role filter -->
<div class="dropdown">
<button class="btn btn-default" type="button" data-toggle="dropdown">Role
<span class="caret"></span>
</button>
<ul class="dropdown-menu" id="dropdown-menu-role">
<li><a onclick="statusFilter('any')">Any</a></li>
<li><a onclick="statusFilter('admin')">Admin</a></li>
<li><a onclick="statusFilter('member')">Member</a></li>
<li><a onclick="statusFilter('guest')">Guest</a></li>
</ul>
</div>
</div>
</div>
<!------------------ Modals ----------------->
<div>
<!--------- new user modal ------>
<div class="modal fade" id="newUserModal" class="modal">
<div class="newUsermodal-dialog modal-small">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<h2 style="font-weight: bold" "modal-title">User Sign up!</h2>
</div>
<div class="modal-body">
<form name="newUserForm" id="newUserForm">
<label>Name</label>
<input class="form-control" name=addName" id="addName" type="text" />
<label>Email</label>
<input class="form-control" name="addEmail" id="addEmail" type="email" />
<label>Address</label>
<input class="form-control" name="addAddress" id="addAddress" type="text" />
<label>Phone</label>
<input class="form-control" name="addphone" id="addPhone" type="text" />
<label>Status</label>
<select class="btn" name="addStatus" id="addStatus">
<option value=true>Active</option>
<option value=false>Inactive</option>
</select>
<br>
<label>Role</label>
<select class="btn" name="addrole" id="addRole">
<option value="ADMIN">Admin</option>
<option value="MEMBER">Member</option>
<option value="GUEST">Guest</option>
</select>
<br>
<label>Avatar           <a href=https://randomuser.me/photos
target="_blank" {font-size: 1004px}>choose</a></label>
<input class="form-control" name="addAvatar" id="addAvatar" type="text" />
<div class="modal-footer">
<button type="submit" class="btn btn-default" data-toggle="modal" data-dismiss="modal"
id="Cancel">Cancel</button>
<button type="submit" class="btn btn-dark" data-toggle="modal" id="addSubmit"
onclick="addNewUser(document.getElementById('newUserForm'))">Submit</button>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
<!--------- Edit modal --------->
<div class="modal fade" id="editModal" class="modal">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div>
<div class="modal-header">
<h2 style="font-weight: bold" "modal-title">Edit User</h2>
</div>
<div class="modal-body">
<form name="editForms" id="editForms">
<label>Name</label>
<input class="form-control" name="editName" id="editName" type="text" />
<label>Email</label>
<input class="form-control" name="editEmail" id="editEmail" type="email" />
<label>Address</label>
<input class="form-control" name="editAddress" id="editAddress" type="text" />
<label>Phone</label>
<input class="form-control" name="editphone" id="editPhone" type="text" />
<label>Status</label>
<select class="btn" name="editStatus" id="editStatus">
<option value=true>Active</option>
<option value=false>Inactive</option>
</select>
<br>
<label>Role</label>
<select class="btn" name="editRole" id="editRole">
<option value="ADMIN">Admin</option>
<option value="MEMBER">Member</option>
<option value="GUEST">Guest</option>
</select>
<input name="Id" id="Id" type="hidden" />
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal" data-toggle="modal"
id="Cancel">Cancel</button>
<button class="btn btn-dark" type="button" id="editSubmit"
onclick="editUser(document.getElementById('editForms'))">Submit</button>
</div>
</div>
</div>
</div>
</div>
<!---------- delete modal ---------->
<div class="modal fade" id="deleteModal" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Are you sure to delete this user ?</h5>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal" data-toggle="modal"
id="Cancel">Cancel</button>
<button type="button" class="btn btn-danger" data-dismiss="modal" data-toggle="modal"
id="confirm-delete">Delete</button>
</div>
</div>
</div>
</div>
<!-- for displaying html -->
<div id="parent-container">
<ul id='user-container'></ul>
</div>
<script src='index.js'></script>
</body>
</html>