summaryrefslogtreecommitdiffstats
path: root/modules-available/exams/templates/page-add-edit-exam.html
blob: 7d74972d8b029f14f2975e791140c6ed1e5ed0bb (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
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
{{#exam.examid}}
<h1>{{lang_editExam}}</h1>
{{/exam.examid}}
{{^exam.examid}}
<h1>{{lang_addExam}}</h1>
{{/exam.examid}}

<form class="form" method="POST" action="?do=exams" id="tolleform">
	<div class="form-group">
		<label for="locations">{{lang_location}}</label>
		<select id="locations" multiple name="locations[]">
			{{#locations}}
			<option value="{{locationid}}" {{#selected}}selected{{/selected}}>{{locationpad}} {{locationname}}</option>
			{{/locations}}
		</select>
	</div>

	<div class="row form-group">
		<div class="col-xs-6">
			<label for="starttime_date">{{lang_begin_date}}</label>
			<div class="input-group">
				<span class="input-group-addon">
					<span class="glyphicon glyphicon-calendar"></span>
				</span>
				<input required class="form-control datepicker" name="starttime_date" id="starttime_date"
						 value="{{exam.starttime_date}}">
			</div>
		</div>
		<div class="col-xs-6">
			<label for="starttime_time">{{lang_begin_time}}</label>
			<div class="input-group bootstrap-timepicker timepicker">
				<span class="input-group-addon">
					<span class="glyphicon glyphicon-time"></span>
				</span>
				<input required type="text" class="form-control timepicker2" name="starttime_time" id="starttime_time"
						 value="{{exam.starttime_time}}"
						 pattern="[0-9]{1,2}:[0-9]{2}">
			</div>
		</div>
	</div>

	<div class="row form-group">
		<div class="col-xs-6">
			<label for="endtime_date">{{lang_end_date}}</label>
			<div class="input-group">
				<span class="input-group-addon">
					<span class="glyphicon glyphicon-calendar"></span>
				</span>
				<input required class="form-control datepicker" name="endtime_date" id="endtime_date"
						 value="{{exam.endtime_date}}">
			</div>
		</div>
		<div class="col-xs-6">
			<label for="endtime_time">{{lang_end_time}}</label>
			<div class="input-group bootstrap-timepicker timepicker">
				<span class="input-group-addon">
					<span class="glyphicon glyphicon-time"></span>
				</span>
				<input required type="texxt" class="form-control timepicker2" name="endtime_time" id="endtime_time"
						 value="{{exam.endtime_time}}"
						 pattern="[0-9]{1,2}:[0-9]{2}">
			</div>
		</div>
	</div>
	<div class="row form-group">
		<div class="form-group col-xs-12">
			<label for="description">{{lang_description}}</label>
			<textarea class="form-control" type="textarea" name="description" id="description">{{exam.description}}</textarea>
		</div>
	</div>

	<input type="hidden" name="action" value="save">
	<input type="hidden" name="token" value="{{token}}">
	<input type="hidden" name="examid" value="{{exam.examid}}">
	<button class="btn btn-success">{{lang_save}}</button>
</form>

<script type="application/javascript"><!--
document.addEventListener("DOMContentLoaded", function () {
	var filename = "modules/bootstrap_datepicker/lang/bootstrap-datepicker." + LANG + ".js";

	$.getScript(filename)
		.always(function () {
			/* TODO: generalize this (set locale in the clientscript.js of bootstrap_datepicker) */
		var dateSettings = {
				format: 'yyyy-mm-dd',
				weekStart: 1,
				startDate: 'today',
				language: LANG
			};
			var timeSettings = {
				showSeconds: false,
				showMeridian: false,
				minuteStep: 5,
				appendWidgetTo: 'body'

			};
			$('.datepicker').datepicker(dateSettings);
			$('.timepicker2').timepicker(timeSettings);

			$('#locations').multiselect({numberDisplayed: 1});


		});

}, false);
// --></script>