Commit 56d15660b8e89ae0bc37953b4fe24739323e5921
1 parent
083d6656
Exists in
master
and in
4 other branches
gitlab_git to 1.0.6, return submodule rendering in tree
Showing
4 changed files
with
9 additions
and
14 deletions
Show diff stats
CHANGELOG
@@ -8,6 +8,7 @@ v 5.2.0 | @@ -8,6 +8,7 @@ v 5.2.0 | ||
8 | - Move Gitlab::Git code to gitlab_git gem | 8 | - Move Gitlab::Git code to gitlab_git gem |
9 | - Move update docs in repo | 9 | - Move update docs in repo |
10 | - requires gitlab-shell v1.4.0 | 10 | - requires gitlab-shell v1.4.0 |
11 | + - fixed submodules listing under file tab | ||
11 | 12 | ||
12 | v 5.1.0 | 13 | v 5.1.0 |
13 | - You can login with email or username now | 14 | - You can login with email or username now |
Gemfile
@@ -24,7 +24,7 @@ gem 'omniauth-github' | @@ -24,7 +24,7 @@ gem 'omniauth-github' | ||
24 | # Extracting information from a git repository | 24 | # Extracting information from a git repository |
25 | # We cannot use original git since some bugs | 25 | # We cannot use original git since some bugs |
26 | gem "grit", '~> 2.5.0', git: 'https://github.com/gitlabhq/grit.git', ref: '42297cdcee16284d2e4eff23d41377f52fc28b9d' | 26 | gem "grit", '~> 2.5.0', git: 'https://github.com/gitlabhq/grit.git', ref: '42297cdcee16284d2e4eff23d41377f52fc28b9d' |
27 | -gem 'gitlab_git', '~> 1.0.5' | 27 | +gem 'gitlab_git', '~> 1.0.6' |
28 | 28 | ||
29 | # Ruby/Rack Git Smart-HTTP Server Handler | 29 | # Ruby/Rack Git Smart-HTTP Server Handler |
30 | gem 'gitlab-grack', '~> 1.0.0', require: 'grack' | 30 | gem 'gitlab-grack', '~> 1.0.0', require: 'grack' |
Gemfile.lock
@@ -165,7 +165,7 @@ GEM | @@ -165,7 +165,7 @@ GEM | ||
165 | gitlab-pygments.rb (0.3.2) | 165 | gitlab-pygments.rb (0.3.2) |
166 | posix-spawn (~> 0.3.6) | 166 | posix-spawn (~> 0.3.6) |
167 | yajl-ruby (~> 1.1.0) | 167 | yajl-ruby (~> 1.1.0) |
168 | - gitlab_git (1.0.5) | 168 | + gitlab_git (1.0.6) |
169 | activesupport (~> 3.2.13) | 169 | activesupport (~> 3.2.13) |
170 | github-linguist (~> 2.3.4) | 170 | github-linguist (~> 2.3.4) |
171 | grit (~> 2.5.0) | 171 | grit (~> 2.5.0) |
@@ -518,7 +518,7 @@ DEPENDENCIES | @@ -518,7 +518,7 @@ DEPENDENCIES | ||
518 | github-markup (~> 0.7.4) | 518 | github-markup (~> 0.7.4) |
519 | gitlab-grack (~> 1.0.0) | 519 | gitlab-grack (~> 1.0.0) |
520 | gitlab-pygments.rb (~> 0.3.2) | 520 | gitlab-pygments.rb (~> 0.3.2) |
521 | - gitlab_git (~> 1.0.5) | 521 | + gitlab_git (~> 1.0.6) |
522 | gitlab_meta (= 5.0) | 522 | gitlab_meta (= 5.0) |
523 | gitlab_omniauth-ldap (= 1.0.2) | 523 | gitlab_omniauth-ldap (= 1.0.2) |
524 | gollum-lib (~> 1.0.0) | 524 | gollum-lib (~> 1.0.0) |
app/helpers/tree_helper.rb
@@ -5,24 +5,18 @@ module TreeHelper | @@ -5,24 +5,18 @@ module TreeHelper | ||
5 | # contents - A Grit::Tree object for the current tree | 5 | # contents - A Grit::Tree object for the current tree |
6 | def render_tree(tree) | 6 | def render_tree(tree) |
7 | # Render Folders before Files/Submodules | 7 | # Render Folders before Files/Submodules |
8 | - folders, files = tree.trees, tree.blobs | 8 | + folders, files, submodules = tree.trees, tree.blobs, tree.submodules |
9 | 9 | ||
10 | tree = "" | 10 | tree = "" |
11 | 11 | ||
12 | # Render folders if we have any | 12 | # Render folders if we have any |
13 | tree += render partial: 'tree/tree_item', collection: folders, locals: {type: 'folder'} if folders.present? | 13 | tree += render partial: 'tree/tree_item', collection: folders, locals: {type: 'folder'} if folders.present? |
14 | 14 | ||
15 | - files.each do |f| | ||
16 | - html = if f.respond_to?(:url) | ||
17 | - # Object is a Submodule | ||
18 | - render partial: 'tree/submodule_item', object: f | ||
19 | - else | ||
20 | - # Object is a Blob | ||
21 | - render partial: 'tree/blob_item', object: f, locals: {type: 'file'} | ||
22 | - end | 15 | + # Render files if we have any |
16 | + tree += render partial: 'tree/blob_item', collection: files, locals: {type: 'file'} if files.present? | ||
23 | 17 | ||
24 | - tree += html if html.present? | ||
25 | - end | 18 | + # Render submodules if we have any |
19 | + tree += render partial: 'tree/submodule_item', collection: submodules if submodules.present? | ||
26 | 20 | ||
27 | tree.html_safe | 21 | tree.html_safe |
28 | end | 22 | end |