From f774949d3f7676f925c7fc858d462ec2400e43a2 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Thu, 12 Sep 2013 20:15:10 +0300 Subject: Compare page improved * Show new merge request button from compare page * Show message if user selected same branches * Show message if compared branches are the same * Prepend inputs with from/to labels --- app/helpers/compare_helper.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 app/helpers/compare_helper.rb (limited to 'app/helpers/compare_helper.rb') diff --git a/app/helpers/compare_helper.rb b/app/helpers/compare_helper.rb new file mode 100644 index 00000000000..55d0d6268ad --- /dev/null +++ b/app/helpers/compare_helper.rb @@ -0,0 +1,12 @@ +module CompareHelper + def compare_to_mr_button? + params[:from].present? && params[:to].present? && + @repository.branch_names.include?(params[:from]) && + @repository.branch_names.include?(params[:to]) && + !@refs_are_same + end + + def compare_mr_path + new_project_merge_request_path(@project, merge_request: {source_branch: params[:from], target_branch: params[:to]}) + end +end -- cgit v1.2.3