Commit 069a6dfa authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Compare link for branches

parent 6f037b9f
......@@ -3,6 +3,7 @@ module CompareHelper
params[:from].present? && params[:to].present? &&
@repository.branch_names.include?(params[:from]) &&
@repository.branch_names.include?(params[:to]) &&
params[:from] != params[:to] &&
!@refs_are_same
end
......
......@@ -13,6 +13,10 @@
= link_to archive_project_repository_path(@project, ref: branch.name), class: 'btn grouped btn-small' do
%i.icon-download-alt
Download
= link_to project_compare_index_path(@project, from: branch.name, to: branch.name), class: 'btn grouped btn-small', title: "Compare" do
%i.icon-copy
Compare
- if can?(current_user, :admin_project, @project) && branch.name != @repository.root_ref
= link_to project_branch_path(@project, branch.name), class: 'btn grouped btn-small remove-row', method: :delete, confirm: 'Removed branch cannot be restored. Are you sure?', remote: true do
%i.icon-trash
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment