-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshow.html
More file actions
74 lines (66 loc) · 2.16 KB
/
Copy pathshow.html
File metadata and controls
74 lines (66 loc) · 2.16 KB
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
<!DOCTYPE html>
<?var url = getScriptUrl();?>
<html>
<head>
<base target="_top">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/foundation/6.4.3/css/foundation.min.css">
</head>
<body>
<div class="grid-container" id="app">
<h3 class="text-center">Booming Mind Classes</h3>
<div class="grid-x" v-for="course in courses">
<div class="card">
<div class="card-divider">
<h3>{{ course.CourseCode }} - {{course.CourseName}}</h3>
</div>
<div class="card-section">
<table>
<tr><th>Date</th><th>Time</th><th>Location</th><th># of students signed up</th><th></th></tr>
<tr v-for="cls in classes" v-if="cls.CourseCode===course.CourseCode">
<td align='center'>{{cls.Date}}</td>
<td align='center'>{{cls.TimeBegin}} - {{cls.TimeEnd}}</td>
<td align='center'>{{cls.Location}}</td>
<td align='center'>{{cls.NumEnrolled}}</td>
<td><input type='button' class='button' style='margin:0;' value='Sign Up' v-on:click="signup('<?=url?>', cls.CourseCode, cls.ClassID);"></td>
</tr>
</table>
</div>
</div>
</div>
</div>
</body>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="https://unpkg.com/vue"></script>
<script>
var vm = new Vue({
el: '#app',
data: {
courses: [],
classes: []
},
methods: {
signup: function (url, courseCode, classID) {
window.open(url+"?what=signup&CourseCode=" + courseCode + "&ClassID=" + classID, "_blank");
}
}
});
function onGetCourses(e)
{
vm.courses = e;
}
function getCourses()
{
google.script.run.withSuccessHandler(onGetCourses).getCourses();
}
function onGetAllClasses(e)
{
vm.classes = e;
}
function getAllClasses()
{
google.script.run.withSuccessHandler(onGetAllClasses).getAllClasses();
}
getCourses();
getAllClasses();
</script>
</html>