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

Tweak wording.

parent 02e8beaa
...@@ -71,7 +71,7 @@ class ProjectsController < ApplicationController ...@@ -71,7 +71,7 @@ class ProjectsController < ApplicationController
if @project.forked? if @project.forked?
@project.forked_project_link.destroy @project.forked_project_link.destroy
flash[:notice] = 'Fork relationship has been removed.' flash[:notice] = 'The fork relationship has been removed.'
end end
end end
...@@ -150,6 +150,7 @@ class ProjectsController < ApplicationController ...@@ -150,6 +150,7 @@ class ProjectsController < ApplicationController
def archive def archive
return access_denied! unless can?(current_user, :archive_project, @project) return access_denied! unless can?(current_user, :archive_project, @project)
@project.archive! @project.archive!
respond_to do |format| respond_to do |format|
...@@ -159,6 +160,7 @@ class ProjectsController < ApplicationController ...@@ -159,6 +160,7 @@ class ProjectsController < ApplicationController
def unarchive def unarchive
return access_denied! unless can?(current_user, :archive_project, @project) return access_denied! unless can?(current_user, :archive_project, @project)
@project.unarchive! @project.unarchive!
respond_to do |format| respond_to do |format|
......
...@@ -71,7 +71,7 @@ module ProjectsHelper ...@@ -71,7 +71,7 @@ module ProjectsHelper
end end
def remove_fork_project_message(project) 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 end
def project_nav_tabs def project_nav_tabs
......
...@@ -189,20 +189,20 @@ ...@@ -189,20 +189,20 @@
- else - else
.nothing-here-block Only the project owner can transfer a project .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| = 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.panel-default.panel.panel-danger
.panel-heading Remove fork relationship .panel-heading Remove fork relationship
.panel-body .panel-body
%p %p
This will remove the relationship to the source project from This will remove the fork relationship to source project
= link_to project_path(@project.forked_from_project) do #{link_to @project.forked_from_project.name_with_namespace, project_path(@project.forked_from_project)}.
= @project.forked_from_project.namespace.try(:name)
%br %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) } = button_to 'Remove fork relationship', '#', class: "btn btn-remove js-confirm-danger", data: { "confirm-danger-message" => remove_fork_project_message(@project) }
- elsif @project.forked? - else
.nothing-here-block Only the project owner can remove the fork relationship .nothing-here-block Only the project owner can remove the fork relationship.
- if can?(current_user, :remove_project, @project) - if can?(current_user, :remove_project, @project)
.panel.panel-default.panel.panel-danger .panel.panel-default.panel.panel-danger
...@@ -216,7 +216,7 @@ ...@@ -216,7 +216,7 @@
= button_to 'Remove project', '#', class: "btn btn-remove js-confirm-danger", data: { "confirm-danger-message" => remove_project_message(@project) } = button_to 'Remove project', '#', class: "btn btn-remove js-confirm-danger", data: { "confirm-danger-message" => remove_project_message(@project) }
- else - 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 .save-project-loader.hide
......
...@@ -63,7 +63,7 @@ describe ProjectsController do ...@@ -63,7 +63,7 @@ describe ProjectsController do
end end
end end
describe "PUT remove_fork" do describe "DELETE remove_fork" do
context 'when signed in' do context 'when signed in' do
before do before do
sign_in(user) sign_in(user)
...@@ -82,7 +82,7 @@ describe ProjectsController do ...@@ -82,7 +82,7 @@ describe ProjectsController do
id: project_fork.to_param, format: :js) id: project_fork.to_param, format: :js)
expect(project_fork.forked?).to be_falsey 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) expect(response).to render_template(:remove_fork)
end end
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