Commit a7aee9d1ee9b8e90deb9c8d71a4ea9d96c0d6f8f
1 parent
40c6d871
Exists in
master
and in
4 other branches
Pretty compare mode
Showing
2 changed files
with
26 additions
and
18 deletions
Show diff stats
app/assets/stylesheets/sections/commits.scss
| @@ -303,9 +303,14 @@ | @@ -303,9 +303,14 @@ | ||
| 303 | 303 | ||
| 304 | 304 | ||
| 305 | .commits-compare-switch{ | 305 | .commits-compare-switch{ |
| 306 | - background: url('switch_icon.png'); | 306 | + background: url("switch_icon.png") no-repeat center center; |
| 307 | width: 16px; | 307 | width: 16px; |
| 308 | height: 18px; | 308 | height: 18px; |
| 309 | text-indent: -9999px; | 309 | text-indent: -9999px; |
| 310 | - display: inline-block; | ||
| 311 | -} | ||
| 312 | \ No newline at end of file | 310 | \ No newline at end of file |
| 311 | + float: left; | ||
| 312 | + margin-right: 9px; | ||
| 313 | + border: 1px solid #DDD; | ||
| 314 | + @include border-radius(4px); | ||
| 315 | + padding: 4px; | ||
| 316 | + background-color: #EEE; | ||
| 317 | +} |
app/views/compare/_form.html.haml
| 1 | %div | 1 | %div |
| 2 | - %p.slead | ||
| 3 | - Fill input field with commit id like | ||
| 4 | - %code.label_branch 4eedf23 | ||
| 5 | - or branch/tag name like | ||
| 6 | - %code.label_branch master | ||
| 7 | - and press compare button for commits list, code diff. | 2 | + - unless params[:to] |
| 3 | + %p.slead | ||
| 4 | + Fill input field with commit id like | ||
| 5 | + %code.label_branch 4eedf23 | ||
| 6 | + or branch/tag name like | ||
| 7 | + %code.label_branch master | ||
| 8 | + and press compare button for commits list, code diff. | ||
| 8 | 9 | ||
| 9 | - %br | 10 | + %br |
| 10 | 11 | ||
| 11 | = form_tag project_compare_index_path(@project), method: :post do | 12 | = form_tag project_compare_index_path(@project), method: :post do |
| 12 | .clearfix | 13 | .clearfix |
| 13 | - = text_field_tag :from, params[:from], placeholder: "master", class: "xlarge" | ||
| 14 | - = "..." | ||
| 15 | - = text_field_tag :to, params[:to], placeholder: "aa8b4ef", class: "xlarge" | ||
| 16 | - - if params[:to] && params[:from] | ||
| 17 | - = link_to 'switch', {from: params[:to], to: params[:from]}, {class: 'commits-compare-switch has_tooltip', title: 'Switch base of comparison'} | 14 | + .pull-left |
| 15 | + - if params[:to] && params[:from] | ||
| 16 | + = link_to 'switch', {from: params[:to], to: params[:from]}, {class: 'commits-compare-switch has_tooltip', title: 'Switch base of comparison'} | ||
| 17 | + = text_field_tag :from, params[:from], placeholder: "master", class: "xlarge" | ||
| 18 | + = "..." | ||
| 19 | + = text_field_tag :to, params[:to], placeholder: "aa8b4ef", class: "xlarge" | ||
| 20 | + .pull-left | ||
| 21 | + | ||
| 22 | + = submit_tag "Compare", class: "btn primary wide commits-compare-btn" | ||
| 18 | - if @refs_are_same | 23 | - if @refs_are_same |
| 19 | .alert | 24 | .alert |
| 20 | %span Refs are the same | 25 | %span Refs are the same |
| 21 | - .actions | ||
| 22 | - = submit_tag "Compare", class: "btn primary wide commits-compare-btn" | ||
| 23 | 26 | ||
| 24 | 27 | ||
| 25 | - | 28 | + |
| 26 | :javascript | 29 | :javascript |
| 27 | $(function() { | 30 | $(function() { |
| 28 | var availableTags = #{@project.ref_names.to_json}; | 31 | var availableTags = #{@project.ref_names.to_json}; |