paginagmbh / redmine_lightbox2

Lightbox for image attachments in Redmine
MIT License
126 stars 97 forks source link

Redmine 4.2 and Download attachments at once #86

Open rafaelmartinsrm opened 3 years ago

rafaelmartinsrm commented 3 years ago

When using redmine 4.2, the button to download all attachments at once is not being shown.

testowyludek1234 commented 2 years ago

87 I have uploaded pull request which should fix the issue. I used following method to find difference was:

diff -u redmine-4.2.3/app/views/attachments/_links.html.erb redmine-4.1.5/app/views/attachments/_links.html.erb

And that shows what missing:

--- redmine-4.2.3/app/views/attachments/_links.html.erb 2021-10-10 05:00:35.000000000 +0200
+++ redmine-4.1.5/app/views/attachments/_links.html.erb 2021-10-10 05:00:05.000000000 +0200
@@ -5,11 +5,6 @@
               :title => l(:label_edit_attachments),
               :class => 'icon-only icon-edit'
              ) if options[:editable] %>
-  <%= link_to(l(:label_download_all_attachments),
-              container_attachments_download_path(container),
-              :title => l(:label_download_all_attachments),
-              :class => 'icon-only icon-download'
-             ) if attachments.size > 1 %>
 </div>
 <table>
 <% for attachment in attachments %>

Further more repo owner @tofi86 should consider to find some better method to provide modifications than rewriting whole template because this will always lead to similar problem when upstream changes anything. I don't know if this is possible in Ruby/Rails/Redmine but should be considered if it is.

testowyludek1234 commented 2 years ago

Also important note that this fix will make this plugin Redmine 4.2+ only, since there is any version checking to decide where button should or should not be presented. Redmine 4.2 also added controller that is required for download all functionality to zip attachments on the fly through zip stream.