From 3083e5e4cdd0d158bc1c092f3e339eb8f83b2c4a Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 5 Nov 2013 12:23:11 +0200 Subject: [PATCH] Hide new file link if not branch HEAD --- app/views/projects/tree/_tree.html.haml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/app/views/projects/tree/_tree.html.haml b/app/views/projects/tree/_tree.html.haml index fae7c18..6b5b84f 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" } -- libgit2 0.21.2