-
Notifications
You must be signed in to change notification settings - Fork 308
/
directive.policyconditions.html
79 lines (79 loc) · 3.38 KB
/
directive.policyconditions.html
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
<div class="table-responsive">
<table class="table">
<thead>
<tr>
<th translate>Active</th>
<th translate>Section</th>
<th translate>Key</th>
<th translate>Comparator</th>
<th translate>Value</th>
</tr>
</thead>
<tr ng-repeat="condition in policyConditions">
<td>
<input type="checkbox" name="{{ conditionname }}"
ng-model="condition[4]">
</td>
<td>
<span ng-show="editIndex != $index">
<code title="{{ conditionDefs.sections[condition[0]].description }}">{{ condition[0] }}</code>
</span>
<span ng-show="editIndex == $index">
<select ng-model="condition[0]" class="form-control">
<option ng-repeat="(key, value) in conditionDefs.sections"
ng-value="key"
title="{{ value.description }}">{{ key }}</option>
</select>
</span>
</td>
<td>
<span ng-show="editIndex != $index"><code>{{ condition[1] }}</code></span>
<span ng-show="editIndex == $index">
<input type="text" ng-model="condition[1]" class="form-control" />
</span>
</td>
<td>
<span ng-show="editIndex != $index">
<code title="{{ conditionDefs.comparators[condition[2]].description }}">{{ condition[2] }}</code>
</span>
<span ng-show="editIndex == $index">
<select ng-model="condition[2]" class="form-control">
<option ng-repeat="(key, value) in conditionDefs.comparators"
ng-value="key"
title="{{ value.description }}">{{ key }}</option>
</select>
</span>
</td>
<td>
<span ng-show="editIndex != $index"><code>{{ condition[3] }}</code></span>
<span ng-show="editIndex == $index">
<input type="text" ng-model="condition[3]" class="form-control" />
</span>
</td>
<td style="text-align: right;">
<button ng-show="editIndex != $index"
class="btn btn-primary" ng-click="editCondition($index)">
<span class="glyphicon glyphicon-edit"></span>
<span translate>Edit</span>
</button>
<button ng-show="editIndex == $index"
class="btn btn-primary" ng-click="editCondition($index)">
<span class="glyphicon glyphicon-save"></span>
<span translate>Save</span>
</button>
<button class="btn btn-danger" ng-click="deleteCondition($index)">
<span class="glyphicon glyphicon-trash"></span>
<span translate>Delete</span>
</button>
</td>
</tr>
<tr>
<td colspan="6">
<button class="btn btn-default" ng-click="addCondition()">
<span class="glyphicon glyphicon-plus"></span>
<span translate>Add a condition</span>
</button>
</td>
</tr>
</table>
</div>