Edgewall Software
Modify

Opened 12 years ago

Closed 11 years ago

Last modified 11 years ago

#5718 closed enhancement (fixed)

Add a direct "raw" download link to the attachments section of a ticket view.

Reported by: david@… Owned by: Marcin Wojdyr <wojdyr@…>
Priority: normal Milestone: 0.11.5
Component: attachment Version:
Severity: minor Keywords: attachment
Cc: wojdyr@…, vz-trac@… Branch:
Release Notes:
API Changes:

Description

When creating a bug ticket, our customers oftentimes attach project files that illustrate the problems. It would save our developers time to be able to download these attachments with one click (instead of a click, a scroll down, another click, and a back-button press).

Attachments (12)

downloadUnrenderableAttachments.patch (632 bytes ) - added by tedfordgif@… 12 years ago.
Implements enhancement described in this ticket.
downloadUnrenderableAttachments.2.patch (1.3 KB ) - added by tedfordgif@… 12 years ago.
Added link to attachment lists to delete attachments (when permissions allow).
downloadUnrenderableAttachments.2.2.patch (1.3 KB ) - added by Ivan 11 years ago.
d
raw-download-link.diff (760 bytes ) - added by Marcin Wojdyr <wojdyr@…> 11 years ago.
one-line patch that adds a direct raw link
download.gif (92 bytes ) - added by Marcin Wojdyr <wojdyr@…> 11 years ago.
tiny download icon
Screenshot.png (14.3 KB ) - added by Marcin Wojdyr <wojdyr@…> 11 years ago.
screenshot - how attachment list with raw-download icons looks like
raw-download-link2.diff (2.1 KB ) - added by Marcin Wojdyr <wojdyr@…> 11 years ago.
updated patch adding icon links in two places
download.2.gif (95 bytes ) - added by Marcin Wojdyr <wojdyr@…> 11 years ago.
2px higher icon
Screenshot.2.png (21.3 KB ) - added by Marcin Wojdyr <wojdyr@…> 11 years ago.
updated screenshot
raw-download-link2.2.diff (2.1 KB ) - added by Marcin Wojdyr <wojdyr@…> 11 years ago.
the previous patch doesn't work, this should work
5718-download-link-all-r8173.patch (1.8 KB ) - added by Remy Blank 11 years ago.
Patch adding a download icon to all links to attachments.
attachment-trac-links.png (10.3 KB ) - added by Christian Boos 11 years ago.
sample of Wiki content with attachment: links, using latest patch

Download all attachments as: .zip

Change History (33)

comment:1 by Christian Boos, 12 years ago

Keywords: attachment added
Milestone: 0.12
Owner: changed from Jonas Borgström to Christian Boos
Severity: normalminor

#6132 was closed as duplicate.

comment:2 by anonymous, 12 years ago

related Ticket #6447 and #2883

by tedfordgif@…, 12 years ago

Implements enhancement described in this ticket.

comment:3 by tedfordgif@…, 12 years ago

Actually, my patch doesn't add a new link. It instead redirects unrenderable attachments (wiki, tickets) to the raw download facility.

by tedfordgif@…, 12 years ago

Added link to attachment lists to delete attachments (when permissions allow).

comment:4 by anonymous, 11 years ago

Owner: changed from Christian Boos to anonymous
Status: newassigned

comment:5 by wojdyr@…, 11 years ago

Cc: wojdyr@… added
Owner: changed from anonymous to Christian Boos
Status: assignednew

The attachments don't implement the feature requested in this ticket. The two last attachments (.2.patch and .2.2.patch) are the same.

Download button would definitely improve usability, several users asked about it for wxTrac, some of them reportedly prefer to type directly URL (…/raw-attachment/…) instead of clicking and scrolling.

It seems to me that the change by anonymous user in comment 4: changed owner from cboos to anonymous was unintended, so I'm changing it back.

comment:6 by Christian Boos, 11 years ago

Milestone: 0.130.12

comment:7 by anonymous, 11 years ago

Resolution: fixed
Status: newclosed

The patches are not required, this is a documentation bug in trac. So, this ticket should be closed:

  1. If you do not want "Content-Disposition: attachment" to be sent, make render_unsafe_content = true. You need to do this in the correct section, I put it in all these section: ![browser], ![wiki] and ![attachment]
  1. If you do not want trac to display "unknown/cannot render page, try to download" page for pdf/msword, then use attach.pdf instead of attach.pdf. You do not need to muck with the absolute URL!

It took me some time to figure these out and you don't need any plugins or patches IMHO.

in reply to:  7 comment:8 by anonymous, 11 years ago

Still new to trac, messed up formatting: Use [raw-attachment:attach.pdf] instead of [attachment:attach.pdf].

comment:9 by Remy Blank, 11 years ago

Resolution: fixed
Status: closedreopened

Please don't close tickets as "fixed" unless you have actually committed a fix for the issue.

by Marcin Wojdyr <wojdyr@…>, 11 years ago

Attachment: raw-download-link.diff added

one-line patch that adds a direct raw link

by Marcin Wojdyr <wojdyr@…>, 11 years ago

Attachment: download.gif added

tiny download icon

by Marcin Wojdyr <wojdyr@…>, 11 years ago

Attachment: Screenshot.png added

screenshot - how attachment list with raw-download icons looks like

comment:10 by Marcin Wojdyr <wojdyr@…>, 11 years ago

Hello, I'm not familiar with Trac code, so I may have overlooked something, but it seems to me that it's enough to add one line to templates/macros.html to implement this feature. IMO download icon looks better than textual description for this, so I made a simple icon tiny download icon based on extlink.gif.

That's how attachment list looks like with additional icon: screenshot - how attachment list with raw-download icons looks like

comment:11 by Remy Blank, 11 years ago

This looks very good IMO. Maybe the icon should be made a bit taller, and the CSS trimmed so that there is no dotted line underneath, but that's a matter of taste.

comment:12 by VZ, 11 years ago

Cc: vz-trac@… added

Marcin's patch is already very useful but it would be even more convenient to also have the download icon near the "attachment foo.bar added" sentence in the comments themselves and not only in the attachments frame in the top.

TIA!

by Marcin Wojdyr <wojdyr@…>, 11 years ago

Attachment: raw-download-link2.diff added

updated patch adding icon links in two places

by Marcin Wojdyr <wojdyr@…>, 11 years ago

Attachment: download.2.gif added

2px higher icon

by Marcin Wojdyr <wojdyr@…>, 11 years ago

Attachment: Screenshot.2.png added

updated screenshot

by Marcin Wojdyr <wojdyr@…>, 11 years ago

Attachment: raw-download-link2.2.diff added

the previous patch doesn't work, this should work

comment:13 by Marcin Wojdyr <wojdyr@…>, 11 years ago

rblank: I think you are right about removing underline and making the icon higher. The updated proposal, with raw attachment icons also in Change History, looks like this: updated screenshot

BTW this change is tested in wxTrac.

comment:14 by Remy Blank, 11 years ago

Looks great!

Christian, if you don't mind, I'll integrate this shortly into 0.11-stable.

comment:15 by Christian Boos, 11 years ago

Component: generalattachment
Milestone: 0.120.11.5
Owner: changed from Christian Boos to Marcin Wojdyr <wojdyr@…>
Status: reopenednew

I don't mind at all, I like this as well.

The only thing I'm left wondering is if we couldn't push this further and add the icon to the attachment:... TracLinks as well. I think that will be quite useful on Wiki page describing installation procedures, for example. The advantage of this upon raw-attachment:... links is that you can also easily access the attachment meta-data page (not to mention that raw-attachment: is probably lesser known that attachment:).

comment:16 by Remy Blank, 11 years ago

Patch applied in [8173] with a few minor changes:

  • Used a trac- prefix for the new CSS class (#5997).
  • Put the CSS into trac.css, as wiki pages can also have attachments.
  • Hide the icon when printing.
  • Changed the alt= of the image to the same text as the link title, as IE displays the alt text.
  • Converted the image to .png as most of our images are in that format.

Thanks for the excellent patch!

Next, I'll test the idea in comment:15 to add the icon to attachment: links as well.

by Remy Blank, 11 years ago

Patch adding a download icon to all links to attachments.

comment:17 by Remy Blank, 11 years ago

The patch above adds a download icon to all attachment: links. I think it's a nice addition. I'm not quite sure about the link title, "Original format" (the same as in the list of attachments) is not quite descriptive. Maybe I should change it to "Download".

Opinions?

in reply to:  17 comment:18 by Marcin Wojdyr <wojdyr@…>, 11 years ago

Replying to rblank:

The patch above adds a download icon to all attachment: links. I think it's a nice addition. I'm not quite sure about the link title, "Original format" (the same as in the list of attachments) is not quite descriptive. Maybe I should change it to "Download".

FWIW I agree, "Download" seems to be a better name (also in the list of attachments)

by Christian Boos, 11 years ago

Attachment: attachment-trac-links.png added

sample of Wiki content with attachment: links, using latest patch

comment:19 by Christian Boos, 11 years ago

Looks good! Example:

sample of Wiki content with attachment: links, using latest patch

Download would be better, yes.

comment:20 by Remy Blank, 11 years ago

Resolution: fixed
Status: newclosed

Added the download icon to all attachment: links in [8174].

comment:21 by Christian Boos, 11 years ago

Cool, thanks!

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Marcin Wojdyr <wojdyr@…>.
The resolution will be deleted. Next status will be 'reopened'.
to as closed The owner will be changed from Marcin Wojdyr <wojdyr@…> to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.