diff options
Diffstat (limited to 'app/views/compare/show.html.haml')
| -rw-r--r-- | app/views/compare/show.html.haml | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/app/views/compare/show.html.haml b/app/views/compare/show.html.haml new file mode 100644 index 00000000000..db15ba53823 --- /dev/null +++ b/app/views/compare/show.html.haml @@ -0,0 +1,53 @@ += render "head" + +%h3.page_title + Compare View +%hr + +%div + %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 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" + - if @refs_are_same + .alert + %span Refs are the same + .actions + = submit_tag "Compare", class: "btn primary wide commits-compare-btn" + +- if @commits.present? + %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.ref_names.to_json}; + + $("#from").autocomplete({ + source: availableTags, + minLength: 1 + }); + + $("#to").autocomplete({ + source: availableTags, + minLength: 1 + }); + + disableButtonIfEmptyField('#to', '.commits-compare-btn'); + }); + |
