Commit 42cbc7f8 authored by Douwe Maan's avatar Douwe Maan

Tweak wording.

parent 02e8beaa
......@@ -71,7 +71,7 @@ class ProjectsController < ApplicationController
if @project.forked?
@project.forked_project_link.destroy
flash[:notice] = 'Fork relationship has been removed.'
flash[:notice] = 'The fork relationship has been removed.'
end
end
......@@ -150,6 +150,7 @@ class ProjectsController < ApplicationController
def archive
return access_denied! unless can?(current_user, :archive_project, @project)
@project.archive!
respond_to do |format|
......@@ -159,6 +160,7 @@ class ProjectsController < ApplicationController
def unarchive
return access_denied! unless can?(current_user, :archive_project, @project)
@project.unarchive!
respond_to do |format|
......
......@@ -71,7 +71,7 @@ module ProjectsHelper
end
def remove_fork_project_message(project)
"You are going to remove the fork relationship to the source project from #{@project.forked_from_project.namespace.try(:name)}. Are you ABSOLUTELY sure?"
"You are going to remove the fork relationship to source project #{@project.forked_from_project.name_with_namespace}. Are you ABSOLUTELY sure?"
end
def project_nav_tabs
......
......@@ -189,20 +189,20 @@
- else
.nothing-here-block Only the project owner can transfer a project
- if @project.forked? && can?(current_user, :remove_fork_project, @project)
- if @project.forked?
- if can?(current_user, :remove_fork_project, @project)
= form_for([@project.namespace.becomes(Namespace), @project], url: remove_fork_namespace_project_path(@project.namespace, @project), method: :delete, remote: true, html: { class: 'transfer-project form-horizontal' }) do |f|
.panel.panel-default.panel.panel-danger
.panel-heading Remove fork relationship
.panel-body
%p
This will remove the relationship to the source project from
= link_to project_path(@project.forked_from_project) do
= @project.forked_from_project.namespace.try(:name)
This will remove the fork relationship to source project
#{link_to @project.forked_from_project.name_with_namespace, project_path(@project.forked_from_project)}.
%br
%strong Once removed it cannot be reversed through this interface.
%strong Once removed, the fork relationship cannot be restored and you will no longer be able to send merge requests to the source.
= button_to 'Remove fork relationship', '#', class: "btn btn-remove js-confirm-danger", data: { "confirm-danger-message" => remove_fork_project_message(@project) }
- elsif @project.forked?
.nothing-here-block Only the project owner can remove the fork relationship
- else
.nothing-here-block Only the project owner can remove the fork relationship.
- if can?(current_user, :remove_project, @project)
.panel.panel-default.panel.panel-danger
......@@ -216,7 +216,7 @@
= button_to 'Remove project', '#', class: "btn btn-remove js-confirm-danger", data: { "confirm-danger-message" => remove_project_message(@project) }
- else
.nothing-here-block Only project owner can remove a project
.nothing-here-block Only the project owner can remove a project.
.save-project-loader.hide
......
......@@ -63,7 +63,7 @@ describe ProjectsController do
end
end
describe "PUT remove_fork" do
describe "DELETE remove_fork" do
context 'when signed in' do
before do
sign_in(user)
......@@ -82,7 +82,7 @@ describe ProjectsController do
id: project_fork.to_param, format: :js)
expect(project_fork.forked?).to be_falsey
expect(flash[:notice]).to eq('Fork relationship has been removed.')
expect(flash[:notice]).to eq('The fork relationship has been removed.')
expect(response).to render_template(:remove_fork)
end
end
......
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