From e3e3e498765ab416a2902adf114cd3270e3eb12e Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Wed, 2 Nov 2011 09:47:02 -0500 Subject: Add URL to todolist email Signed-off-by: Dan McGee --- main/models.py | 5 +++++ templates/todolists/email_notification.txt | 9 +++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/main/models.py b/main/models.py index d55a967..972b098 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 10b50f6..8b22b46 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 %} -- cgit v1.2.3-24-g4f1b