summaryrefslogtreecommitdiffstats
path: root/modules-available/exams/templates/page-exams.html
blob: 95c73d340cbf6020a09aee4fa6b751f4c177a39f (plain) (blame)
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
<div class="container-fluid">
	<h1>All Exams</h1>

	<table class="table">
		<tr>
			<th>ID</th>
			<th>Location</th>
			<th>Begin</th>
			<th>End</th>
			<th>Actions</th>
		</tr>
		{{#exams}}
			<tr>
				<td>{{examid}}</td>
				<td> {{locationnames}} </td>
				<td>{{starttime}}</td>
				<td>{{endtime}}</td>
				<td>
					<form method="POST" action="?do=exams&action=delete"
						onsubmit="return confirm('delete really?');">
						<input type="hidden" name="token" value="{{token}}"/>
						<input type="hidden" name="examid" value="{{examid}}"/>
						<input type="submit" value="Delete" class="btn btn-sm" />
					</form>
				</td>
			</tr>
		{{/exams}}

	</table>
	<a href="?do=exams&action=add" class="btn btn-success">Add Exam </a>

	<div id="timeline"> </div>

</div>
<script type="application/javascript"><!--


function customOrder(a, b) {
	return 1000; // just in order of appeareance
}

document.addEventListener("DOMContentLoaded", function () {
	var container = document.getElementById('timeline');
	var groups_plain = JSON.parse('{{{rooms_json}}}');
	var items_plain = JSON.parse('{{{exams_json}}}');
	console.log(groups_plain);
	console.log(items_plain);
	var groups = new vis.DataSet(groups_plain);
	var items = new vis.DataSet(items_plain);

	var options = {
		'start' : '{{{vis_begin}}}',
		'end' : '{{{vis_end}}}',
		'stack' : false,
		'order' : customOrder
	};

	var timeline = new vis.Timeline(container, items, groups, options);
}, false);

// --></script>