You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by je...@apache.org on 2015/07/14 17:02:58 UTC
[17/50] [abbrv] allura git commit: [#7540] ticket:816 Show attachment
links for comment
[#7540] ticket:816 Show attachment links for comment
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/fb7adce3
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/fb7adce3
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/fb7adce3
Branch: refs/heads/ib/7897
Commit: fb7adce380ce6a600203ff0fc1abe7bbef120f9f
Parents: 9d7b26e
Author: Igor Bondarenko <je...@gmail.com>
Authored: Wed Jul 8 15:00:45 2015 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Mon Jul 13 20:01:44 2015 +0000
----------------------------------------------------------------------
Allura/allura/model/notification.py | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/fb7adce3/Allura/allura/model/notification.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/notification.py b/Allura/allura/model/notification.py
index ca1a850..01482f0 100644
--- a/Allura/allura/model/notification.py
+++ b/Allura/allura/model/notification.py
@@ -157,15 +157,18 @@ class Notification(MappedClass):
text = kwargs.get('text') or post.text
file_info = kwargs.pop('file_info', None)
if file_info is not None:
- text = "%s\n\n\nAttachment:" % text
+ text = "%s\n\n\nAttachments:\n" % text
if not isinstance(file_info, list):
file_info = [file_info]
for attach in file_info:
attach.file.seek(0, 2)
bytecount = attach.file.tell()
attach.file.seek(0)
- text = "%s %s (%s; %s) " % (
- text, attach.filename, h.do_filesizeformat(bytecount), attach.type)
+ url = h.absurl('{}attachment/{}'.format(
+ post.url(), h.urlquote(attach.filename)))
+ text = "%s\n- [%s](%s) (%s; %s)" % (
+ text, attach.filename, url,
+ h.do_filesizeformat(bytecount), attach.type)
subject = post.subject or ''
if post.parent_id and not subject.lower().startswith('re:'):