diff options
author | Dan McGee <dan@archlinux.org> | 2011-03-03 21:59:04 +0100 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2011-03-03 21:59:04 +0100 |
commit | 8b77efbfabfb3d65b0400e123025c02346454214 (patch) | |
tree | bd9457f27b57b9434d16ac284e4df86013469cb7 /templates/todolists | |
parent | 710ec0a9de9a2185621cd7f51cdd2a056e12f999 (diff) | |
download | archweb-8b77efbfabfb3d65b0400e123025c02346454214.tar.gz archweb-8b77efbfabfb3d65b0400e123025c02346454214.tar.xz |
Template fine-grained permissioning
Rather than use user.is_authenticated, rely on certain permissions being
set for the user. This allows us to open up the developer side and not
assume everyone is a package maintainer.
Allow all logged-in users to still view todo lists, but don't show the
complete/incomplete links (only the text) unless they are allowed to
mess with todo lists.
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'templates/todolists')
-rw-r--r-- | templates/todolists/view.html | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/templates/todolists/view.html b/templates/todolists/view.html index ec8c997..36ecb9b 100644 --- a/templates/todolists/view.html +++ b/templates/todolists/view.html @@ -38,6 +38,7 @@ <td>{{ pkg.pkg.repo.name|capfirst }}</td> <td>{{ pkg.pkg.maintainers|join:', ' }}</td> <td> + {% if perms.main.change_todolistpkg %} {% if pkg.complete %} <a href="/todo/flag/{{ list.id }}/{{ pkg.id }}/" class="status-link complete" title="Toggle completion status">Complete</a> @@ -45,6 +46,9 @@ <a href="/todo/flag/{{ list.id }}/{{ pkg.id }}/" class="status-link incomplete" title="Toggle completion status">Incomplete</a> {% endif %} + {% else %} + {% if pkg.complete %}<span class="complete">Complete</span>{% else %}<span class="incomplete">Incomplete</span>{% endif %} + {% endif %} </td> </tr> {% endfor %} |