diff options
author | Leif Johansson <leifj@sunet.se> | 2010-12-03 23:46:14 +0100 |
---|---|---|
committer | Leif Johansson <leifj@sunet.se> | 2010-12-03 23:46:14 +0100 |
commit | c66fb1445796f8bf5508773d4487e428aabcdaf4 (patch) | |
tree | 2106845aaa4ffb03d04e3e91930e510f42eacacc | |
parent | fc10f1fcfdff57a9250ef18daf761d8784be92da (diff) |
moved settings
-rw-r--r-- | coip/extensions/templatetags/permdisplay.py | 21 | ||||
-rw-r--r-- | coip/settings.py (renamed from settings.py) | 0 | ||||
-rwxr-xr-x | dev-django-admin.sh | 2 | ||||
-rw-r--r-- | templates/apps/name/acls.html | 14 |
4 files changed, 36 insertions, 1 deletions
diff --git a/coip/extensions/templatetags/permdisplay.py b/coip/extensions/templatetags/permdisplay.py new file mode 100644 index 0000000..a2b347d --- /dev/null +++ b/coip/extensions/templatetags/permdisplay.py @@ -0,0 +1,21 @@ +from django import template + +register = template.Library() + +MOMENT = 120 # duration in seconds within which the time difference + # will be rendered as 'a moment ago' + +perms = {'r':'read', + 'w':'write', + 'd':'delete', + 'i':'insert', + 'l':'list'} + +def permdisplay(perm): + if perm: + return "can %s" % (' '.join([perms[p] for p in perm])) + else: + return "can do nothing" + +permdisplay.is_safe = True +register.filter(permdisplay)
\ No newline at end of file diff --git a/settings.py b/coip/settings.py index 02f3ce5..02f3ce5 100644 --- a/settings.py +++ b/coip/settings.py diff --git a/dev-django-admin.sh b/dev-django-admin.sh index 4ee21f8..e30882e 100755 --- a/dev-django-admin.sh +++ b/dev-django-admin.sh @@ -1 +1 @@ -env PYTHONPATH=`pwd`:$PHTHONPATH DJANGO_SETTINGS_MODULE=settings django-admin $* +env PYTHONPATH=`pwd`:$PHTHONPATH DJANGO_SETTINGS_MODULE=coip.settings django-admin $* diff --git a/templates/apps/name/acls.html b/templates/apps/name/acls.html new file mode 100644 index 0000000..89bbdc2 --- /dev/null +++ b/templates/apps/name/acls.html @@ -0,0 +1,14 @@ +{% extends "edit.html" %} +{% load permdisplay %} +{% block beforeform %} +<h1>Permissions on {{name}}</h1> +<table style="margin-bottom: 20px;"> +{% for ace in acl %} +<tr> + <td>Members of <a href="/name/id/{{ace.dst.id}}">{{ace.dst}} ({{ace.dst.short}})</a></td> + <td>{{ace.data|permdisplay}}</td> + <td><a href="/namelink/{{ace.id}}/remove"><span class="ui-icon ui-icon-trash"></span></td> +</tr> +{% endfor %} +</table> +{% endblock %}
\ No newline at end of file |