allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hei...@apache.org
Subject [4/6] allura git commit: [#6017] ticket:756 Show attachments list as a diff, so it's easy to see what was added or removed
Date Thu, 16 Apr 2015 16:28:49 GMT
[#6017] ticket:756 Show attachments list as a diff, so it's easy to see what was added or removed


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/9546f5ae
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/9546f5ae
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/9546f5ae

Branch: refs/heads/master
Commit: 9546f5ae425c02cd21266a047a2b34ebb50bbf5e
Parents: da94700
Author: Igor Bondarenko <jetmind2@gmail.com>
Authored: Thu Apr 16 11:04:23 2015 +0000
Committer: Igor Bondarenko <jetmind2@gmail.com>
Committed: Thu Apr 16 11:04:23 2015 +0000

----------------------------------------------------------------------
 ForgeTracker/forgetracker/data/ticket_changed_tmpl |  4 ++--
 ForgeTracker/forgetracker/tracker_main.py          | 11 ++++++-----
 2 files changed, 8 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/9546f5ae/ForgeTracker/forgetracker/data/ticket_changed_tmpl
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/data/ticket_changed_tmpl b/ForgeTracker/forgetracker/data/ticket_changed_tmpl
index 899b353..c04d92d 100644
--- a/ForgeTracker/forgetracker/data/ticket_changed_tmpl
+++ b/ForgeTracker/forgetracker/data/ticket_changed_tmpl
@@ -20,8 +20,8 @@
 {% python from allura.model import User %}\
 {% for key, values in changelist %}\
 {% choose %}\
-{% when key == 'description' %}\
-- Description has changed:
+{% when key in ['description', 'attachments'] %}\
+- ${key.capitalize()} has changed:
 
 Diff:
 

http://git-wip-us.apache.org/repos/asf/allura/blob/9546f5ae/ForgeTracker/forgetracker/tracker_main.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tracker_main.py b/ForgeTracker/forgetracker/tracker_main.py
index 7558eab..f8a5680 100644
--- a/ForgeTracker/forgetracker/tracker_main.py
+++ b/ForgeTracker/forgetracker/tracker_main.py
@@ -1391,12 +1391,13 @@ class TicketController(BaseController, FeedController):
     @require_post()
     def _update_ticket(self, post_data):
         def attachments_info(attachments):
-            text = ''
+            text = []
             for attach in attachments:
-                text = "%s %s (%s; %s) " % (
-                    text, attach.filename,
-                    h.do_filesizeformat(attach.length), attach.content_type)
-            return text
+                text.append("{} ({}; {})".format(
+                    attach.filename,
+                    h.do_filesizeformat(attach.length),
+                    attach.content_type))
+            return "\n".join(text)
 
         require_access(self.ticket, 'update')
         changes = changelog()


Mime
View raw message