-
Notifications
You must be signed in to change notification settings - Fork 1
/
groups.html
438 lines (411 loc) · 20.3 KB
/
groups.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
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
<!DOCTYPE html>
<html ng-app="myApp" lang="en">
<head>
<meta charset="utf-8">
<title>K-Sketch: The Kinetic Sketch Pad!</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<!-- Google Analytics Code -->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-40422359-1', 'k-sketch-test.appspot.com');
ga('send', 'pageview');
</script>
<!-- Le styles -->
<link href="css/bootstrap.css" rel="stylesheet">
<link href="css/bootstrap-responsive.css" rel="stylesheet">
<!-- Additional styles for individual components -->
<link href="css/additional.css" rel="stylesheet">
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<!-- Fav and touch icons -->
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="ico/apple-touch-icon-144-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="ico/apple-touch-icon-114-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="ico/apple-touch-icon-72-precomposed.png">
<link rel="apple-touch-icon-precomposed" href="ico/apple-touch-icon-57-precomposed.png">
<link rel="shortcut icon" href="ico/favicon.png">
<!-- Code for K-Sketch App Plugin -->
<!-- Enable Browser History by replacing useBrowserHistory tokens with two hyphens -->
<!-- BEGIN Browser History required section -->
<link rel="stylesheet" type="text/css" href="history/history.css" />
<script type="text/javascript" src="history/history.js"></script>
<!-- END Browser History required section -->
<script type="text/javascript" src="swf/swfobject.js"></script>
<script type="text/javascript" src="js/janrain/janrain_widget.js"></script>
<script type="text/javascript" src="js/common/notification.js"></script>
<script type="text/javascript">
function QueryString() {
// This function is anonymous, is executed immediately and
// the return value is assigned to QueryString!
var query_string = {};
var query = window.location.search.substring(1);
var vars = query.split("&");
for (var i=0;i<vars.length;i++) {
var pair = vars[i].split("=");
// If first entry with this name
if (typeof query_string[pair[0]] === "undefined") {
query_string[pair[0]] = pair[1];
// If second entry with this name
} else if (typeof query_string[pair[0]] === "string") {
var arr = [ query_string[pair[0]], pair[1] ];
query_string[pair[0]] = arr;
// If third or later entry with this name
} else {
query_string[pair[0]].push(pair[1]);
}
}
e = document.getElementById('testdiv');
scope = angular.element(e).scope();
if (query_string.id !== undefined && query_string.id !== "") {
scope.$apply(function() {
scope.setTest(query_string.id);
scope.get_group();
});
} else {
if (navigator.userAgent.match(/MSIE\s(?!9.0)/))
{
var referLink = document.createElement("a");
referLink.href = "index.html";
document.body.appendChild(referLink);
referLink.click();
}
else { window.location.replace("index.html");}
}
}
</script>
</head>
<!-- body id="ksketchapp" ng-controller="LoginController" scrolling="no" -->
<body ng-controller="GroupsController" id="ksketchapp" scrolling="no" onload="QueryString()">
<!-- Loading -->
<div id="LoadingDiv" ui-if="waiting!='Ready'"></div>
<div class="modal" id="Loading" ui-if="waiting=='Loading'">
<div class="modal-body">
<span>Loading........</span>
</div>
</div>
<div class="modal" id="Loading" ui-if="waiting=='Saving'" ng-cloak>
<div class="modal-body">
<span>Saving........</span>
</div>
</div>
<div class="modal" id="Message" ui-if="waiting=='Error'" ng-cloak>
<div class="modal-body">
<div class="modal-header">
<input type="submit" class="close" value="x" data-dismiss="modal" ng-click="acknowledge()"/>
<h3 id="myUploadItems">{{heading}}</h3>
</div>
<br/>
<div class="control-group">
<div class="control-label">
<span style="text-align:center">{{message}}</span>
<br/>
<br/>
<span style="text-align:center">{{submessage}}</span>
<br/>
<br/>
</div>
</div>
</div>
<div class="modal-footer">
<input type="submit" ng-click="acknowledge()" value="Ok" data-dismiss="modal"/>
</div>
</div>
<!-- Top Bar -->
<div id="topbar" class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container-fluid" ng-show="waiting=='Ready'" ng-cloak>
<!-- a class="brand" id="logo" href="#"><img style="height:36px" src="ico/KSketch-logo.png"></a -->
<a class="brand" id="logo" href=" index.html">K-Sketch</a>
<ul class="nav" ng-cloak>
<li>
<!--Username and profile link goes here.-->
<a ng-show="User.u_login" ng-cloak href="profile.html?id={{User.id}}" class="navbar-link">
<span id="heading">
Hello, {{User.u_name}}
<span ui-if="User.u_isadmin"> (Admin)</span>
!
</span>
</a>
<a ng-hide="User.u_login" ng-cloak id="heading" disabled>Hello, {{User.u_name}}!</a>
</li>
<li ng-hide="User.u_login" ng-cloak>
<a class="janrainEngage" href="#">Sign-In</a>
</li>
<li ng-show="User.u_login" ng-cloak>
<a href="/user/logout">Logout</a>
</li>
<li class="dropdown" ui-if="User.u_login">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" title="{{notify}}">
<!-- <b class="caret"></b> -->
<i ng-class="notify_icon"></i>
</a>
<ul class="dropdown-menu">
<li>
<a ui-if="!notifications.entities.length">
<span>You have no new notifications.</span>
</a>
<table class="table table-striped" ui-if="!!notifications.entities.length">
<tr ng-repeat="notification in notifications.entities | limitTo:3">
<td>
<span>{{notification.n_date}}</span>
</td>
<td>
<span>{{notification.n_message}}</span>
</td>
<td ui-if="notification.n_type == 'GROUPINVITE'">
<ul>
<a class="btn btn-small" onClick="notifyAccept({{notification.id}},{{notification.n_relevant}})">Accept</a>
</ul>
<ul>
<a class="btn btn-small" onClick="notifyReject({{notification.id}},{{notification.n_relevant}})">Reject</a>
</ul>
</td>
</tr>
</table>
</li>
<li class="divider"></li>
<li>
<a href="notifications.html">
Show All Notifications
</a>
</li>
</ul>
</li>
</ul>
<p class="navbar-search pull-right">
<input type="text" ng-model="search" onkeypress="searchKeyPress(event);" class="search-query" placeholder="Search by sketch name or owner">
<input type="submit" id="searchbutton" class="btn btn-inverse btn-small" ng-click="simpleSearch()" value=">>">
<script>
function searchKeyPress(e)
{
// look for window.event in case event isn't passed in
if (typeof e == 'undefined' && window.event) { e = window.event; }
if (e.keyCode == 13)
{
document.getElementById('searchbutton').click();
}
}
</script>
</p>
</div>
</div>
</div>
<!-- Main Body -->
<div class="container-fluid" id="wrap">
<div class="row-fluid" id="mainbody">
<!-- Navigation Sidebar (Access separate panes). -->
<div class="span2">
<div class="well sidebar-nav sidebar-nav-fixed">
<ul class="nav nav-list">
<!--This changes depending on current logged-in status.-->
<li id="sc" ng-show="User.u_login" ng-cloak><a title="View personal profile, sketches and group memberships" href="profile.html?id={{User.id}}">My Sketchbook</a></li>
<li id="cs"><a title="Open editor to create a new sketch" href="sketch.html">Create a Sketch</a></li>
</ul>
</div><!--/.well -->
</div><!--/span-->
<!-- Main Body -->
<div class="span10">
<!-- Stuff goes here. -->
<!-- We have to think of a better name for this! -->
<div class="row-fluid">
<div class="row-fluid">
<span id="testdiv" ng-model="test"></span>
<div class="row-fluid">
<div class="span10">
<h2 ng-cloak>{{group_name}}</h2>
</div>
<div class="span2">
<button class="btn btn-inverse btn-small" style="float:right" ui-if="!founder && belong" ng-click="leavegroup()" ng-cloak>Leave Group</button>
<button class="btn btn-inverse btn-small" style="float:right" ui-if="founder && belong" ng-click="deletegroup()" ng-cloak>Delete Group</button>
</div>
</div>
</div>
<div class="tabbable">
<ul class="nav nav-tabs">
<li class="active">
<a href="#GroupSketches" data-toggle="tab">Group Sketches</a>
</li>
<li>
<a href="#GroupMembers" data-toggle="tab">Group Members</a>
</li>
</ul>
<div class="tab-content" id="main">
<!-- Group Sketches Pane -->
<div class="tab-pane active" id="GroupSketches">
<div class="row-fluid">
<h2>Group Sketches</h2>
<div class="row-fluid">
<div class="span6">
<span ui-if="!items.entities.length" ng-cloak><em>No sketches were found for this group.</em></span>
</div>
<div class="span6">
<button class="btn btn-info" style="float:right" ui-if="group_pagination.next_offset != 0" ng-click="paginate_forward()" ng-cloak>More Results</button>
</div>
</div>
<ul class="unstyled" ui-if="!!items.entities.length" ng-cloak>
<li ng-repeat="files in items.entities | orderBy:predicate_users:reverse | filter:filter">
<div class="well well-small">
<div class="row-fluid">
<div class="span3">
<a href="view.html?id={{files.data.sketchId}}" title="View this sketch">
<img src="data:image/png;base64,{{files.data.thumbnailData}}" alt="Red dot" ui-if="!!files.data.thumbnailData">
<div class="well well-small" ui-if="!files.data.thumbnailData">
<span>No preview available</span>
</div>
</a>
</div>
<div class="span9">
<div class="row-fluid">
<div class="span6">
<a href="view.html?id={{files.data.sketchId}}" title="View this sketch">
<h4>{{files.data.fileName}}</h4>
</a>
</div>
<div class="span6">
<span class="label">
Likes: {{files.data.like}}
</span>
<span class="label">
Comments: {{files.data.comment}}
</span>
</div>
</div>
<em>
<span ui-if="files.data.changeDescription.length > 50" title="{{files.data.changeDescription}}" ng-cloak>
{{files.data.changeDescription.substring(0, 49)}}...
</span>
<span ui-if="0 < files.data.changeDescription.length <= 50" ng-cloak>
{{files.data.changeDescription}}
</span>
<span ui-if="files.data.changeDescription.length == 0" ng-cloak>
No description given
</span>
</em>
<br>
Created by
<a href="profile.html?id={{files.data.owner_id}}" ui-if="files.data.owner_id != 0">{{files.data.owner}}</a>
<span ui-if="files.data.owner_id == 0">{{files.data.owner}}</span>
on {{tzformat(files.created)}}
</div>
</div>
</div>
</li>
</ul>
<hr/>
<button class="btn btn-info" style="float:right" ui-if="group_pagination.next_offset != 0" ng-click="paginate_forward()" ng-cloak>More Results</button>
</div>
</div>
<!-- Group Members Pane -->
<div class="tab-pane" id="GroupMembers">
<div class="row-fluid">
<div class="span10">
<h2>Group Members</h2>
</div>
<div class="span2">
<button class="btn btn-inverse btn-small" style="float:right" data-toggle="modal" href="#AddMember" ui-if="founder" ng-cloak>Add Member</button>
</div>
<table class="table table-bordered table-striped" ui-if="!!u_groups.length" ng-cloak>
<thead>
<th>
User
</th>
<th>
Role
</th>
<th ui-if="founder">
Action
</th>
</thead>
<tbody>
<tr ng-repeat="users in u_groups">
<td>
<a ng-cloak href="profile.html?id={{users.user_id}}">
<img id="comment_img" src="https://secure.gravatar.com/avatar/{{users.g_hash}}?s=200&r=pg&d=mm" />
<span>{{users.user}}</span>
</a>
</td>
<td>{{users.role}}</td>
<td ui-if="founder">
<button class="btn btn-danger btn-small" ui-if="users.role == 'Member' && founder" ng-click="kickgroup(users)">Kick Out</button>
<button class="btn btn-info btn-small" ui-if="users.role == 'Member' && founder" ng-click="passfounder(users)">Pass Ownership</button>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<!--Add Member Modal-->
<div class="modal hide fade" id="AddMember" style="display:none" ui-if="founder">
<div class="modal-header">
<input type="submit" class="close" value="x" data-dismiss="modal"/>
<h3 id="Login">Add Member</h3>
</div>
<div class="modal-body">
<div class="control-group">
<label class="control-label" for="UserName">Search by Username:</label>
<input type="text" ng-model="groupmeta.data.criteria"/>
<input type="submit" class="button btn-inverse" ng-click="groupuserlist()" value="Search"/>
<br/>
<label class="control-label" for="UserName">Select a User:</label>
<div class="controls">
<select ng-model="useradd" ng-options="userfound as userfound.u_name for userfound in usersfound.entities" ng-cloak></select>
<button class="btn btn-small" ng-click="includemember(useradd)">Add</button>
<br/>
{{added}}
</div>
<div class="controls">
<ul>
<li ng-repeat="u_add in usertoadd.data.users">
{{u_add.u_name}}
<button ng-click="unincludemember(u_add)">Remove</button>
</li>
</ul>
</div>
<div class="controls">
<input type="submit" ng-click="addmember()" value="Submit" data-dismiss="modal"/>
</div>
</div>
</div>
<div class="modal-footer"></div>
</div>
</div>
</div>
</div>
</div><!--/span-->
</div><!--/row-->
<hr>
<footer>
<p>This page requires JavaScript and Adobe Flash Player, and is optimized for Mozilla Firefox and Google Chrome. © Richard C. Davis 2013</p>
</footer>
</div><!--/.fluid-container-->
<!-- Le javascript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="js/jquery/jquery.js"></script>
<script src="js/moment/moment.min.js"></script>
<script src="lib/angular/angular.min.js"></script>
<script src="lib/angular/angular-ui.min.js"></script>
<script src="lib/angular/angular-resource.min.js"></script>
<script src="js/angular/groups-controller.js"></script>
<script src="js/app.js"></script>
<script src="js/bootbox/bootbox.min.js"></script>
<script src="js/bootstrap/bootstrap-transition.js"></script>
<script src="js/bootstrap/bootstrap-alert.js"></script>
<script src="js/bootstrap/bootstrap-modal.js"></script>
<script src="js/bootstrap/bootstrap-dropdown.js"></script>
<script src="js/bootstrap/bootstrap-scrollspy.js"></script>
<script src="js/bootstrap/bootstrap-tab.js"></script>
<script src="js/bootstrap/bootstrap-tooltip.js"></script>
<script src="js/bootstrap/bootstrap-popover.js"></script>
<script src="js/bootstrap/bootstrap-button.js"></script>
<script src="js/bootstrap/bootstrap-collapse.js"></script>
<script src="js/bootstrap/bootstrap-carousel.js"></script>
<script src="js/bootstrap/bootstrap-typeahead.js"></script>
</body>
</html>