summaryrefslogtreecommitdiff
path: root/app/helpers/compare_helper.rb
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-09-12 20:15:10 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-09-12 20:15:10 +0300
commitf774949d3f7676f925c7fc858d462ec2400e43a2 (patch)
tree14633263c1c54f5483be8e4f283ec301fd5abeed /app/helpers/compare_helper.rb
parentedb3368c93c6ff64840ef5cd12f2af30b18b5b52 (diff)
downloadgitlab-ce-f774949d3f7676f925c7fc858d462ec2400e43a2.tar.gz
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
Diffstat (limited to 'app/helpers/compare_helper.rb')
-rw-r--r--app/helpers/compare_helper.rb12
1 files changed, 12 insertions, 0 deletions
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