%li{class: "#{'active' if current_page?(project_commits_path(@project)) }"}
= link_to project_commits_path(@project) do
Commits
- %li{class: "#{'active' if current_page?(compare_project_commits_path(@project)) }"}
- = link_to compare_project_commits_path(@project) do
+ %li{class: "#{'active' if current_controller?(:compare)}"}
+ = link_to project_compare_index_path(@project) do
Compare
%li{class: "#{branches_tab_class}"}
= link_to project_repository_path(@project) do
--- /dev/null
+%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 project_compare_index_path(@project), method: :post 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"
+
+:javascript
+ $(function() {
+ var availableTags = #{@project.ref_names.to_json};
+
+ $("#from, #to").autocomplete({
+ source: availableTags,
+ minLength: 1
+ });
+
+ disableButtonIfEmptyField('#to', '.commits-compare-btn');
+ });
+++ /dev/null
-%ul.nav.nav-tabs
- %li= render partial: 'shared/ref_switcher', locals: {destination: 'commits'}
- %li{class: "#{'active' if current_page?(project_commits_path(@project)) }"}
- = link_to project_commits_path(@project) do
- Commits
- %li{class: "#{'active' if current_page?(compare_project_commits_path(@project)) }"}
- = link_to compare_project_commits_path(@project) do
- Compare
- %li{class: "#{branches_tab_class}"}
- = link_to project_repository_path(@project) do
- Branches
- %span.badge= @project.repo.branch_count
-
- %li{class: "#{'active' if current_page?(tags_project_repository_path(@project)) }"}
- = link_to tags_project_repository_path(@project) do
- Tags
- %span.badge= @project.repo.tag_count
-
- - if current_page?(project_commits_path(@project)) && current_user.private_token
- %li.right
- %span.rss-icon
- = link_to project_commits_path(@project, @ref, {format: :atom, private_token: current_user.private_token}), title: "Feed" do
- = image_tag "rss_ui.png", title: "feed"
--- /dev/null
+= render "commits/head"
+
+%h3.page_title
+ Compare View
+%hr
+
+= render "form"
-= render "head"
+= render "commits/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"
+= render "form"
- if @commits.present?
%div.ui-box
- 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');
- });
-
%li.commits-stat
- if event.commits_count > 2
%span ... and #{event.commits_count - 2} more commits.
- = link_to compare_project_commits_path(event.project, from: event.parent_commit.id, to: event.last_commit.id) do
+ = link_to project_compare_path(event.project, from: event.parent_commit.id, to: event.last_commit.id) do
%strong Compare → #{event.parent_commit.id[0..7]}...#{event.last_commit.id[0..7]}
.clearfix
end
Given 'I visit compare refs page' do
- visit compare_project_commits_path(@project)
+ visit project_compare_index_path(@project)
end
Given 'I visit project commits page' do