summaryrefslogtreecommitdiff
path: root/app/views/commits/compare.html.haml
blob: 04d8af5459de189b43e09706d443c33eac1179ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
= render "head"

%h3
  Compare View
%hr

%div
  %p
    Fill input field with commit id like
    %code '4eedf23'
    or branch/tag name like
    %code master
    & press compare button for commits list, code diff.

  %br

  = form_tag compare_project_commits_path(@project), :method => :get do
    .clearfix
      = text_field_tag :from, params[:from], :placeholder => "master", :class => "xlarge"
      = "..."
      = text_field_tag :to, params[:to], :placeholder => "aa8b4ef", :class => "xlarge"
    .actions
      = submit_tag "Compare", :class => "btn btn-primary"


- unless @commits.empty?
  %div.ui-box
    %h5.small Commits (#{@commits.count})
    %ul.unstyled= render @commits

- unless @diffs.empty?
  %h4 Diff
  = render "commits/diffs", :diffs => @diffs

:javascript
  $(function() {
    var availableTags = #{@project.heads.map(&:name).to_json};

    $("#from").autocomplete({
      source: availableTags,
      minLength: 1
    });

    $("#to").autocomplete({
      source: availableTags,
      minLength: 1
    });
  });