summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-11-02 09:47:02 -0500
committerDan McGee <dan@archlinux.org>2011-11-03 17:33:40 -0500
commite3e3e498765ab416a2902adf114cd3270e3eb12e (patch)
tree5046795ff9f2e4d33e4555f08d3462b3f2d06efe
parent9a5410ba4b622b68306de53abfa28b5a49e30107 (diff)
Add URL to todolist email
Signed-off-by: Dan McGee <dan@archlinux.org>
-rw-r--r--main/models.py5
-rw-r--r--templates/todolists/email_notification.txt9
2 files changed, 10 insertions, 4 deletions
diff --git a/main/models.py b/main/models.py
index d55a9673..972b098c 100644
--- a/main/models.py
+++ b/main/models.py
@@ -470,6 +470,11 @@ class Todolist(models.Model):
def get_absolute_url(self):
return '/todo/%i/' % self.id
+ def get_full_url(self, proto='https'):
+ '''get a URL suitable for things like email including the domain'''
+ domain = Site.objects.get_current().domain
+ return '%s://%s%s' % (proto, domain, self.get_absolute_url())
+
class TodolistPkg(models.Model):
list = models.ForeignKey(Todolist)
pkg = models.ForeignKey(Package)
diff --git a/templates/todolists/email_notification.txt b/templates/todolists/email_notification.txt
index 10b50f64..8b22b465 100644
--- a/templates/todolists/email_notification.txt
+++ b/templates/todolists/email_notification.txt
@@ -1,10 +1,11 @@
-{% autoescape off %}The todo list {{ todolist.name }} has had the following packages added to it for which you are a maintainer:
+{% autoescape off %}The todo list "{{ todolist.name }}" has had the following packages added to it for which you are a maintainer:
{% 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}}
+Name: {{ todolist.name }}
+URL: {{ todolist.get_full_url }}
+Creator: {{ todolist.creator.get_full_name }}
Description:
-{{todolist.description|striptags|wordwrap:69}}{% endautoescape %}
+{{ todolist.description|striptags|wordwrap:78 }}{% endautoescape %}