diff options
author | Han Loong Liauw <hanloongliauw@gmail.com> | 2015-10-13 13:24:44 +0300 |
---|---|---|
committer | Han Loong Liauw <hanloongliauw@gmail.com> | 2015-10-13 13:42:17 +0300 |
commit | df99ddbba13db4a7699bf1d585675f921cf382ce (patch) | |
tree | a6597628f5c46a553725a121169755f4c0f9cef2 /app/views/projects | |
parent | e12b6f30efef3f607cacc5da51f8c49c3be4643a (diff) |
Adds ability to remove the forked relationship
This was previously possible through the API but can now be done
through the project#edit settings screen if the current user is
the owner of the project.
Update changelog
Diffstat (limited to 'app/views/projects')
-rw-r--r-- | app/views/projects/edit.html.haml | 16 | ||||
-rw-r--r-- | app/views/projects/remove_fork.js.haml | 2 |
2 files changed, 18 insertions, 0 deletions
diff --git a/app/views/projects/edit.html.haml b/app/views/projects/edit.html.haml index 1882a82fba5..ce77a9242fc 100644 --- a/app/views/projects/edit.html.haml +++ b/app/views/projects/edit.html.haml @@ -189,6 +189,21 @@ - else .nothing-here-block Only the project owner can transfer a project + - if @project.forked? && can?(current_user, :remove_fork_project, @project) + = form_for([@project.namespace.becomes(Namespace), @project], url: remove_fork_namespace_project_path(@project.namespace, @project), method: :put, remote: true, html: { class: 'transfer-project form-horizontal' }) do |f| + .panel.panel-default.panel.panel-danger + .panel-heading Remove forked 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) + %br + %strong Once removed it cannot be reversed through this interface + = button_to 'Remove forked 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 + - if can?(current_user, :remove_project, @project) .panel.panel-default.panel.panel-danger .panel-heading Remove project @@ -203,6 +218,7 @@ - else .nothing-here-block Only project owner can remove a project + .save-project-loader.hide .center %h2 diff --git a/app/views/projects/remove_fork.js.haml b/app/views/projects/remove_fork.js.haml new file mode 100644 index 00000000000..17b9fecfeb1 --- /dev/null +++ b/app/views/projects/remove_fork.js.haml @@ -0,0 +1,2 @@ +:plain + location.href = "#{edit_namespace_project_path(@project.namespace, @project)}"; |