BigW Consortium Gitlab

Commit 56d15660 by Dmitriy Zaporozhets

gitlab_git to 1.0.6, return submodule rendering in tree

parent 083d6656
......@@ -8,6 +8,7 @@ v 5.2.0
- Move Gitlab::Git code to gitlab_git gem
- Move update docs in repo
- requires gitlab-shell v1.4.0
- fixed submodules listing under file tab
v 5.1.0
- You can login with email or username now
......
......@@ -24,7 +24,7 @@ gem 'omniauth-github'
# Extracting information from a git repository
# We cannot use original git since some bugs
gem "grit", '~> 2.5.0', git: 'https://github.com/gitlabhq/grit.git', ref: '42297cdcee16284d2e4eff23d41377f52fc28b9d'
gem 'gitlab_git', '~> 1.0.5'
gem 'gitlab_git', '~> 1.0.6'
# Ruby/Rack Git Smart-HTTP Server Handler
gem 'gitlab-grack', '~> 1.0.0', require: 'grack'
......
......@@ -165,7 +165,7 @@ GEM
gitlab-pygments.rb (0.3.2)
posix-spawn (~> 0.3.6)
yajl-ruby (~> 1.1.0)
gitlab_git (1.0.5)
gitlab_git (1.0.6)
activesupport (~> 3.2.13)
github-linguist (~> 2.3.4)
grit (~> 2.5.0)
......@@ -518,7 +518,7 @@ DEPENDENCIES
github-markup (~> 0.7.4)
gitlab-grack (~> 1.0.0)
gitlab-pygments.rb (~> 0.3.2)
gitlab_git (~> 1.0.5)
gitlab_git (~> 1.0.6)
gitlab_meta (= 5.0)
gitlab_omniauth-ldap (= 1.0.2)
gollum-lib (~> 1.0.0)
......
......@@ -5,24 +5,18 @@ module TreeHelper
# contents - A Grit::Tree object for the current tree
def render_tree(tree)
# Render Folders before Files/Submodules
folders, files = tree.trees, tree.blobs
folders, files, submodules = tree.trees, tree.blobs, tree.submodules
tree = ""
# Render folders if we have any
tree += render partial: 'tree/tree_item', collection: folders, locals: {type: 'folder'} if folders.present?
files.each do |f|
html = if f.respond_to?(:url)
# Object is a Submodule
render partial: 'tree/submodule_item', object: f
else
# Object is a Blob
render partial: 'tree/blob_item', object: f, locals: {type: 'file'}
end
# Render files if we have any
tree += render partial: 'tree/blob_item', collection: files, locals: {type: 'file'} if files.present?
tree += html if html.present?
end
# Render submodules if we have any
tree += render partial: 'tree/submodule_item', collection: submodules if submodules.present?
tree.html_safe
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment