-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathpolicymgr.html
98 lines (95 loc) · 3.68 KB
/
policymgr.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
{% extends 'base.html' %}
{% block title %}Policy Manager{% endblock %}
{% block morehead %}
<link rel="stylesheet" href="/bags/tank/tiddlers/policymgr.css">
{% endblock %}
{% block body %}
<header>
{% include 'logout.html' %}
<span class="wikititle">Policy Manager</span>
</header>
{% raw %}
<main ng-cloak ng-app="app">
<p><a href="/tanks/docs/Policy%20Manager">Help with Policy Manager</a></p>
<div class="tiddlers" ng-controller="TiddlersCtrl" ng-show="tank">
<h2>Tiddlers in {{ tank }}</h2>
<input type="text" ng-model="tiddlersFilterText" size="30"
placeholder="Filter Tiddlers">
<ul>
<li ng-repeat="tiddler in tiddlers | filter:tiddlersFilterText | orderBy:'title'">
<a href="/tanks/{{tiddler.bag|escape}}/{{tiddler.title|escape}}">
{{tiddler.title}}</a>
<em>{{tiddler.type}}</em>
<abbr class="modified" title="{{ tiddler.modified | twstamp }}" timeago="{{ tiddler.modified | twstamp }}"></abbr>
</li>
</ul>
</div>
<div class="output">
<div class="tanks" ng-controller="TanksCtrl">
<input type="text" ng-model="tankFilterText" size="30"
placeholder="Filter Tanks">
<ul class="fa-ul" ng-cloak>
<li class="tanklist"
ng-repeat="tank in tanks | filter:tankFilterText | orderBy:'name'">
<i class='commandicon fa fa-fw fa-sitemap'
ng-click='showTiddlers(tank)'></i>
<i class='commandicon fa fa-fw fa-trash-o' ng-show='tank.deleter'
ng-click='deleteTank(tank)'></i>
<i class="fa fa-li {{tank.icon}}"></i> <a href="#/{{tank.name|escape}}">{{tank.name}}</a>
</li>
</ul>
</div>
<div class="tank" ng-show="tank" ng-controller="TankCtrl">
<h1><i title="{{tank.type}}" class="fa {{tank.icon}}"></i>
{{tank.name}}
<i ng-click='startEditor()' title="edit" class="editicon fa fa-pencil"></i>
</h1>
<p>Owner: {{tank.policy.owner}}</p>
<p>{{tank.desc}}</p>
<table>
<tr><th>Constraint</th><th>Members</th></tr>
<tr ng-repeat="constraint in constraints">
<td>{{constraint}}</td>
<td>
<span ng-if="tank.policy[constraint].length" class="member"
ng-repeat="member in tank.policy[constraint]">{{member}}</span>
<span ng-if="!tank.policy[constraint].length" class="member">everyone</span>
</td>
</tr>
</table>
</div>
<div class="editor" ng-show="editTank" ng-controller="TankEditor">
<h1><i title="{{editTank.type}}" class="fa {{editTank.icon}}"></i>
{{editTank.name}}
<i ng-click='saveTank()' title="save" class="editicon fa fa-check"></i>
<i ng-click='cancelEditor()' title="cancel" class="editicon fa fa-times"></i>
</h1>
<form>
<p><label>Owner:
<input name="owner" ng-model="editTank.policy.owner"></label></p>
<p><label>Description:
<input name="desc" ng-model="editTank.desc"></label></p>
<p>Make:
<label ng-hide="type == 'custom'" ng-repeat="type in policyTypes">
<input ng-click="changePolicy(type)" name="policytype" type="radio" value="{{type}}"
ng-model="editTank.type">
{{type}}
</label>
<table>
<tr><th>Constraint</th><th>Members</th></tr>
<tr ng-repeat="constraint in constraints">
<td>{{constraint}}</td>
<td>
<input placeholder="everyone" name="members" ng-list ng-model="editTank.policy[constraint]">
</td>
</tr>
</table>
</div>
</div>
</main>
{% endraw %}
{% endblock %}
{% block scripts %}
<script src="/bags/tank/tiddlers/angular.min.js"></script>
<script src="/bags/tank/tiddlers/policymgr.js"></script>
{% endblock %}