From dfccb06dda344819989fa8d6a9a3c56c5ca0b65f Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Fri, 5 Jun 2015 15:01:38 +0200 Subject: Refactor web editor * fix problem with editing non-master branch * before commit make sure branch exists * dont allow user change file in one branch and commit to another existing branch * remove a lot of code duplication * remove outdated statellite errors Signed-off-by: Dmitriy Zaporozhets --- app/views/projects/blob/new.html.haml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'app/views/projects/blob') diff --git a/app/views/projects/blob/new.html.haml b/app/views/projects/blob/new.html.haml index 9b1d03b820e..f7ddf74b4fc 100644 --- a/app/views/projects/blob/new.html.haml +++ b/app/views/projects/blob/new.html.haml @@ -6,11 +6,12 @@ = render 'shared/commit_message_container', params: params, placeholder: 'Add new file' - .form-group.branch - = label_tag 'branch', class: 'control-label' do - Branch - .col-sm-10 - = text_field_tag 'new_branch', @ref, class: "form-control" + - unless @project.empty_repo? + .form-group.branch + = label_tag 'branch', class: 'control-label' do + Branch + .col-sm-10 + = text_field_tag 'new_branch', @ref, class: "form-control" = hidden_field_tag 'content', '', id: 'file-content' = render 'projects/commit_button', ref: @ref, -- cgit v1.2.1