[#369] git trees: fix root path

This commit is contained in:
Alexander Machehin 2015-02-09 20:47:03 +05:00
parent e49dd53f3b
commit 02dd616687
3 changed files with 5 additions and 7 deletions

View File

@ -6,12 +6,11 @@ RosaABF.controller('GitTreeCtrl', ['$scope', '$http', '$location', function($sco
$scope.breadcrumb = null;
$scope.processing = false;
$scope.init = function(project, treeish, path, root_path) {
$scope.init = function(project, treeish, path) {
$scope.project = project;
$scope.treeish = treeish;
$scope.root_path = root_path;
$scope.path = path;
//$scope.getTree();
$scope.refresh();
};
$scope.refresh = function(more) {

View File

@ -1,6 +1,6 @@
%h3= t 'layout.projects.files_in_project'
%div{ 'ng-controller' => 'GitTreeCtrl', 'ng-cloak' => true,
'ng-init' => "init('#{@project.name_with_owner}', '#{@treeish}', '#{@path}', '#{root_path}')" }
'ng-init' => "init('#{@project.name_with_owner}', '#{@treeish}', '#{@path}')" }
.files
.pull-left= render 'whereami'
.pull-right= render 'fork'

View File

@ -24,13 +24,12 @@ else
else
json.node do
options = [@project, @treeish, node_path]
if node.is_a?(Grit::Tree)
json.class_name 'fa-folder'
json.url tree_path *options
json.url tree_path(@project, "#{@treeish}/#{node_path}")
else
json.class_name 'fa-file-text-o'
json.url blob_path(*options)
json.url blob_path(@project, @treeish, node_path)
json.is_blob true
end
json.name node.name