Parent: [0d6290] (diff)

Child: [5b5a63] (diff)

Download this file

neighborhood_admin_permissions.html    82 lines (74 with data), 2.9 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
{% extends g.theme.master %}
{% block extra_css %}
<link rel="stylesheet" type="text/css" media="screen" href="{{g.forge_static('css/forge/accordion.css')}}" />
{% endblock %}
{% block title %}{{neighborhood.name}} / Permissions{% endblock %}
{% block header %}Permissions for {{neighborhood.name}}{% endblock %}
{% block nav_menu %}
{% include 'jinja_master/neigh_nav_menu.html' %}
{% endblock %}
{% block top_nav %}
{% include 'jinja_master/neigh_top_nav.html' %}
{% endblock %}
{% block content %}
<p>The ACL determines neighborhood-level permissions.</p>
<div id="acl-admin">
{% for permission, users in neighborhood.acl.iteritems() %}
<h3><a href="#" id="permission_{{permission}}">Permission: {{permission}}</a></h3>
<div>
<form method="POST" action="update_acl">
<input type="hidden" name="permission" value="{{permission}}"/>
{% for uid in users %}
<input type="hidden" name="user-{{loop.index0}}.id" value="{{uid}}"/>
{% endfor %}
<table>
<thead>
<tr><th>Username</th><th></th></tr>
</thead>
<tbody>
{% for u in h.make_users(users) %}
<tr>
<td>{{u.username}}</td>
<td><input type="submit" value="Remove" name="user-{{loop.index0}}.delete" /></td>
</tr>
{% endfor %}
<tr>
<td>
<input name="new.username"/>
</td>
<td>
<input type="submit" name="new.add" value="Add Permission"/>
</td>
</tr>
</tbody>
</table>
</form>
</div>
{% endfor %}
</div>
{% endblock %}
{% block extra_js %}
<script type="text/javascript">
$(function () {
$("#acl-admin").accordion({
autoHeight: false,
navigation: true,
change: function(event,ui) {
var hid = ui.newHeader.children('a').attr('id');
if (hid === undefined) {
$.cookie('neighborhood-acl-admin', null);
} else {
$.cookie('neighborhood-acl-admin', hid, { path: '/', expires: 2 });
}
}
});
});
$(document).ready(function () {
if($.cookie('neighborhood-acl-admin')) {
$('#acl-admin').accordion('option', 'animated', false)
.accordion('activate', $('#' + $.cookie('neighborhood-acl-admin')).parent('h3'))
.accordion('option', 'animated', 'slide');
}
});
</script>
{% endblock %}