-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
384 lines (374 loc) · 19.6 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
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
<!DOCTYPE html>
<html lang="en">
<!-- manifest="schedule.appcache"> -->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- act like an app -->
<meta name="apple-mobile-web-app-capable" content="yes">
<title>Schedule | WWU ResTek</title>
<!-- -- -- -->
<!-- CSS -->
<!-- -- -- -->
<link rel="stylesheet" href="libs/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<div class="navbar navbar-default navbar-static-top hidden-xs">
<div class="container">
<div class="navbar-header">
<a class="navbar-brand" href="#">Schedule</a>
</div>
</div>
</div>
<div class="navbar navbar-default navbar-fixed-bottom visible-xs" id="mobile-nav">
<div class="container">
<div class="row">
<div class="col-xs-3 text-center">
<p class="navbar-text"><a href="#" id="person-mobile-link">#people</a></p>
</div>
<div class="col-xs-3 text-center">
<p class="navbar-text"><a href="#" id="job-mobile-link">#jobs</a></p>
</div>
<div class="col-xs-3 text-center">
<p class="navbar-text"><a href="#" id="other-mobile-link">more</a></p>
</div>
<div class="col-xs-3 text-center">
<p class="navbar-text"><a href="#" class="to_top">top</a></p>
</div>
</div>
</div>
</div>
<div class="container" id="main_container">
<div class="row" id="main">
<div class="col-sm-9 col-lg-10" id="content">
</div>
<div class="col-sm-3 col-lg-2" id="side">
<h4 id="all_people_label"><a href="#person" class="unstyled">#person</a></h4><!-- #hashtags for you, @firassity -->
<ul id="all_people" class="list-unstyled"></ul>
<h4 id="all_jobs_label"><a href="#job" class="unstyled">#job</a></h4>
<ul id="all_jobs" class="list-unstyled"></ul>
<p><button id="show_events" class="btn btn-default">All Events</button></p>
<p><button id="show_overview" class="btn btn-default">Overview</button></p>
<p><button id="show_edit" class="btn btn-default">Edit</button></p>
</div>
</div>
</div>
<!-- -- -- -- -- -->
<!-- Javascript -->
<!-- -- -- -- -- -->
<script type="text/javascript" src="libs/moment/moment.min.js"></script>
<script type="text/javascript">
// GLOBAL vars
var now = new moment();
var requirements_list = {
"r": {
"text": "Required",
"label": "danger",
"description": "Attendance is mandatory"
},
"o": {
"text": "Optional",
"label": "warning",
"description": "Attendance is optional"
},
"s": {
"text": "Partial",
"label": "info",
"description": "Stay as long as content is relavent"
},
"rc": {
"text": "Possible",
"label": "info",
"description": "May not need to stay for content"
}
};
</script>
<script type="text/javascript" src="libs/jquery/jquery.min.js"></script>
<script type="text/javascript" src="libs/jquery-ui/jquery-ui.min.js"></script>
<script type="text/javascript" src="libs/touch-punch/jquery.ui.touch-punch.min.js"></script>
<script type="text/javascript" src="libs/draggabilly/draggabilly.pkgd.min.js"></script>
<script type="text/javascript" src="libs/underscore/underscore-min.js"></script>
<script type="text/javascript" src="libs/backbone/backbone-min.js"></script>
<script type="text/javascript" src="libs/bootstrap/js/bootstrap.min.js"></script>
<script type="text/javascript" src="libs/fastclick/fastclick.js"></script>
<script type="text/javascript" src="js/script.js"></script>
<!-- -- -- -- -- -- -- -- -- -->
<!-- Underscore.js templates -->
<!-- -- -- -- -- -- -- -- -- -->
<script type="text/template" id="list-item-template">
<a href="#"><%- name %></a>
</script>
<script type="text/template" id="short-person-template">
<a href="#person/<%- username %>"><%- name %></a>
</script>
<script type="text/template" id="short-job-template">
<a href="#job/<%- title_sanitized %>"><%- name %></a>
</script>
<script type="text/template" id="detail-template">
<h3>Empty detail</h3>
</script>
<script type="text/template" id="detail-event-template">
<h3><%- name %></h3>
<p><%- time.start.format("dddd, MMM Do [from] h:mm a") %>
<% if (time.end) { %> to <%- time.end.format("h:mm a") %><% } %></p>
<% if (place) { %><p><%- place %></p><% } %>
<% if (description) { %><p><%- description %></p><% } %>
<ul class="list-inline">
<% _.each(people, function(p) { %>
<li><a class="text-<%- requirements_list[p.requirement].label %>" href="#person/<%- p.username %>"><%- p.username %></a></li>
<% }) %>
</ul>
</script>
<script type="text/template" id="detail-person-template">
<h2><%- name %> <small><% _.each(jobs, function(j) { %><a href="#job/<%- j %>">#<%- j.replace('-', ' ') %></a> <% }) %></span></small></h2>
<p class="text-muted"><small><%- Math.round(total_hours.asHours() * 100) / 100 %> hours total, <%- Math.round(required_hours.asHours() * 100) / 100 %> required</small></p>
<ul id="events" class="list-unstyled">
<% _.each(e_data, function(d) { %>
<li class="day list-unstyled">
<h3 class="day-of-week"><%- d[0].time.start.format('dddd, MMM Do') %></h3>
<ul class="list-unstyled">
<% _.each(d, function(e) { %>
<li data-start="<%- e.time.start %>" data-end="<%- e.time.end %>" class="event border-<%- e.req.label %><%
if (e.time.start.isBefore(now) && e.time.end.isAfter(now)) { %> current<% } else
if (e.time.end.isBefore(now)) { %> past<% } %>"
style="min-height: <%- e.height %>em;">
<span class="tooltip-trigger label pull-right label-<%- e.req.label %>" data-toggle="tooltip" data-placement="left" title="<%- e.req.description %>"><%- e.req.text %></span>
<h4><a href="#event/<%- e.id %>" title="<%- e.id %>" class="unstyled"><%- e.name %></a></h4>
<div class="details">
<p><%- e.time.start.format("h:mm a") %><% if (e.time.end) { %> - <%- e.time.end.format("h:mm a") %><% } %><% if (e.place) { %>, <%- e.place %><% } %></p>
<% if (e.description) { %>
<p><%- e.description %></p>
<% } %>
</div>
</li>
<% }); %>
</ul>
</li>
<% }); %>
</ul>
</script>
<script type="text/template" id="detail-job-template">
<h2><%- name %></h2>
<ul id="people" class="list-unstyled list-inline">
<% _.each(people, function(p) { %>
<li><a href="#person/<%- p %>"><%- p %></a></li>
<% }); %>
</ul>
<ul id="events" class="list-unstyled">
<% _.each(e_data, function(d) { %>
<li class="day list-unstyled">
<h3 class="day-of-week"><%- d[0].time.start.format('dddd, MMM Do') %></h3>
<ul class="list-unstyled">
<% _.each(d, function(e) { %>
<li data-start="<%- e.time.start %>" data-end="<%- e.time.end %>" class="event border-<%- e.req.label %><%
if (e.time.start.isBefore(now) && e.time.end.isAfter(now)) { %> current<% } else
if (e.time.end.isBefore(now)) { %> past<% } %>"
style="min-height: <%- e.height %>em;">
<span class="tooltip-trigger label pull-right label-<%- e.req.label %>" data-toggle="tooltip" data-placement="left" title="<%- e.req.description %>"><%- e.req.text %></span>
<h4><a href="#event/<%- e.id %>" title="<%- e.id %>" class="unstyled"><%- e.name %></a></h4>
<div class="details">
<p><%- e.time.start.format("h:mm a") %><% if (e.time.end) { %> - <%- e.time.end.format("h:mm a") %><% } %><% if (e.place) { %>, <%- e.place %><% } %></p>
<% if (e.description) { %>
<p><%- e.description %></p>
<% } %>
</div>
</li>
<% }); %>
</ul>
</li>
<% }); %>
</ul>
</script>
<script type="text/template" id="all-template">
<h2>All Nothing</h2>
</script>
<script type="text/template" id="all-events-template">
<h2>All Events</h2>
<ul id="all_events" class="list-unstyled">
<% _.each(events, function(d) { %>
<li class="day list-unstyled">
<h3 class="day-of-week"><%- d[0].time.start.format('dddd, MMM Do') %></h3>
<ul class="list-unstyled">
<% _.each(d, function(e) { %>
<li data-start="<%- e.time.start %>" data-end="<%- e.time.end %>" class="event<%
if (e.time.start.isBefore(now) && e.time.end.isAfter(now)) { %> current<% } else
if (e.time.end.isBefore(now)) { %> past<% } %>"
style="min-height: <%- (e.time.end - e.time.start) / (1000 * 60 * 15) %>em;">
<h4><a href="#event/<%- e.id %>" title="<%- e.id %>" class="unstyled"><%- e.name %></a></h4>
<p><%- e.time.start.format("h:mm a") %><% if (e.time.end) { %> - <%- e.time.end.format("h:mm a") %><% } %><% if (e.place) { %>, <%- e.place %><% } %></p>
</li>
<% }); %>
</ul>
</li>
<% }); %>
</ul>
</script>
<script type="text/template" id="all-people-template">
<h2>#person</h2>
<ul id="people" class="list-unstyled">
<% _.each(things, function(p) { %>
<li class="person list-unstyled">
<h4><a href="#person/<%- p.username %>"><%- p.name %></a></h4>
</li>
<% }); %>
</ul>
</script>
<script type="text/template" id="all-jobs-template">
<h2>#job</h2>
<ul id="jobs" class="list-unstyled">
<% _.each(things, function(j) { %>
<li class="job list-unstyled">
<h4><a href="#job/<%- j.title_sanitized %>"><%- j.name %></a></h4>
<ul class="list-inline">
<% _.each(j.people, function(p) { %>
<li><a class="unstyled" href="#person/<%- p %>"><%- p %></a></li>
<% }); %>
</ul>
</li>
<% }); %>
</ul>
</script>
<script type="text/template" id="overview-template">
<h2>Overview</h2>
<div class="btn-group btn-group-sm" id="overview-toggle" data-toggle="buttons">
<label class="btn btn-default btn-small active">
<input type="checkbox" id="toggle-jobs" checked> #job
</label>
<label class="btn btn-default btn-small">
<input type="checkbox" id="toggle-people"> #people
</label>
</div>
<ul class="u_hidden list-inline">
<li><h5>Hidden:</h5></li>
<% _.each(titles, function(j) { %>
<li class="<%- j %> hidden job"><a href="#" class="open"><%- j %></a></li>
<% }); %>
<% _.each(usernames, function(p) { %>
<li class="<%- p %> person"><a href="#" class="open"><%- p %></a></li>
<% }); %>
</ul>
<div class="table-responsive">
<table class="table table-bordered" id="overview">
<thead id="overview_head">
<tr class="username">
<th></th>
<% _.each(titles, function(j) { %>
<th class="<%- j %> job"><span class="rotate"><a href="#job/<%- j %>"><%- j.replace('-', ' ') %></a><span class="close">x</span></span></th>
<% }); %>
<% _.each(usernames, function(p) { %>
<th class="<%- p %> hidden person"><span class="rotate"><a href="#person/<%- p %>"><%- p %></a><span class="close">x</span></span></th>
<% }); %>
</tr>
</thead>
<tbody class="text-center">
<tr>
<% _.each(events, function(d, d_i) { %>
<tr class="day"><td><h4><%- d[0].time.start.format('dddd') %></h4></td></tr>
<% _.each(d, function(e, i) { %>
<th class="event-name<%
if (e.time.start.isBefore(now) && e.time.end.isAfter(now)) { %> current<% } else
if (e.time.end.isBefore(now)) { %> past<% } %>">
<a href="#event/<%- e.id %>" title="<%- e.id %>" class="unstyled"><%- e.name %></a></th>
<% _.each(e.j_data, function(j, j_i) { %>
<td class="<%- titles[j_i] %> job"><% if (j) { %><span class="tooltip-trigger<% if (j) { %> label label-<%- requirements_list[j].label %><% }; %>" data-toggle="tooltip" data-container="body" title="<%- requirements_list[j].description %>"><%- j %></span><% }; %></td>
<% }); %>
<% _.each(e.p_data, function(u, u_i) { %>
<td class="<%- usernames[u_i] %> hidden person"><% if (u) { %><span class="tooltip-trigger<% if (u) { %> label label-<%- requirements_list[u].label %><% }; %>" data-toggle="tooltip" data-container="body" title="<%- requirements_list[u].description %>"><%- u %></span><% }; %></td>
<% }); %>
</tr>
<tr>
<% }); %>
</tr>
<tr class="first-of-day">
<% }); %>
</tbody>
</table>
</div>
</script>
<script type="text/template" id="editview-template">
<h2>Edit data
<div class="btn-group">
<button id="bulk-delete" type="button" class="btn btn-danger btn-sm" disabled="disabled">Delete</button>
<button id="generate-json" type="button" class="btn btn-info btn-sm">Generate JSON</button>
<!-- <button id="bulk-change" type="button" class="btn btn-default btn-sm" disabled="disabled">Change</button> -->
</div>
</h2>
<div class="row" id="json">
<div class="col-xs-12">
<pre></pre>
</div>
</div>
<div class="row">
<div class="col-sm-4" id="edit-col-events">
<button id="new-event" type="button" class="btn btn-default btn-block">new #event</button>
<div class="contents"></div>
</div>
<div class="col-sm-4" id="edit-col-jobs">
<button id="new-job" type="button" class="btn btn-default btn-block">new #job</button>
<div class="contents"></div>
</div>
<div class="col-sm-4" id="edit-col-people">
<button id="new-person" type="button" class="btn btn-default btn-block">new #person</button>
<div class="contents"></div>
</div>
</div>
</script>
<script type="text/template" id="event-editview-template">
<div class="panel-heading">
<h4 class="panel-title">
<span class="editable" data-attr="name"><%- name %></span>
<small><%- id %></small>
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
</h4>
</div>
<div class="panel-body">
<% var place_exists = typeof place == "string" && place.trim() && place.trim() != "" %>
<p class="editable <% if (!place_exists) { %> text-muted<% } %>" data-attr="place"><% if (place_exists) { %><%- place %><% } else { %>No place<% } %></p>
<p><span class="editable" data-attr="start"><%- time.start.format('YYYY-MM-DD HH:mm') %></span> to <span class="editable" data-attr="end"><%- time.end.format('YYYY-MM-DD HH:mm') %></span></p>
<% var desc = typeof description == "string" && description.trim() && description.trim() != "" %>
<p class="editable<% if (!desc) { %> text-muted<% } %>" data-attr="description"><% if (desc) { %><%- description %><% } else { %>No description<% } %></p>
</div>
</script>
<script type="text/template" id="job-editview-template">
<div class="panel-heading">
<h4 class="panel-title">
<span class="editable" data-attr="name"><%- name %></span>
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
</h4>
</div>
<div class="panel-body">
<ul class="list-inline job-people">
</ul>
<ul class="list-unstyled job-events">
</ul>
</div>
</script>
<script type="text/template" id="person-editview-template">
<div class="panel-heading">
<h4 class="panel-title">
<span class="editable" data-attr="name"><%- name %></span>
<small class="" data-attr="username"><%- username %></small>
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
</h4>
</div>
<div class="panel-body">
<ul class="list-unstyled job-events">
</ul>
</div>
</script>
<script type="text/template" id="miniperson-editview-template">
<span class="selectable btn btn-default btn-xs" data-attr="username" data-usernam="<%- username %>"><%- username %> <span class="tools"><button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button></span></span>
</script>
<script type="text/template" id="minievent-editview-template">
<span class="selectable btn btn-default btn-xs" data-attr="name" data-id="<%- id %>">
<span class="text-<%- requirements_list[requirement].label %>" title="<%- time.start.format("MMM Do h:mm a") %>"><%- name %></span>
<span class="tools">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<span class="choose-requirement glyphicon glyphicon-edit"></span>
</span>
</span>
</script>
</body>
</html>