From 435b3bfce9d591a459c071aba7ac1b9eecd4c6b0 Mon Sep 17 00:00:00 2001 From: Alexander Machehin Date: Mon, 10 Nov 2014 13:37:47 +0500 Subject: [PATCH] [#369] fix error: undefined method 'contents' for # '!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