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
@pre_receive_hook.update_attributes(git_hook_params)
if @pre_receive_hook.valid?
redirect_to project_git_hooks_path(@project)
redirect_to namespace_project_git_hooks_path(@project.namespace, @project)
else
render :index
end
......
......@@ -12,12 +12,12 @@ class Projects::GroupLinksController < Projects::ApplicationController
link.group_access = params[:link_group_access]
link.save
redirect_to project_group_links_path(project)
redirect_to namespace_project_group_links_path(project.namespace, project)
end
def 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
......@@ -87,7 +87,7 @@ class JiraService < IssueTrackerService
},
project: {
name: project.path_with_namespace,
url: resource_url(project_path(project))
url: resource_url(namespace_project_path(project.namespace, project))
},
entity: {
name: noteable_name.humanize.downcase,
......@@ -193,7 +193,11 @@ class JiraService < IssueTrackerService
def build_entity_url(entity_name, entity_id)
resource_url(
polymorphic_url(
[self.project, entity_name],
[
self.project.namespace.becomes(Namespace),
self.project,
entity_name
],
id: entity_id,
routing_type: :path
)
......
......@@ -70,7 +70,7 @@
- @group.shared_projects.sort_by(&:name).each do |project|
%li
%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
= repository_size(project)
%span.pull-right.light
......
......@@ -7,7 +7,7 @@
%ul.well-list
- projects.each do |project|
%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
- if project.namespace
= project.namespace.human_name
......
......@@ -12,13 +12,13 @@
%li
.list-item-name
= 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
= repository_size(project)
.pull-right
= 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 '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?
.nothing-here-block This group has no projects yet
......
......@@ -10,7 +10,7 @@
%span
Members
= 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
%span
Groups
......@@ -25,7 +25,7 @@
%span
Web Hooks
= 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
%span
Git Hooks
......@@ -40,7 +40,7 @@
%span
Protected branches
= 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
%span
Audit Events
......@@ -5,7 +5,7 @@
%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?
.alert.alert-danger
- @pre_receive_hook.errors.full_messages.each do |msg|
......
......@@ -16,7 +16,7 @@
= group.name
%small.light up to #{group_link.human_access}
.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
disable sharing
......@@ -25,7 +25,7 @@
%h4
Can be shared with
%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
= label_tag :link_group_id, 'Group', class: 'control-label'
.col-sm-10
......
......@@ -481,9 +481,9 @@ Gitlab::Application.routes.draw do
end
end
end
get "/audit_events" => "audit_events#project_log"
get "/audit_events" => "audit_events#project_log"
end
end
get ':id' => 'namespaces#show', constraints: { id: /(?:[^.]|\.(?!atom$))+/, format: /atom/ }
......
......@@ -41,7 +41,7 @@ class Spinach::Features::ProjectGroupLinks < Spinach::FeatureSteps
end
step 'I visit project group links page' do
visit project_group_links_path(project)
visit namespace_project_group_links_path(project.namespace, project)
end
def project
......
......@@ -248,7 +248,7 @@ module SharedPaths
end
step 'I visit project git hooks page' do
visit project_git_hooks_path(@project)
visit namespace_project_git_hooks_path(@project.namespace, @project)
end
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