Link Commits tab to current branch from Compare page.

This commit is contained in:
Douwe Maan 2015-05-09 22:25:46 +02:00
parent 40c8295a24
commit 8f75ab21d0
2 changed files with 3 additions and 2 deletions

View File

@ -6,11 +6,12 @@ class Projects::CompareController < Projects::ApplicationController
before_action :authorize_download_code!
def index
@ref = Addressable::URI.unescape(params[:to])
end
def show
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(
current_user,

View File

@ -1,6 +1,6 @@
%ul.nav.nav-tabs
= 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
%span.badge= number_with_precision(@repository.commit_count, precision: 0, delimiter: ',')
= nav_link(controller: :compare) do