Commit 067a5b9d authored by Vinnie Okada's avatar Vinnie Okada

Update path helpers and routes for Rails 4.1.9

Update project path helpers and routes to reflect the new nested
resources introduced in the Rails 4.1.9 upgrade.
parent 976e18bb
...@@ -17,7 +17,7 @@ class Projects::GitHooksController < Projects::ApplicationController ...@@ -17,7 +17,7 @@ class Projects::GitHooksController < Projects::ApplicationController
@pre_receive_hook.update_attributes(git_hook_params) @pre_receive_hook.update_attributes(git_hook_params)
if @pre_receive_hook.valid? if @pre_receive_hook.valid?
redirect_to project_git_hooks_path(@project) redirect_to namespace_project_git_hooks_path(@project.namespace, @project)
else else
render :index render :index
end end
......
...@@ -12,12 +12,12 @@ class Projects::GroupLinksController < Projects::ApplicationController ...@@ -12,12 +12,12 @@ class Projects::GroupLinksController < Projects::ApplicationController
link.group_access = params[:link_group_access] link.group_access = params[:link_group_access]
link.save link.save
redirect_to project_group_links_path(project) redirect_to namespace_project_group_links_path(project.namespace, project)
end end
def destroy def destroy
project.project_group_links.find(params[:id]).destroy project.project_group_links.find(params[:id]).destroy
redirect_to project_group_links_path(project) redirect_to namespace_project_group_links_path(project.namespace, project)
end end
end end
...@@ -87,7 +87,7 @@ class JiraService < IssueTrackerService ...@@ -87,7 +87,7 @@ class JiraService < IssueTrackerService
}, },
project: { project: {
name: project.path_with_namespace, name: project.path_with_namespace,
url: resource_url(project_path(project)) url: resource_url(namespace_project_path(project.namespace, project))
}, },
entity: { entity: {
name: noteable_name.humanize.downcase, name: noteable_name.humanize.downcase,
...@@ -193,7 +193,11 @@ class JiraService < IssueTrackerService ...@@ -193,7 +193,11 @@ class JiraService < IssueTrackerService
def build_entity_url(entity_name, entity_id) def build_entity_url(entity_name, entity_id)
resource_url( resource_url(
polymorphic_url( polymorphic_url(
[self.project, entity_name], [
self.project.namespace.becomes(Namespace),
self.project,
entity_name
],
id: entity_id, id: entity_id,
routing_type: :path routing_type: :path
) )
......
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
- @group.shared_projects.sort_by(&:name).each do |project| - @group.shared_projects.sort_by(&:name).each do |project|
%li %li
%strong %strong
= link_to project.name_with_namespace, [:admin, project] = link_to project.name_with_namespace, [:admin, project.namespace.becomes(Namespace), project]
%span.label.label-gray %span.label.label-gray
= repository_size(project) = repository_size(project)
%span.pull-right.light %span.pull-right.light
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
%ul.well-list %ul.well-list
- projects.each do |project| - projects.each do |project|
%li.project-row %li.project-row
= link_to project_path(project), class: dom_class(project) do = link_to namespace_project_path(project.namespace, project), class: dom_class(project) do
%span.namespace-name %span.namespace-name
- if project.namespace - if project.namespace
= project.namespace.human_name = project.namespace.human_name
......
...@@ -12,13 +12,13 @@ ...@@ -12,13 +12,13 @@
%li %li
.list-item-name .list-item-name
= visibility_level_icon(project.visibility_level) = visibility_level_icon(project.visibility_level)
%strong= link_to project.name_with_namespace, project %strong= link_to project.name_with_namespace, namespace_project_path(project.namespace, project)
%span.label.label-gray %span.label.label-gray
= repository_size(project) = repository_size(project)
.pull-right .pull-right
= link_to 'Members', namespace_project_team_index_path(project.namespace, project), id: "edit_#{dom_id(project)}", class: "btn btn-small" = link_to 'Members', namespace_project_team_index_path(project.namespace, project), id: "edit_#{dom_id(project)}", class: "btn btn-small"
= link_to 'Edit', edit_namespace_project_path(project.namespace, project), id: "edit_#{dom_id(project)}", class: "btn btn-small" = link_to 'Edit', edit_namespace_project_path(project.namespace, project), id: "edit_#{dom_id(project)}", class: "btn btn-small"
= link_to 'Remove', project, data: { confirm: remove_project_message(project)}, method: :delete, class: "btn btn-small btn-remove" = link_to 'Remove', namespace_project_path(project.namespace, project), data: { confirm: remove_project_message(project)}, method: :delete, class: "btn btn-small btn-remove"
- if @projects.blank? - if @projects.blank?
.nothing-here-block This group has no projects yet .nothing-here-block This group has no projects yet
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
%span %span
Members Members
= nav_link(controller: :group_links) do = nav_link(controller: :group_links) do
= link_to project_group_links_path(@project) do = link_to namespace_project_group_links_path(@project.namespace, @project) do
%i.fa.fa-share-square-o %i.fa.fa-share-square-o
%span %span
Groups Groups
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
%span %span
Web Hooks Web Hooks
= nav_link(controller: :git_hooks) do = nav_link(controller: :git_hooks) do
= link_to project_git_hooks_path(@project) do = link_to namespace_project_git_hooks_path(@project.namespace, @project) do
%i.fa.fa-git-square %i.fa.fa-git-square
%span %span
Git Hooks Git Hooks
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
%span %span
Protected branches Protected branches
= nav_link(controller: :audit_events) do = nav_link(controller: :audit_events) do
= link_to project_audit_events_path(@project) do = link_to namespace_project_audit_events_path(@project.namespace, @project) do
%i.fa.fa-file-text-o %i.fa.fa-file-text-o
%span %span
Audit Events Audit Events
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
%hr.clearfix %hr.clearfix
= form_for [@project, @pre_receive_hook], html: { class: 'form-horizontal' } do |f| = form_for [@project.namespace.becomes(Namespace), @project, @pre_receive_hook], html: { class: 'form-horizontal' } do |f|
-if @pre_receive_hook.errors.any? -if @pre_receive_hook.errors.any?
.alert.alert-danger .alert.alert-danger
- @pre_receive_hook.errors.full_messages.each do |msg| - @pre_receive_hook.errors.full_messages.each do |msg|
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
= group.name = group.name
%small.light up to #{group_link.human_access} %small.light up to #{group_link.human_access}
.pull-right .pull-right
= link_to project_group_link_path(@project, group_link), method: :delete, class: 'btn btn-small append-right-10' do = link_to namespace_project_group_link_path(@project.namespace, @project, group_link), method: :delete, class: 'btn btn-small append-right-10' do
%i.icon-remove %i.icon-remove
disable sharing disable sharing
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
%h4 %h4
Can be shared with Can be shared with
%div %div
= form_tag project_group_links_path(@project), method: :post, class: 'form-horizontal' do = form_tag namespace_project_group_links_path(@project.namespace, @project), method: :post, class: 'form-horizontal' do
.form-group .form-group
= label_tag :link_group_id, 'Group', class: 'control-label' = label_tag :link_group_id, 'Group', class: 'control-label'
.col-sm-10 .col-sm-10
......
...@@ -481,9 +481,9 @@ Gitlab::Application.routes.draw do ...@@ -481,9 +481,9 @@ Gitlab::Application.routes.draw do
end end
end end
end get "/audit_events" => "audit_events#project_log"
get "/audit_events" => "audit_events#project_log" end
end end
get ':id' => 'namespaces#show', constraints: { id: /(?:[^.]|\.(?!atom$))+/, format: /atom/ } get ':id' => 'namespaces#show', constraints: { id: /(?:[^.]|\.(?!atom$))+/, format: /atom/ }
......
...@@ -41,7 +41,7 @@ class Spinach::Features::ProjectGroupLinks < Spinach::FeatureSteps ...@@ -41,7 +41,7 @@ class Spinach::Features::ProjectGroupLinks < Spinach::FeatureSteps
end end
step 'I visit project group links page' do step 'I visit project group links page' do
visit project_group_links_path(project) visit namespace_project_group_links_path(project.namespace, project)
end end
def project def project
......
...@@ -248,7 +248,7 @@ module SharedPaths ...@@ -248,7 +248,7 @@ module SharedPaths
end end
step 'I visit project git hooks page' do step 'I visit project git hooks page' do
visit project_git_hooks_path(@project) visit namespace_project_git_hooks_path(@project.namespace, @project)
end end
step 'I visit project deploy keys page' do step 'I visit project deploy keys 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