summaryrefslogtreecommitdiffstats
path: root/modules-available/locationinfo/templates/page-locations.html
blob: c79cdfe80bc828f1b9c258caa5ecd7123930c35a (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
108
109
110
<h2>{{lang_locationsTable}}</h2>

<p>{{lang_locationsTableHints}}</p>

<table class="table table-condensed table-hover">
	<thead>
	<tr>
		<th>{{lang_locationName}}</th>
		<th>{{lang_backend}}</th>
		<th>{{lang_lastCalendarUpdate}}</th>
		<th class="text-center slx-smallcol">{{lang_openingtimes}}</th>
	</tr>
	</thead>

	<tbody>
	{{#list}}
		<tr>
			<td>
				<div style="display:inline-block;width:{{depth}}em"></div>
				{{#allowed}}
				<a href="#" class="loc-name {{^depth}}slx-bold{{/depth}}" data-locationid="{{locationid}}">
				{{/allowed}}
					{{locationname}}
				{{#allowed}}
					<span class="glyphicon glyphicon-edit"></span>
				</a>
				{{/allowed}}
			</td>
			<td {{#backendMissing}}class="text-danger"{{/backendMissing}}>
				{{backend}}
			</td>
			<td class="text-center">
				{{#backend}}
					{{lastCalendarUpdate}}
				{{/backend}}
			</td>
			<td class="text-center">
				<span class="glyphicon glyphicon-{{openingGlyph}}"></span>
			</td>
		</tr>
	{{/list}}
	</tbody>
</table>

<div class="modal fade" id="location-modal" tabindex="-1" role="dialog">
	<div class="modal-dialog"> <!--style="min-width:600px;width:70%"-->

		<div class="modal-content">
			<form method="post" action="?do=locationinfo" id="settings-form">
				<input type="hidden" name="token" value="{{token}}">
				<input type="hidden" name="action" value="writeLocationConfig">
				<input type="hidden" name="openingtimes" id="json-openingtimes" value="">
				<div class="modal-header"><h2 id="location-modal-header"></h2></div>
				<div class="modal-body"></div>
				<div class="modal-footer">
					<a class="btn btn-default" data-dismiss="modal">{{lang_close}}</a>
					<button type="submit" class="btn btn-primary">{{lang_save}}</button>
				</div>
			</form>
		</div>

	</div>
</div>

<div class="hidden" id="expert-template">
	<div class="row expert-row" style="margin-top:1em;border-top:1px solid #ddd">
		<div class="col-xs-9 days-box">
			<label><input type="checkbox" class="i-Monday">{{lang_shortMonday}}</label> |
			<label><input type="checkbox" class="i-Tuesday">{{lang_shortTuesday}}</label> |
			<label><input type="checkbox" class="i-Wednesday">{{lang_shortWednesday}}</label> |
			<label><input type="checkbox" class="i-Thursday">{{lang_shortThursday}}</label> |
			<label><input type="checkbox" class="i-Friday">{{lang_shortFriday}}</label> |
			<label><input type="checkbox" class="i-Saturday">{{lang_shortSaturday}}</label> |
			<label><input type="checkbox" class="i-Sunday">{{lang_shortSunday}}</label>
		</div>
		<div class="col-xs-3 text-right">
			<label><input type="checkbox" class="i-delete"><span class="glyphicon glyphicon-trash"></span></label>
		</div>
		<div class="col-sm-6">
			<div class="input-group bootstrap-timepicker">
				<span class="input-group-addon"><span class="glyphicon glyphicon-time"></span></span>
				<input type="text" class="form-control timepicker2 i-openingtime" pattern="[0-9]{1,2}:[0-9]{2}">
			</div>
		</div>
		<div class="col-sm-6">
			<div class="input-group bootstrap-timepicker">
				<span class="input-group-addon"><span class="glyphicon glyphicon-time"></span></span>
				<input type="text" class="form-control timepicker2 i-closingtime" pattern="[0-9]{1,2}:[0-9]{2}">
			</div>
		</div>
	</div>
</div>

<script type="text/javascript"><!--

document.addEventListener("DOMContentLoaded", function () {
	/**
	 * Load a opening time modal of a location.
	 */
	$('.loc-name').click(function (e) {
		e.preventDefault();
		var locationId = $(this).data('locationid');
		var locationName = $(this).text();
		$('#location-modal-header').text("[" + locationId + "] " + locationName);
		$('#location-modal').modal('show').find('.modal-body').load("?do=locationinfo&action=config-location&id=" + locationId);
	});
	$('#settings-form').submit(submitLocationSettings);
});

//--></script>