diff options
author | Douwe Maan <douwe@gitlab.com> | 2015-10-19 09:32:07 +0000 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2015-10-19 09:32:07 +0000 |
commit | 8adeda37b55fc992e3cb15422cae5d9646640630 (patch) | |
tree | 527587a80e6b1dde56b4aca1f02f89998b97c8e3 /app/views | |
parent | c9edffcba6443d2bf72cfa6dda15fd53c106657b (diff) | |
parent | 6ad78d3ab1fc0ea9f344810e22b4fa7e8d67b6f7 (diff) | |
download | gitlab-ce-8adeda37b55fc992e3cb15422cae5d9646640630.tar.gz |
Merge branch 'hanloong/gitlab-ce-remove-forks-from-projects-settings' into 'master'
Add ability to remove the fork relationship from project settings
![Screen_Shot_2015-10-18_at_12.37.24](/uploads/676571642a4c90f7f286280d714599a3/Screen_Shot_2015-10-18_at_12.37.24.png)
![Screen_Shot_2015-10-18_at_12.37.28](/uploads/1a069ecfc4cd3b5438772a9c3f04b6fc/Screen_Shot_2015-10-18_at_12.37.28.png)
Replaces !1579.
Fixes #2578.
See merge request !1636
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/projects/edit.html.haml | 18 | ||||
-rw-r--r-- | app/views/projects/remove_fork.js.haml | 2 |
2 files changed, 19 insertions, 1 deletions
diff --git a/app/views/projects/edit.html.haml b/app/views/projects/edit.html.haml index 1882a82fba5..afbf88b5507 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? + - 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 fork relationship to source project + #{link_to @project.forked_from_project.name_with_namespace, project_path(@project.forked_from_project)}. + %br + %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) } + - 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 .panel-heading Remove project @@ -201,7 +216,8 @@ = 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 .center 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)}"; |