summaryrefslogtreecommitdiffstats
path: root/modules-available/dozmod/templates/networkrules.html
blob: 4344ff4f299d0ff0c2d9239f0f0cd9bddac7a7e4 (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
<h1>{{lang_networkrules}}</h1>

<p>
	{{lang_networkrulesIntro}}
</p>

<table class="table">
	<thead>
		<tr>
			<th>{{lang_name}}</th>
			<th>{{lang_host}}</th>
			<th>{{lang_port}}</th>
			<th>{{lang_direction}}</th>
			{{#hasEditPermissions}}
			<th class="slx-smallcol">{{lang_edit}}</th>
			<th class="slx-smallcol">{{lang_delete}}</th>
			{{/hasEditPermissions}}
		</tr>
	</thead>
	<tbody>
	{{#networkrules}}
		<tr>
			<td>{{rulename}}</td>
			<td>{{host}}</td>
			<td>{{port}}</td>
			<td>{{direction}}</td>
			{{#hasEditPermissions}}
			<td align="center">
				<a href="?do=dozmod&amp;section=networkrules&amp;show=edit&amp;ruleid={{ruleid}}" class="btn btn-xs btn-primary">
					<span class="glyphicon glyphicon-edit"></span>
				</a>
			</td>
			<td align="center">
				<button type="button" class="btn btn-xs btn-danger" data-toggle="modal" data-target="#deleteModal" onclick="deleteRule('{{ruleid}}')">
					<span class="glyphicon glyphicon-trash"></span>
				</button>
			</td>
			{{/hasEditPermissions}}
		</tr>
	{{/networkrules}}
	</tbody>
</table>
{{#hasEditPermissions}}
<div class="text-right">
	<a href="?do=dozmod&amp;section=networkrules&amp;show=edit" class="btn btn-success">
		<span class="glyphicon glyphicon-plus"></span>
		{{lang_addRule}}
	</a>
</div>
{{/hasEditPermissions}}

<!-- Modals -->
<form method="post" action="?do=dozmod">
	<input type="hidden" name="token" value="{{token}}">
	<input type="hidden" name="section" value="networkrules">
	<div class ="modal fade" id="deleteModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
		<div class="modal-dialog" role="document">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
					<h4 class="modal-title" id="myModalLabel">{{lang_delete}}</h4>
				</div>
				<div class="modal-body">
					<p>{{lang_ruleDeleteConfirm}}</p>
				</div>
				<div class="modal-footer">
					<input type="hidden" id="delete-rule-id" name="ruleid" value="">
					<button type="button" class="btn btn-default" data-dismiss="modal">{{lang_cancel}}</button>
					<button type="submit" name="action" value="delete" class="btn btn-danger"><span class="glyphicon glyphicon-trash"></span> {{lang_delete}}</button>
				</div>
			</div>
		</div>
	</div>
</form>

<script type="text/javascript">

	function deleteRule(ruleid) {
		$("#delete-rule-id").val(ruleid);
	}

</script>