Skip to content

Commit a7aee9d

Browse files
committed
Pretty compare mode
1 parent 40c6d87 commit a7aee9d

File tree

2 files changed

+26
-18
lines changed

2 files changed

+26
-18
lines changed

app/assets/stylesheets/sections/commits.scss

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -303,9 +303,14 @@
303303

304304

305305
.commits-compare-switch{
306-
background: url('switch_icon.png');
306+
background: url("switch_icon.png") no-repeat center center;
307307
width: 16px;
308308
height: 18px;
309309
text-indent: -9999px;
310-
display: inline-block;
311-
}
310+
float: left;
311+
margin-right: 9px;
312+
border: 1px solid #DDD;
313+
@include border-radius(4px);
314+
padding: 4px;
315+
background-color: #EEE;
316+
}

app/views/compare/_form.html.haml

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,31 @@
11
%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.
89

9-
%br
10+
%br
1011

1112
= form_tag project_compare_index_path(@project), method: :post do
1213
.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"
1823
- if @refs_are_same
1924
.alert
2025
%span Refs are the same
21-
.actions
22-
= submit_tag "Compare", class: "btn primary wide commits-compare-btn"
2326

2427

25-
28+
2629
:javascript
2730
$(function() {
2831
var availableTags = #{@project.ref_names.to_json};

0 commit comments

Comments
 (0)