/
options.html
346 lines (308 loc) · 10.8 KB
/
options.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
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
<!DOCTYPE html>
<html lang="en" id="main_page" ng-app="listapp">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<meta name="description" content="">
<meta name="author" content="">
<meta name="google-signin-client_id" content="564236928671-crejp57oa63oc44jjjnbf7jqj9qes9t9.apps.googleusercontent.com">
<title>Amodcs</title>
<!-- Bootstrap core CSS -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/bootstrap-social.css" rel="stylesheet">
<link href="css/options.css" rel="stylesheet">
<link rel="stylesheet" href="http://www.w3schools.com/lib/w3.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"></script>
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/list.js/1.2.0/list.min.js"></script>
<!-- Custom styles for this template -->
<link rel="stylesheet" href="font-awesome-4.6.3/css/font-awesome.min.css">
<script src="js/oauth.js"></script>
</head>
<div style="width:100%; padding-bottom: 25%; background:url('images/background.gif');
background-size: 1680px 1050px">
<style>
#notifications {
padding-top:50px
}
#authens {
padding-top:150px
}
.row{
padding-top:150px;
padding-left:50px;
}
#list{
padding-top:150px;
padding-left:50px;
}
.table table-hover{
padding-left:50px;
margin-top: 10px;
}
.selected{
background-color: yellow;
}
input{
margin-right: 30px;
}
</style>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular.min.js"></script><!-- load angular -->
<script src="bower_components/angular-route/angular-route.js"></script>
<script src="https://connect.facebook.net/en_US/all.js"></script>
<body ng-controller="user_controller" id="control">
<header class= "navbar navbar-inverse navbar-fixed-top">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="options.html"><i class="fa fa-home"></i>Amdocs</a>
</div>
<nav class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li class="">
<a href="/feedback/"><span class="fa fa-fw fa-comment"></span> Feedback</a>
</li>
<li>
<a target="gae-init-docs"> <i class="fa fa-fw fa-phone"></i> Contact</a>
</li>
<li>
<a href="approval.html"> <i class="fa fa-fw fa-tasks"></i> Approve/Schedule CCs</a>
</li>
<li>
<a href="profiles.html"> <i class="fa fa-fw fa-male"></i> Manage Users</a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li>
<a ng-model="user.image"><img src="images/user.jpg" id="pic" height="20" width="20"></a>
</li>
<li>
<a id="username" ng-model="user.name">--</a>
</li>
<li>
<a id="logoutBtn" ng-click="log_out()"><span class="fa fa-fw fa-sign-in"></span> Sign out</a>
</li>
<li class="active">
<a id="loginBtn"><span class="fa fa-fw fa-sign-in"></span> Sign in</a>
</li>
</ul>
</nav>
</div>
</header>
<div class="container" id="list">
<div class="dropdown">
<button class="dropbtn btn btn-info test"><i class="fa fa-fw fa-terminal"></i>Create form</button>
<div id="myDropdown" class="dropdown-content">
<a href="form.html" type="button"><i class="fa fa-fw fa-plus-square-o"></i>
new submission
</a>
<a data-toggle="modal" data-target="#myModal2"><i class="fa fa-fw fa-history"></i>clone from history</a>
</div>
</div>
<button type="button" class="btn btn-warning test" ng-click="mod_form()">
<i class="fa fa-fw fa-pencil-square-o"></i> Modify Existing Forms
</button>
<button type="button" class="btn btn-danger test" ng-click="delete_form(ids)">
<i class="fa fa-fw fa-times"></i> Delete Forms
</button>
<table class="table table-hover">
<thead>
<tr>
<th>Subject</th>
<th>Creation Date</th>
<th>Status</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="rfc in rfcs" ng-class="{selected : rfc._id === ids }">
<td ng-dblclick="view(rfc._id)" ng-click="getId(rfc._id)">{{rfc.subject}}</td>
<td ng-dblclick="view(rfc._id)" ng-click="getId(rfc._id)">{{rfc.creation_date| date: 'MM/dd/yyyy'}}</td>
<td ng-dblclick="view(rfc._id)" ng-click="getId(rfc._id)">{{rfc.status}}</td>
</tr>
</tbody>
</table>
<div class="modal fade" id="myModal2" role="dialog">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div id="notifications"></div>
<div class="page-header">
<h1>Old forms</h1>
</div>
<p><input style="float:right" placeholder="Search" ng-model="search"/></p>
<table class="table table-hover">
<thead>
<tr>
<th></th>
<th>Subject</th>
<th>Creation Date</th>
<th>Descriptions</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="rfc in rfcs | filter: search" class="list">
<td><button ng-click="clone(rfc._id)"><i class="fa fa-fw fa-pencil"></i></button></td>
<td>{{rfc.subject}}</td>
<td>{{rfc.creation_date | date: 'MM/dd/yyyy'}}</td>
<td>{{rfc.descriptions}}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<footer class="w3-container w3-padding-32 w3-black">
<div class="w3-row-padding w3-black">
<div class="w3-third w3-black">
<h3>About</h3>
<p>Some info about Amdocs maybe?</p>
<p>Powered by <a href="http://www.w3schools.com/w3css/default.asp" target="_blank">w3.css</a></p>
<h3>Office address</h3>
<p>2109 Fox Dr, Champaign, IL 61820</p>
</div>
<div class="w3-third">
<h3>BLOG POSTS</h3>
<ul class="w3-ul w3-hoverable">
<li class="w3-padding-16">
<span class="w3-large">Lorem</span><br>
<span>Sed mattis nunc</span>
</li>
<li class="w3-padding-16">
<span class="w3-large">Ipsum</span><br>
<span>Praes tinci sed</span>
</li>
</ul>
</div>
<div class="w3-third">
<h3>POPULAR TAGS</h3>
<p>
<span class="w3-tag w3-black w3-margin-bottom">Travel</span> <span class="w3-tag w3-dark-grey w3-small w3-margin-bottom">New York</span> <span class="w3-tag w3-dark-grey w3-small w3-margin-bottom">London</span>
<span class="w3-tag w3-dark-grey w3-small w3-margin-bottom">IKEA</span> <span class="w3-tag w3-dark-grey w3-small w3-margin-bottom">NORWAY</span> <span class="w3-tag w3-dark-grey w3-small w3-margin-bottom">DIY</span>
<span class="w3-tag w3-dark-grey w3-small w3-margin-bottom">Ideas</span> <span class="w3-tag w3-dark-grey w3-small w3-margin-bottom">Baby</span> <span class="w3-tag w3-dark-grey w3-small w3-margin-bottom">Family</span>
<span class="w3-tag w3-dark-grey w3-small w3-margin-bottom">News</span> <span class="w3-tag w3-dark-grey w3-small w3-margin-bottom">Clothing</span> <span class="w3-tag w3-dark-grey w3-small w3-margin-bottom">Shopping</span>
<span class="w3-tag w3-dark-grey w3-small w3-margin-bottom">Sports</span> <span class="w3-tag w3-dark-grey w3-small w3-margin-bottom">Games</span>
</p>
</div>
</div>
</footer>
<script>
// web services
angular.module('user_forms', [])
.factory('user_factory', ['$http', '$q', function($http, $q){
return{
get_profile: function(){
return $http.get('/user/profile');
},
get_form: function(){
return $http.get('/options');
},
delete: function(id){
return $http.delete('/api/rfc/'+ id);
},
get_form_email: function(email){
return $http.get('/api/rfc/' + email);
},
log_out : function(){
return $http.get('/logout');
},
clone_form : function(id){
return $http.get('/api/rfc/'+ id);
}
}
}]);
// controller
angular.module('user_control',[])
.controller('user_controller', ['$scope', '$http', 'user_factory',function($scope, $http, user_factory){
$scope.ids = null;
$scope.user= {};
user_factory.get_profile()
.success(function(data){
$scope.user = data;
document.getElementById('username').innerHTML = data.name;
$('#pic').attr('src', data.image);
});
$scope.delete_form = function(id){
if(id != null)
user_factory.delete(id)
.success(function(data){
user_factory.get_form()
.success(function(data){
$scope.rfcs = data;
});
});
};
$scope.getId = function(id){
$scope.ids = id;
};
$scope.log_out = function(){
user_factory.log_out();
window.top.location = "login.html"
};
$scope.view = function(id){
user_factory.clone_form(id)
.success(function(){
window.top.location = "form.html"+ '?id='+ id + '&mode=view';
});
};
$scope.clone = function(id){
user_factory.clone_form(id)
.success(function(){
window.top.location = "form.html"+ '?id='+ id + '&mode=clone';
});
};
$scope.getList = function() {
//user_factory.get_form_email(email)
user_factory.get_form()
.success(function(data){
$scope.rfcs = data;
});
};
$scope.mod_form = function() {
if($scope.ids!= null)
window.top.location = "form.html"+ '?id='+ $scope.ids+'&mode=modify';
};
}]);
// core
angular.module('listapp', ['user_control', 'user_forms', 'ngRoute']);
</script>
<script>
var options = {
valueNames: [ 'subject', 'date' ]
};
var userList = new List('forms', options);
$( document ).ready(function() {
var scope = angular.element(document.getElementById("control")).scope();
scope.$apply(function () {
scope.getList();
});
});
function myFunction() {
document.getElementById("myDropdown").classList.toggle("show");
}
// Close the dropdown menu if the user clicks outside of it
window.onclick = function(event) {
if (!event.target.matches('.dropbtn')) {
var dropdowns = document.getElementsByClassName("dropdown-content");
var i;
for (i = 0; i < dropdowns.length; i++) {
var openDropdown = dropdowns[i];
if (openDropdown.classList.contains('show')) {
openDropdown.classList.remove('show');
}
}
}
}
</script>
</body>
</div>
</html>