diff --git a/app/controllers/refs_controller.rb b/app/controllers/refs_controller.rb index 5e36be30..b260be0a 100644 --- a/app/controllers/refs_controller.rb +++ b/app/controllers/refs_controller.rb @@ -19,7 +19,7 @@ class RefsController < ApplicationController new_path = if params[:destination] == "tree" project_tree_path(@project, @ref) else - project_commits_path(@project, ref: @ref) + project_commits_path(@project, @ref) end redirect_to new_path diff --git a/app/decorators/event_decorator.rb b/app/decorators/event_decorator.rb index ce0aaa03..312ac651 100644 --- a/app/decorators/event_decorator.rb +++ b/app/decorators/event_decorator.rb @@ -21,7 +21,7 @@ class EventDecorator < ApplicationDecorator elsif self.merge_request? h.project_merge_request_url(self.project, self.merge_request) 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 diff --git a/app/decorators/tree_decorator.rb b/app/decorators/tree_decorator.rb index 05f029d0..97981785 100644 --- a/app/decorators/tree_decorator.rb +++ b/app/decorators/tree_decorator.rb @@ -30,7 +30,7 @@ class TreeDecorator < ApplicationDecorator end def history_path - h.project_commits_path(project, path: path, ref: ref) + h.project_commits_path(project, h.tree_join(ref, path)) end def mb_size diff --git a/app/views/commits/_commit_box.html.haml b/app/views/commits/_commit_box.html.haml index 3daf63f4..b8151b56 100644 --- a/app/views/commits/_commit_box.html.haml +++ b/app/views/commits/_commit_box.html.haml @@ -5,7 +5,7 @@ %span.btn.disabled.grouped %i.icon-comment = @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 Get Patch = link_to project_tree_path(@project, @commit), class: "browse-button primary grouped" do diff --git a/app/views/commits/_diffs.html.haml b/app/views/commits/_diffs.html.haml index 301cd554..026fe27e 100644 --- a/app/views/commits/_diffs.html.haml +++ b/app/views/commits/_diffs.html.haml @@ -5,7 +5,7 @@ %p To prevent performance issue we rejected diff information. %p 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 Showing #{pluralize(diffs.count, "changed file")} diff --git a/app/views/layouts/_head.html.haml b/app/views/layouts/_head.html.haml index 06da82d3..1674be27 100644 --- a/app/views/layouts/_head.html.haml +++ b/app/views/layouts/_head.html.haml @@ -10,8 +10,8 @@ - if controller_name == 'projects' && action_name == 'index' = auto_discovery_link_tag :atom, projects_url(:atom, private_token: current_user.private_token), title: "Dashboard feed" - if @project && !@project.new_record? - - if current_page?(project_tree_path(@project, @project.root_ref)) || current_page?(project_commits_path(@project)) - = 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}") + - if current_page?(project_tree_path(@project, @ref)) || current_page?(project_commits_path(@project, @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) = auto_discovery_link_tag(:atom, project_issues_url(@project, :atom, private_token: current_user.private_token), title: "#{@project.name} issues") = csrf_meta_tags diff --git a/app/views/layouts/_project_menu.html.haml b/app/views/layouts/_project_menu.html.haml index a46d59a3..13a4d037 100644 --- a/app/views/layouts/_project_menu.html.haml +++ b/app/views/layouts/_project_menu.html.haml @@ -8,7 +8,7 @@ = link_to project_tree_path(@project, @project.root_ref) do Files %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)} = link_to "Network", graph_project_path(@project) diff --git a/features/steps/shared/paths.rb b/features/steps/shared/paths.rb index 1839bc81..e1e1a718 100644 --- a/features/steps/shared/paths.rb +++ b/features/steps/shared/paths.rb @@ -47,7 +47,7 @@ module SharedPaths end Given 'I visit project commits page' do - visit project_commits_path(@project) + visit project_commits_path(@project, @project.root_ref) end Given 'I visit project source page' do