Commit 8f75ab21 authored by Douwe Maan's avatar Douwe Maan

Link Commits tab to current branch from Compare page.

parent 40c8295a
...@@ -6,11 +6,12 @@ class Projects::CompareController < Projects::ApplicationController ...@@ -6,11 +6,12 @@ class Projects::CompareController < Projects::ApplicationController
before_action :authorize_download_code! before_action :authorize_download_code!
def index def index
@ref = Addressable::URI.unescape(params[:to])
end end
def show def show
base_ref = Addressable::URI.unescape(params[:from]) base_ref = Addressable::URI.unescape(params[:from])
head_ref = Addressable::URI.unescape(params[:to]) @ref = head_ref = Addressable::URI.unescape(params[:to])
compare_result = CompareService.new.execute( compare_result = CompareService.new.execute(
current_user, current_user,
......
%ul.nav.nav-tabs %ul.nav.nav-tabs
= nav_link(controller: [:commit, :commits]) do = nav_link(controller: [:commit, :commits]) do
= link_to namespace_project_commits_path(@project.namespace, @project, @repository.root_ref) do = link_to namespace_project_commits_path(@project.namespace, @project, @ref || @repository.root_ref) do
Commits Commits
%span.badge= number_with_precision(@repository.commit_count, precision: 0, delimiter: ',') %span.badge= number_with_precision(@repository.commit_count, precision: 0, delimiter: ',')
= nav_link(controller: :compare) do = nav_link(controller: :compare) do
......
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