diff options
author | Mark Fletcher <mark@gitlab.com> | 2018-01-09 21:00:11 +0300 |
---|---|---|
committer | Mark Fletcher <mark@gitlab.com> | 2018-01-09 21:04:41 +0300 |
commit | 7034ef29edd853b3d18d3666a19826217990bfb1 (patch) | |
tree | fffca7348f71b7657045a8a38c046a7bde2f7789 /app/views | |
parent | 396e7647f836c0cb87d19252fb6d31e91e0dbd6c (diff) |
Hide new branch and tag links for projects with an empty repo
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/projects/buttons/_dropdown.html.haml | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/app/views/projects/buttons/_dropdown.html.haml b/app/views/projects/buttons/_dropdown.html.haml index 2589c53beae..8e8c911185a 100644 --- a/app/views/projects/buttons/_dropdown.html.haml +++ b/app/views/projects/buttons/_dropdown.html.haml @@ -30,12 +30,13 @@ %li = link_to project_new_blob_path(@project, @project.default_branch || 'master') do #{ _('New file') } - %li - = link_to new_project_branch_path(@project) do - #{ _('New branch') } - %li - = link_to new_project_tag_path(@project) do - #{ _('New tag') } + - unless @project.empty_repo? + %li + = link_to new_project_branch_path(@project) do + #{ _('New branch') } + %li + = link_to new_project_tag_path(@project) do + #{ _('New tag') } - elsif current_user && current_user.already_forked?(@project) %li = link_to project_new_blob_path(@project, @project.default_branch || 'master') do |