From 8b77efbfabfb3d65b0400e123025c02346454214 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Thu, 3 Mar 2011 14:59:04 -0600 Subject: 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 --- templates/todolists/view.html | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'templates/todolists') 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 @@ {{ pkg.pkg.repo.name|capfirst }} {{ pkg.pkg.maintainers|join:', ' }} + {% if perms.main.change_todolistpkg %} {% if pkg.complete %} Complete @@ -45,6 +46,9 @@ Incomplete {% endif %} + {% else %} + {% if pkg.complete %}Complete{% else %}Incomplete{% endif %} + {% endif %} {% endfor %} -- cgit v1.2.3-2-g168b From 65e965c8f76677904f5d98965e13bf89726247d4 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Fri, 4 Mar 2011 12:39:53 -0600 Subject: Send only one email per todolist Customize each email on a per-maintainer basis and list all the relevant packages inside, rather than spamming people. Signed-off-by: Dan McGee --- templates/todolists/email_notification.txt | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'templates/todolists') diff --git a/templates/todolists/email_notification.txt b/templates/todolists/email_notification.txt index abe1dbf3..1825912c 100644 --- a/templates/todolists/email_notification.txt +++ b/templates/todolists/email_notification.txt @@ -1,14 +1,9 @@ -{% autoescape off %}* Note: this is an automated message +{% autoescape off %}The todo list {{ todolist.name }} has had the following packages added to it for which you are a maintainer: -The following package: - - Package Name: {{ pkg.pkgname }} - Architecture: {{ pkg.arch.name }} - Repository: {{ pkg.repo.name }} - ({{ weburl }}) - -has been added to this todo list: +{% for tpkg in todo_packages %} +{{ tpkg.pkg.repo.name|lower }}/{{ tpkg.pkg.pkgname }} ({{ tpkg.pkg.arch.name }}) - {{ tpkg.pkg.get_full_url }}{% endfor %} +Todo list information: Creator: {{todolist.creator.get_full_name}} Name: {{todolist.name}} Description: -- cgit v1.2.3-2-g168b