Commit 3083e5e4cdd0d158bc1c092f3e339eb8f83b2c4a

Authored by Dmitriy Zaporozhets
1 parent 160bd862

Hide new file link if not branch HEAD

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Showing 1 changed file with 6 additions and 5 deletions   Show diff stats
app/views/projects/tree/_tree.html.haml
... ... @@ -10,11 +10,12 @@
10 10 = link_to truncate(title, length: 40), project_tree_path(@project, path)
11 11 - else
12 12 = link_to title, '#'
13   - \/
14   - %li
15   - = link_to project_new_tree_path(@project, @id), title: 'New file', id: 'new-file-link' do
16   - %small
17   - %i.icon-plus.light
  13 + - if @repository.branch_names.include?(@ref)
  14 + \/
  15 + %li
  16 + = link_to project_new_tree_path(@project, @id), title: 'New file', id: 'new-file-link' do
  17 + %small
  18 + %i.icon-plus.light
18 19  
19 20 %div#tree-content-holder.tree-content-holder
20 21 %table#tree-slider{class: "table_#{@hex_path} tree-table" }
... ...