]> source.dussan.org Git - redmine.git/commitdiff
Don't display download button for dir entries (#26350).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Thu, 6 Jul 2017 16:45:06 +0000 (16:45 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Thu, 6 Jul 2017 16:45:06 +0000 (16:45 +0000)
Patch by Mischa The Evil.

git-svn-id: http://svn.redmine.org/redmine/trunk@16762 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/views/repositories/_navigation.html.erb
test/functional/repositories_git_controller_test.rb

index 0cbb94ae68291d06292b12aa509e2bfd49a62571..0bd6e33cf5c5c3546ad7a9739dd71b0bd753a8f0 100644 (file)
@@ -2,7 +2,7 @@
   <%= javascript_include_tag 'repository_navigation' %>
 <% end %>
 
-<% if @entry && @repository.supports_cat? %>
+<% if @entry && !@entry.is_dir? && @repository.supports_cat? %>
   <% download_label = @entry.size ? "#{l :button_download} (#{number_to_human_size @entry.size})" : l(:button_download) %>
   <%= link_to(download_label,
               {:action => 'raw', :id => @project,
index 29d1a55210965cdbda793b88f79f6b86d4e8c119..c7cd7bce26348c1d6d39338ebbd8f685dc187ec0 100644 (file)
@@ -277,6 +277,8 @@ class RepositoriesGitControllerTest < Redmine::ControllerTest
       assert_response :success
       assert_select 'h2 a', :text => 'sources'
       assert_select 'table.entries tbody'
+      assert_select 'div.contextual > a.icon-download', false
+
     end
 
     def test_diff