-
Notifications
You must be signed in to change notification settings - Fork 0
/
viking.html
153 lines (121 loc) · 4.4 KB
/
viking.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<title>Víkingaþrek - Stundaskrá</title>
<!-- Bootstrap core CSS -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="css/cover.css" rel="stylesheet">
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="site-wrapper">
<div class="site-wrapper-inner">
<div class="cover-container">
<div id="content-placeholder">
</div>
</div>
</div>
</div>
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/handlebars-v1.3.0.js"></script>
<script id="entry-template" type="text/x-handlebars-template">
<table class="table table-striped">
<thead>
<tr>
<th>Tími</th>
<th>Mánudagur</th>
<th>Þriðjudagur</th>
<th>Miðvikudagur</th>
<th>Fimmtudagur</th>
<th>Föstudagur</th>
<th>Laugardagur</th>
<th>Sunnudagur</th>
</tr>
</thead>
<tbody>
{{#each allSessions}}
{{#timeTD this}}{{/timeTD}}
{{/each}}
</tbody>
</table>
</script>
<script>
Handlebars.registerHelper('timeTD', function (timeSlot) {
var days = ['mon', 'tue', 'wed', 'thu', 'fri', 'sat', 'sun'];
var out = "<tr>";
out = out + "<td>" + timeSlot.time + "</td>";
days.forEach(function (day) {
out = out + "<td>";
if (day in timeSlot.sessions) {
out = out + "Víkingaþrek<br/>";
if (timeSlot.sessions[day].emphasis) {
out = out + "(" + timeSlot.sessions[day].emphasis + ")<br/>";
}
out = out + timeSlot.sessions[day].teacher;
}
out = out + "</td>";
});
return out + "</tr>";
});
var source = $("#entry-template").html();
var template = Handlebars.compile(source);
var data = {
allSessions: [
{time: '6:40', sessions: {
mon: {teacher: 'GE' },
wed: {teacher: 'HR', emphasis: 'Styrkur' },
fri: {teacher: 'GE', emphasis: 'MMA Þrek' }
}},
{time: '11:10', sessions: {
sat: {teacher: 'JV', emphasis: 'Tabata' }
}},
{time: '12:10', sessions: {
mon: {teacher: 'AK' },
tue: {teacher: 'HJ', emphasis: 'Styrkur' },
wed: {teacher: 'HJ' },
thu: {teacher: 'HR', emphasis: 'MMA Þrek' },
fri: {teacher: 'JV', emphasis: 'MMA Þrek' },
sat: {teacher: 'JV', emphasis: 'Tabata' },
sun: {teacher: 'GÞ', emphasis: 'Single Leg' }
}},
{time: '16:30', sessions: {
mon: {teacher: 'ÁÍ' },
wed: {teacher: 'SD' },
fri: {teacher: 'JV', emphasis: 'MMA Þrek' }
}},
{time: '17:15', sessions: {
mon: {teacher: 'JV' , emphasis: 'MMA/Ketilbjöllur' },
tue: {teacher: 'ÁÍ', emphasis: 'Styrkur' },
wed: {teacher: 'HJ' },
thu: {teacher: 'HR' },
fri: {teacher: 'JV', emphasis: 'MMA Þrek' }
}},
{time: '18:00', sessions: {
tue: {teacher: 'HJ', emphasis: 'Styrkur' },
thu: {teacher: 'AK'}
}},
{time: '19:00', sessions: {
}},
{time: '20:00', sessions: {
mon: {teacher: 'DF' },
wed: {teacher: 'GE'}
}}
]};
$("#content-placeholder").html(template(data));
</script>
</body>
</html>