Parent: [265cb3] (diff)

Download this file

admin_permissions.html    93 lines (88 with data), 3.0 kB

 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
{% extends g.theme.master %}
{% do g.register_forge_css('css/forge/accordion.css') %}
{% block extra_js %}
<script type="text/javascript">
$(function() {
$("#acl-admin").accordion({
autoHeight: false,
change: function(event,ui) {
var hid = ui.newHeader.children('a').attr('id');
if (hid === undefined) {
$.cookie('tracker-acl-admin', null);
} else {
$.cookie('tracker-acl-admin', hid, { path: '/', expires: 2 });
}
}
});
});
$(document).ready(function(){
if($.cookie('tracker-acl-admin')) {
$('#acl-admin').accordion('option', 'animated', false)
.accordion('activate', $('#' + $.cookie('tracker-acl-admin')).parent('h3'))
.accordion('option', 'animated', 'slide');
}
});
</script>
{% endblock %}
{% block title %}{{c.project.name}} / {{app.config.options.mount_label}} / Admin Permissions{% endblock %}
{% block header %}{{app.config.options.mount_label}} Admin Permissions{% endblock %}
{% block content %}
{% if app.permissions and allow_config %}
<div id="acl-admin">
{% for p in app.permissions %}
<h3><a href="#" id="permission_{{p}}">{{p}}</a></h3>
<div>
<table>
<thead>
<tr>
<th>Role</th>
<th/>
</tr>
</thead>
<tbody>
{% for role in h.make_roles(app.config.acl[p]) %}
<tr>
<td>{{role.display()}}</td>
<td>
<form method="POST" action="del_perm" style="display:inline">
<input type="hidden" name="permission" value="{{p}}"/>
<input type="hidden" name="role" value="{{role._id}}"/>
{% if role.display() != '*user-'+c.user.username %}
<input type="submit" value="Remove"/>
{% endif %}
</form>
</td>
</tr>
{% endfor %}
<tr>
<form method="POST" action="add_perm">
<td>
<select name="role">
{% for role in c.project.roles %}
<option value="{{role._id}}">{{role.display()}}</option>
{% endfor %}
</select>
</td>
<td>
<input type="hidden" name="permission" value="{{p}}"/>
<input type="submit" value="Add Permission"/>
</td>
</form>
</tr>
</tbody>
</table>
</div>
{% endfor %}
</div>
{% endif %}
{% endblock %}
{% block extra_css %}
<style type="text/css">
div.custom-field {
cursor: move;
border:1px solid #ccc;
margin:2px;
padding:2px;
}
</style>
{% endblock %}