Commit 9916e8d6dc66b0a4f71bf88bae55d8077204b5f6
1 parent
6d93eafa
Exists in
master
and in
4 other branches
Updated test to match with switched commits
Added compare switch
Showing
3 changed files
with
14 additions
and
2 deletions
Show diff stats
app/assets/stylesheets/sections/commits.scss
... | ... | @@ -300,3 +300,12 @@ |
300 | 300 | color: #fff; |
301 | 301 | font-family: $monospace; |
302 | 302 | } |
303 | + | |
304 | + | |
305 | +.commits-compare-switch{ | |
306 | + background: url('switch_icon.png'); | |
307 | + width: 16px; | |
308 | + height: 18px; | |
309 | + text-indent: -9999px; | |
310 | + display: inline-block; | |
311 | +} | |
303 | 312 | \ No newline at end of file | ... | ... |
app/views/compare/_form.html.haml
... | ... | @@ -13,12 +13,15 @@ |
13 | 13 | = text_field_tag :from, params[:from], placeholder: "master", class: "xlarge" |
14 | 14 | = "..." |
15 | 15 | = text_field_tag :to, params[:to], placeholder: "aa8b4ef", class: "xlarge" |
16 | + = link_to 'switch', {from: params[:to], to: params[:from]}, {class: 'commits-compare-switch has_tooltip', title: 'Switch base of comparison'} | |
16 | 17 | - if @refs_are_same |
17 | 18 | .alert |
18 | 19 | %span Refs are the same |
19 | 20 | .actions |
20 | 21 | = submit_tag "Compare", class: "btn primary wide commits-compare-btn" |
21 | 22 | |
23 | + | |
24 | + | |
22 | 25 | :javascript |
23 | 26 | $(function() { |
24 | 27 | var availableTags = #{@project.ref_names.to_json}; | ... | ... |
features/steps/project/project_browse_commits.rb
... | ... | @@ -32,8 +32,8 @@ class ProjectBrowseCommits < Spinach::FeatureSteps |
32 | 32 | end |
33 | 33 | |
34 | 34 | And 'I fill compare fields with refs' do |
35 | - fill_in "from", with: "bcf03b5de6c33f3869ef70d68cf06e679d1d7f9a" | |
36 | - fill_in "to", with: "8716fc78f3c65bbf7bcf7b574febd583bc5d2812" | |
35 | + fill_in "from", with: "8716fc78f3c65bbf7bcf7b574febd583bc5d2812" | |
36 | + fill_in "to", with: "bcf03b5de6c33f3869ef70d68cf06e679d1d7f9a" | |
37 | 37 | click_button "Compare" |
38 | 38 | end |
39 | 39 | ... | ... |