diff options
| author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-09-12 21:39:27 +0300 |
|---|---|---|
| committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-09-12 21:39:53 +0300 |
| commit | 069a6dfa9152dc61042bc3385651e9a81c8d3392 (patch) | |
| tree | 6b29f55ac2cf8d3bb9dd5dc9318701db05b3eda9 | |
| parent | 6f037b9fe89290333a744d5d2a283b50880e14c0 (diff) | |
| download | gitlab-ce-069a6dfa9152dc61042bc3385651e9a81c8d3392.tar.gz | |
Compare link for branches
| -rw-r--r-- | app/helpers/compare_helper.rb | 1 | ||||
| -rw-r--r-- | app/views/projects/branches/_branch.html.haml | 4 |
2 files changed, 5 insertions, 0 deletions
diff --git a/app/helpers/compare_helper.rb b/app/helpers/compare_helper.rb index e1dd89dcd3d..ea2540bf385 100644 --- a/app/helpers/compare_helper.rb +++ b/app/helpers/compare_helper.rb @@ -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 diff --git a/app/views/projects/branches/_branch.html.haml b/app/views/projects/branches/_branch.html.haml index 026948aa027..b8392525791 100644 --- a/app/views/projects/branches/_branch.html.haml +++ b/app/views/projects/branches/_branch.html.haml @@ -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 |
