Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't force download #54

Open
kroomagnon opened this issue Apr 23, 2018 · 8 comments
Open

Don't force download #54

kroomagnon opened this issue Apr 23, 2018 · 8 comments

Comments

@kroomagnon
Copy link

Hi!

Please don't force downloading of the image when I try to open in new tab.

Regards,
Krisztián

@dstana
Copy link

dstana commented Jun 7, 2018

+1

1 similar comment
@ghost
Copy link

ghost commented Jul 4, 2018

+1

@ghost
Copy link

ghost commented Jul 4, 2018

@dstana looks like simple workaround of this problem is:

diff -Naur app/views/attachments/_links.html.erb-2018-07-04 app/views/attachments/_links.html.erb
--- app/views/attachments/_links.html.erb-2018-07-04    2018-07-04 07:45:40.541549108 +0000
+++ app/views/attachments/_links.html.erb       2018-07-04 07:45:47.139515615 +0000
@@ -11,7 +11,7 @@
 <tr>
   <td>
     <% if attachment.is_image? %>
-      <%= link_to_attachment attachment, :class => 'icon icon-attachment lightbox_preview', :download => true -%>
+      <%= link_to_attachment attachment, :class => 'icon icon-attachment', :download => false -%>
       </td>
       <td class="alignrigth">
       <%= link_to l(:button_view),

In any case this is fix of my issue :)

@dstana
Copy link

dstana commented Jul 4, 2018

@wwwlde What version of the plugin are you using? That row in my version looks like this:

<tr>
  <td>
    <%= link_to_attachment attachment, class: 'icon icon-attachment' -%>
    <span class="size">(<%= number_to_human_size attachment.filesize %>)</span>
    <%= link_to_attachment attachment, class: 'icon-only icon-download', title: l(:button_download), download: true -%>
  </td>
  <td><%= attachment.description unless attachment.description.blank? %></td>
  <td>
    <% if options[:author] %>
      <span class="author"><%= attachment.author %>, <%= format_time(attachment.created_on) %></span>
    <% end %>
  </td>
  <td>
    <% if options[:deletable] %>
      <%= link_to l(:button_delete), attachment_path(attachment),
                  :data => {:confirm => l(:text_are_you_sure)},
                  :method => :delete,
                  :class => 'delete icon-only icon-del',
                  :title => l(:button_delete) %>
    <% end %>
  </td>
</tr>

@ghost
Copy link

ghost commented Jul 4, 2018

@dstana Version 0.4.3 / Redmine 3.4

@dstana
Copy link

dstana commented Jul 4, 2018

@wwwlde I'm confused. The diff shows you only changed 1 line. Can you post the the rest of the contents _links.html.erb?

@ghost
Copy link

ghost commented Jul 4, 2018

@dstana
Copy link

dstana commented Jul 4, 2018

@wwwlde I was looking in the redmine app directory instead of the plugin app directory for some reason :)

Anyway that fix just disables the lightbox for the file links at the top. What I need is after the lightbox opens and you open the image in a new tab for it not to download.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants