summaryrefslogtreecommitdiff
path: root/app/views/projects/compare
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/views/projects/compare
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/views/projects/compare')
-rw-r--r--app/views/projects/compare/_form.html.haml45
-rw-r--r--app/views/projects/compare/index.html.haml10
-rw-r--r--app/views/projects/compare/show.html.haml13
3 files changed, 41 insertions, 27 deletions
diff --git a/app/views/projects/compare/_form.html.haml b/app/views/projects/compare/_form.html.haml
index 503b39c0663..ca1ea4073e6 100644
--- a/app/views/projects/compare/_form.html.haml
+++ b/app/views/projects/compare/_form.html.haml
@@ -1,30 +1,21 @@
-%div
- - unless params[:to]
- %p.slead
- Fill input field with commit id like
- %code.label-branch 4eedf23
- or branch/tag name like
- %code.label-branch master
- and press compare button for the commits list and a code diff.
- %br
- Changes are shown <b>from</b> the version in the first field <b>to</b> the version in the second field.
-
-
- = form_tag project_compare_index_path(@project), method: :post do
- .clearfix
- .pull-left
- - if params[:to] && params[:from]
- = link_to 'switch', {from: params[:to], to: params[:from]}, {class: 'commits-compare-switch has_tooltip', title: 'Switch base of comparison'}
- = text_field_tag :from, params[:from], placeholder: "from", class: "input-xlarge input-xpadding"
- = "..."
- = text_field_tag :to, params[:to], placeholder: "to", class: "input-xlarge input-xpadding"
- .pull-left
- &nbsp;
- = submit_tag "Compare", class: "btn btn-create commits-compare-btn"
- - if @refs_are_same
- .alert
- %span Refs are the same
-
+= form_tag project_compare_index_path(@project), method: :post do
+ .clearfix
+ .pull-left
+ - if params[:to] && params[:from]
+ = link_to 'switch', {from: params[:to], to: params[:from]}, {class: 'commits-compare-switch has_tooltip', title: 'Switch base of comparison'}
+ .input-prepend
+ %span.add-on.input-xpadding from
+ = text_field_tag :from, params[:from], class: "span3 input-xpadding"
+ = "..."
+ .input-prepend
+ %span.add-on.input-xpadding to
+ = text_field_tag :to, params[:to], class: "span3 input-xpadding"
+ .pull-left
+ &nbsp;
+ = submit_tag "Compare", class: "btn btn-create commits-compare-btn"
+ - if compare_to_mr_button?
+ = link_to compare_mr_path, class: 'prepend-left-10' do
+ %strong Make a merge request
:javascript
diff --git a/app/views/projects/compare/index.html.haml b/app/views/projects/compare/index.html.haml
index 8f108ed0b08..4745bfbeaaf 100644
--- a/app/views/projects/compare/index.html.haml
+++ b/app/views/projects/compare/index.html.haml
@@ -2,5 +2,15 @@
%h3.page-title
Compare View
+%p.slead
+ Compare branches, tags or commit ranges.
+ %br
+ Fill input field with commit id like
+ %code.label-branch 4eedf23
+ or branch/tag name like
+ %code.label-branch master
+ and press compare button for the commits list and a code diff.
+ %br
+ Changes are shown <b>from</b> the version in the first field <b>to</b> the version in the second field.
= render "form"
diff --git a/app/views/projects/compare/show.html.haml b/app/views/projects/compare/show.html.haml
index af9273f9315..4be62d36917 100644
--- a/app/views/projects/compare/show.html.haml
+++ b/app/views/projects/compare/show.html.haml
@@ -20,3 +20,16 @@
- unless @diffs.empty?
%h4 Diff
= render "projects/commits/diffs", diffs: @diffs, project: @project
+- else
+ .light-well
+ %center
+ %h4
+ There isn't anything to compare.
+ %p.slead
+ - if params[:to] == params[:from]
+ You'll need to use different branch names to get a valid comparison.
+ - else
+ %span.label-branch #{params[:from]}
+ and
+ %span.label-branch #{params[:to]}
+ are the same.