Commit 1048917232992671b0a01f4c87ed00edfff633e8
1 parent
99d39133
Exists in
master
and in
4 other branches
Update usages of project_commit[s] route helpers
Showing
8 changed files
with
9 additions
and
9 deletions
Show diff stats
app/controllers/refs_controller.rb
@@ -19,7 +19,7 @@ class RefsController < ApplicationController | @@ -19,7 +19,7 @@ class RefsController < ApplicationController | ||
19 | new_path = if params[:destination] == "tree" | 19 | new_path = if params[:destination] == "tree" |
20 | project_tree_path(@project, @ref) | 20 | project_tree_path(@project, @ref) |
21 | else | 21 | else |
22 | - project_commits_path(@project, ref: @ref) | 22 | + project_commits_path(@project, @ref) |
23 | end | 23 | end |
24 | 24 | ||
25 | redirect_to new_path | 25 | redirect_to new_path |
app/decorators/event_decorator.rb
@@ -21,7 +21,7 @@ class EventDecorator < ApplicationDecorator | @@ -21,7 +21,7 @@ class EventDecorator < ApplicationDecorator | ||
21 | elsif self.merge_request? | 21 | elsif self.merge_request? |
22 | h.project_merge_request_url(self.project, self.merge_request) | 22 | h.project_merge_request_url(self.project, self.merge_request) |
23 | elsif self.push? | 23 | elsif self.push? |
24 | - h.project_commits_url(self.project, ref: self.ref_name) | 24 | + h.project_commits_url(self.project, self.ref_name) |
25 | end | 25 | end |
26 | end | 26 | end |
27 | end | 27 | end |
app/decorators/tree_decorator.rb
@@ -30,7 +30,7 @@ class TreeDecorator < ApplicationDecorator | @@ -30,7 +30,7 @@ class TreeDecorator < ApplicationDecorator | ||
30 | end | 30 | end |
31 | 31 | ||
32 | def history_path | 32 | def history_path |
33 | - h.project_commits_path(project, path: path, ref: ref) | 33 | + h.project_commits_path(project, h.tree_join(ref, path)) |
34 | end | 34 | end |
35 | 35 | ||
36 | def mb_size | 36 | def mb_size |
app/views/commits/_commit_box.html.haml
@@ -5,7 +5,7 @@ | @@ -5,7 +5,7 @@ | ||
5 | %span.btn.disabled.grouped | 5 | %span.btn.disabled.grouped |
6 | %i.icon-comment | 6 | %i.icon-comment |
7 | = @notes_count | 7 | = @notes_count |
8 | - = link_to patch_project_commit_path(@project, @commit.id), class: "btn small grouped" do | 8 | + = link_to project_commit_path(@project, @commit, format: :patch), class: "btn small grouped" do |
9 | %i.icon-download-alt | 9 | %i.icon-download-alt |
10 | Get Patch | 10 | Get Patch |
11 | = link_to project_tree_path(@project, @commit), class: "browse-button primary grouped" do | 11 | = link_to project_tree_path(@project, @commit), class: "browse-button primary grouped" do |
app/views/commits/_diffs.html.haml
@@ -5,7 +5,7 @@ | @@ -5,7 +5,7 @@ | ||
5 | %p To prevent performance issue we rejected diff information. | 5 | %p To prevent performance issue we rejected diff information. |
6 | %p | 6 | %p |
7 | But if you still want to see diff | 7 | But if you still want to see diff |
8 | - = link_to "click this link", project_commit_path(@project, @commit.id, force_show_diff: true), class: "dark" | 8 | + = link_to "click this link", project_commit_path(@project, @commit, force_show_diff: true), class: "dark" |
9 | 9 | ||
10 | %p.cgray | 10 | %p.cgray |
11 | Showing #{pluralize(diffs.count, "changed file")} | 11 | Showing #{pluralize(diffs.count, "changed file")} |
app/views/layouts/_head.html.haml
@@ -10,8 +10,8 @@ | @@ -10,8 +10,8 @@ | ||
10 | - if controller_name == 'projects' && action_name == 'index' | 10 | - if controller_name == 'projects' && action_name == 'index' |
11 | = auto_discovery_link_tag :atom, projects_url(:atom, private_token: current_user.private_token), title: "Dashboard feed" | 11 | = auto_discovery_link_tag :atom, projects_url(:atom, private_token: current_user.private_token), title: "Dashboard feed" |
12 | - if @project && !@project.new_record? | 12 | - if @project && !@project.new_record? |
13 | - - if current_page?(project_tree_path(@project, @project.root_ref)) || current_page?(project_commits_path(@project)) | ||
14 | - = 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}") | 13 | + - if current_page?(project_tree_path(@project, @ref)) || current_page?(project_commits_path(@project, @ref)) |
14 | + = 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}") | ||
15 | - if request.path == project_issues_path(@project) | 15 | - if request.path == project_issues_path(@project) |
16 | = auto_discovery_link_tag(:atom, project_issues_url(@project, :atom, private_token: current_user.private_token), title: "#{@project.name} issues") | 16 | = auto_discovery_link_tag(:atom, project_issues_url(@project, :atom, private_token: current_user.private_token), title: "#{@project.name} issues") |
17 | = csrf_meta_tags | 17 | = csrf_meta_tags |
app/views/layouts/_project_menu.html.haml
@@ -8,7 +8,7 @@ | @@ -8,7 +8,7 @@ | ||
8 | = link_to project_tree_path(@project, @project.root_ref) do | 8 | = link_to project_tree_path(@project, @project.root_ref) do |
9 | Files | 9 | Files |
10 | %li{class: commit_tab_class} | 10 | %li{class: commit_tab_class} |
11 | - = link_to "Commits", project_history_path(@project, @project.root_ref) | 11 | + = link_to "Commits", project_commits_path(@project, @project.root_ref) |
12 | 12 | ||
13 | %li{class: tab_class(:network)} | 13 | %li{class: tab_class(:network)} |
14 | = link_to "Network", graph_project_path(@project) | 14 | = link_to "Network", graph_project_path(@project) |
features/steps/shared/paths.rb
@@ -47,7 +47,7 @@ module SharedPaths | @@ -47,7 +47,7 @@ module SharedPaths | ||
47 | end | 47 | end |
48 | 48 | ||
49 | Given 'I visit project commits page' do | 49 | Given 'I visit project commits page' do |
50 | - visit project_commits_path(@project) | 50 | + visit project_commits_path(@project, @project.root_ref) |
51 | end | 51 | end |
52 | 52 | ||
53 | Given 'I visit project source page' do | 53 | Given 'I visit project source page' do |