summaryrefslogtreecommitdiff
path: root/templates/todolists
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-03-03 14:59:04 -0600
committerDan McGee <dan@archlinux.org>2011-03-03 14:59:04 -0600
commit8b77efbfabfb3d65b0400e123025c02346454214 (patch)
treebd9457f27b57b9434d16ac284e4df86013469cb7 /templates/todolists
parent710ec0a9de9a2185621cd7f51cdd2a056e12f999 (diff)
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.html4
1 files changed, 4 insertions, 0 deletions
diff --git a/templates/todolists/view.html b/templates/todolists/view.html
index ec8c997a..36ecb9bf 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 %}