summaryrefslogtreecommitdiff
path: root/app/views/projects/tree
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-11-05 12:23:11 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-11-05 12:23:11 +0200
commit3083e5e4cdd0d158bc1c092f3e339eb8f83b2c4a (patch)
treed924e72bbaa4b6dd2fbea631620a22dd5253df8f /app/views/projects/tree
parent160bd862bede180faf66de7e5b09300347c24279 (diff)
downloadgitlab-ce-3083e5e4cdd0d158bc1c092f3e339eb8f83b2c4a.tar.gz
Hide new file link if not branch HEAD
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app/views/projects/tree')
-rw-r--r--app/views/projects/tree/_tree.html.haml11
1 files changed, 6 insertions, 5 deletions
diff --git a/app/views/projects/tree/_tree.html.haml b/app/views/projects/tree/_tree.html.haml
index fae7c18b19a..6b5b84f83b0 100644
--- a/app/views/projects/tree/_tree.html.haml
+++ b/app/views/projects/tree/_tree.html.haml
@@ -10,11 +10,12 @@
= link_to truncate(title, length: 40), project_tree_path(@project, path)
- else
= link_to title, '#'
- \/
- %li
- = link_to project_new_tree_path(@project, @id), title: 'New file', id: 'new-file-link' do
- %small
- %i.icon-plus.light
+ - if @repository.branch_names.include?(@ref)
+ \/
+ %li
+ = link_to project_new_tree_path(@project, @id), title: 'New file', id: 'new-file-link' do
+ %small
+ %i.icon-plus.light
%div#tree-content-holder.tree-content-holder
%table#tree-slider{class: "table_#{@hex_path} tree-table" }