Commits

Anonymous committed cbabac7

Improved display of attachment search matches.

Contributed by Remy Blank, finalizes #2561.

Comments (0)

Files changed (2)

  * Christopher Armstrong          radix
  * Jani Averbach                  jaa@jaa.iki.fi
  * Juanma Barranquero             lektu@terra.es
+ * Remy Blank                     remy.blank@pobox.com
  * Christian Boos                 cboos@bct-technology.com
  * Rocky Burt                     rocky.burt@myrealbox.com
  * Toni Brkic                     toni.brkic@switchcore.com

trac/attachment.py

             attachment = resource_realm(id=id).child('attachment', filename)
             if 'ATTACHMENT_VIEW' in req.perm(attachment):
                 yield (get_resource_url(self.env, attachment, req.href),
-                       "%s: %s" % (get_resource_shortname(self.env, 
-                                                          attachment.parent),
-                                   filename),
+                       get_resource_shortname(self.env, attachment),
                        datetime.fromtimestamp(time, utc), author,
                        shorten_result(desc, terms))
     
 
     def get_resource_description(self, resource, format=None, **kwargs):
         if format == 'compact':
-            return '%s:%s' % (get_resource_shortname(self.env,
-                                                     resource.parent),
-                              resource.filename)
+            return '%s (%s)' % (resource.id,
+                    get_resource_name(self.env, resource.parent))
         elif format == 'summary':
             return Attachment(self.env, resource).description
         if resource.id: