diff --git a/app/views/projects/git/trees/_show.html.haml b/app/views/projects/git/trees/_show.html.haml index 34ae7489c..eca2c0739 100644 --- a/app/views/projects/git/trees/_show.html.haml +++ b/app/views/projects/git/trees/_show.html.haml @@ -28,7 +28,13 @@ %td{ 'ng-show' => '!el.submodule' } %span %i.fa.text-primary{ 'ng-class' => 'el.node.class_name' } - %a{ 'ng-href' => '{{el.node.url}}', 'ng-click' => 'getTree($event, el.node.path)' } {{el.node.name}} + %a{ 'ng-href' => '{{el.node.url}}', + 'ng-click' => 'getTree($event, el.node.path)', + 'ng-show' => '!el.node.is_blob' } + {{el.node.name}} + %a{ 'ng-href' => '{{el.node.url}}', + 'ng-show' => 'el.node.is_blob' } + {{el.node.name}} %td{ 'ng-show' => 'el.commit' } %a{ 'ng-href' => '{{el.commit.url}}' } {{el.commit.short_message}} %td{ 'ng-show' => 'el.commit', diff --git a/app/views/projects/git/trees/show.json.jbuilder b/app/views/projects/git/trees/show.json.jbuilder index 6647b95c4..6d805f6fa 100644 --- a/app/views/projects/git/trees/show.json.jbuilder +++ b/app/views/projects/git/trees/show.json.jbuilder @@ -12,7 +12,7 @@ else page = params[:page].to_i json.tree do - json.array!@project.tree_info(@tree, @treeish, @path, page).each do |node, node_path, commit| + json.array! @project.tree_info(@tree, @treeish, @path, page).each do |node, node_path, commit| if node.is_a? Grit::Submodule url = submodule_url(node, @treeish) json.submodule do @@ -31,6 +31,7 @@ else else json.class_name 'fa-file-text-o' json.url blob_path(*options) + json.is_blob true end json.name node.name json.path node_path