summaryrefslogtreecommitdiffstats
path: root/modules-available/usblockoff/templates/usb-configuration-table.html
blob: eb3a8839883c569f1348e8febc19a1aaa637938f (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
<div class="container-fluid">
	<div class="row">
		<div class="col-md-12">
			<div class="page-header">
				<h1>{{lang_usb-lock-off}}</h1>
			</div>
		</div>
	</div>
	<div class="row">
		<div class="col-md-12">
			<table id="configurationTable" class="table table-condensed table-hover stupidtable">
				<thead>
					<tr>
						<th data-sort="string">{{lang_serverName}}</th>
						<th>{{lang_ruleInfoTODO}}</th>
						<th>{{lang_edit}}</th>
						<th>{{lang_delete}}</th>
					</tr>
				</thead>
				<tbody>
					{{#config_list}}
					<tr>
						<td data-sort-value="{{config_name}}">{{config_name}}</td>
						<td>TODO: Show Rule information here</td>
						<td>
							<a class="btn btn-xs btn-info" href="?do=usblockoff&amp;show=edit-config&amp;configid={{config_id}}">
								<span class="glyphicon glyphicon-edit"></span>
							</a>
						</td>
						<td>
							<a class="btn btn-xs btn-danger" onclick="deleteConfig(event, {{config_id}});">
								<span class="glyphicon glyphicon-trash"></span>
							</a>
						</td>
					</tr>
					{{/config_list}}
				</tbody>
			</table>
			<div class="buttonbar text-right">
				<a class="btn btn-success" href="?do=usblockoff&amp;show=edit-config&amp;configid=new-default">
					<span class="glyphicon glyphicon-plus"></span>
					{{lang_configuration}}
				</a>
			</div>
		</div>
	</div>
</div>

<script>
	function deleteConfig(event, id) {
		event.preventDefault();

		BootstrapDialog.confirm({
			title: '{{lang_delete}}',
			message: '{{lang_deleteConfigMessage}}',
			type: BootstrapDialog.TYPE_DANGER, // <-- Default value is BootstrapDialog.TYPE_PRIMARY
			closable: false, // <-- Default value is false
			draggable: false, // <-- Default value is false
			btnCancelLabel: '{{lang_cancel}}', // <-- Default value is 'Cancel',
			btnOKLabel: '<span class="glyphicon glyphicon-trash"></span> {{lang_delete}}', // <-- Default value is 'OK',
			btnOKClass: 'btn-danger', // <-- If you didn't specify it, dialog type will be used,
			callback: function (result) {
				if (result) {
					url = "?do=usblockoff&action=deleteConfig&id=" + id;
					window.location = url;
				}
			}
		});
	}
</script>