Commit 10489172 authored by Robert Speicher's avatar Robert Speicher

Update usages of project_commit[s] route helpers

parent 99d39133
...@@ -19,7 +19,7 @@ class RefsController < ApplicationController ...@@ -19,7 +19,7 @@ class RefsController < ApplicationController
new_path = if params[:destination] == "tree" new_path = if params[:destination] == "tree"
project_tree_path(@project, @ref) project_tree_path(@project, @ref)
else else
project_commits_path(@project, ref: @ref) project_commits_path(@project, @ref)
end end
redirect_to new_path redirect_to new_path
......
...@@ -21,7 +21,7 @@ class EventDecorator < ApplicationDecorator ...@@ -21,7 +21,7 @@ class EventDecorator < ApplicationDecorator
elsif self.merge_request? elsif self.merge_request?
h.project_merge_request_url(self.project, self.merge_request) h.project_merge_request_url(self.project, self.merge_request)
elsif self.push? elsif self.push?
h.project_commits_url(self.project, ref: self.ref_name) h.project_commits_url(self.project, self.ref_name)
end end
end end
end end
...@@ -30,7 +30,7 @@ class TreeDecorator < ApplicationDecorator ...@@ -30,7 +30,7 @@ class TreeDecorator < ApplicationDecorator
end end
def history_path def history_path
h.project_commits_path(project, path: path, ref: ref) h.project_commits_path(project, h.tree_join(ref, path))
end end
def mb_size def mb_size
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
%span.btn.disabled.grouped %span.btn.disabled.grouped
%i.icon-comment %i.icon-comment
= @notes_count = @notes_count
= link_to patch_project_commit_path(@project, @commit.id), class: "btn small grouped" do = link_to project_commit_path(@project, @commit, format: :patch), class: "btn small grouped" do
%i.icon-download-alt %i.icon-download-alt
Get Patch Get Patch
= link_to project_tree_path(@project, @commit), class: "browse-button primary grouped" do = link_to project_tree_path(@project, @commit), class: "browse-button primary grouped" do
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
%p To prevent performance issue we rejected diff information. %p To prevent performance issue we rejected diff information.
%p %p
But if you still want to see diff But if you still want to see diff
= link_to "click this link", project_commit_path(@project, @commit.id, force_show_diff: true), class: "dark" = link_to "click this link", project_commit_path(@project, @commit, force_show_diff: true), class: "dark"
%p.cgray %p.cgray
Showing #{pluralize(diffs.count, "changed file")} Showing #{pluralize(diffs.count, "changed file")}
......
...@@ -10,8 +10,8 @@ ...@@ -10,8 +10,8 @@
- if controller_name == 'projects' && action_name == 'index' - if controller_name == 'projects' && action_name == 'index'
= auto_discovery_link_tag :atom, projects_url(:atom, private_token: current_user.private_token), title: "Dashboard feed" = auto_discovery_link_tag :atom, projects_url(:atom, private_token: current_user.private_token), title: "Dashboard feed"
- if @project && !@project.new_record? - if @project && !@project.new_record?
- if current_page?(project_tree_path(@project, @project.root_ref)) || current_page?(project_commits_path(@project)) - if current_page?(project_tree_path(@project, @ref)) || current_page?(project_commits_path(@project, @ref))
= auto_discovery_link_tag(:atom, project_commits_url(@project, :atom, ref: @ref, private_token: current_user.private_token), title: "Recent commits to #{@project.name}:#{@ref}") = auto_discovery_link_tag(:atom, project_commits_url(@project, @ref, format: :atom, private_token: current_user.private_token), title: "Recent commits to #{@project.name}:#{@ref}")
- if request.path == project_issues_path(@project) - if request.path == project_issues_path(@project)
= auto_discovery_link_tag(:atom, project_issues_url(@project, :atom, private_token: current_user.private_token), title: "#{@project.name} issues") = auto_discovery_link_tag(:atom, project_issues_url(@project, :atom, private_token: current_user.private_token), title: "#{@project.name} issues")
= csrf_meta_tags = csrf_meta_tags
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
= link_to project_tree_path(@project, @project.root_ref) do = link_to project_tree_path(@project, @project.root_ref) do
Files Files
%li{class: commit_tab_class} %li{class: commit_tab_class}
= link_to "Commits", project_history_path(@project, @project.root_ref) = link_to "Commits", project_commits_path(@project, @project.root_ref)
%li{class: tab_class(:network)} %li{class: tab_class(:network)}
= link_to "Network", graph_project_path(@project) = link_to "Network", graph_project_path(@project)
......
...@@ -47,7 +47,7 @@ module SharedPaths ...@@ -47,7 +47,7 @@ module SharedPaths
end end
Given 'I visit project commits page' do Given 'I visit project commits page' do
visit project_commits_path(@project) visit project_commits_path(@project, @project.root_ref)
end end
Given 'I visit project source page' do Given 'I visit project source page' 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