diff options
Diffstat (limited to 'app/views/projects')
-rw-r--r-- | app/views/projects/_remove_fork.html.haml | 10 | ||||
-rw-r--r-- | app/views/projects/_transfer.html.haml | 16 | ||||
-rw-r--r-- | app/views/projects/edit.html.haml | 28 |
3 files changed, 29 insertions, 25 deletions
diff --git a/app/views/projects/_remove_fork.html.haml b/app/views/projects/_remove_fork.html.haml new file mode 100644 index 00000000000..2f85376876f --- /dev/null +++ b/app/views/projects/_remove_fork.html.haml @@ -0,0 +1,10 @@ +- return unless @project.forked? && can?(current_user, :remove_fork_project, @project) + +.sub-section + %h4.danger-title= _('Remove fork relationship') + %p= remove_fork_project_description_message(@project) + + = form_for @project, url: remove_fork_project_path(@project), method: :delete, remote: true, html: { class: 'transfer-project' } do |f| + %p + %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: "gl-button btn btn-danger js-confirm-danger", data: { "confirm-danger-message" => remove_fork_project_warning_message(@project) } diff --git a/app/views/projects/_transfer.html.haml b/app/views/projects/_transfer.html.haml new file mode 100644 index 00000000000..eb7feb7bd3b --- /dev/null +++ b/app/views/projects/_transfer.html.haml @@ -0,0 +1,16 @@ +- return unless can?(current_user, :change_namespace, @project) + +.sub-section + %h4.danger-title= _('Transfer project') + = form_for @project, url: transfer_project_path(@project), method: :put, remote: true, html: { class: 'js-project-transfer-form' } do |f| + .form-group + = label_tag :new_namespace_id, nil, class: 'label-bold' do + %span= _('Select a new namespace') + .form-group + = select_tag :new_namespace_id, namespaces_options(nil), include_blank: true, class: 'select2' + %ul + %li= _("Be careful. Changing the project's namespace can have unintended side effects.") + %li= _('You can only transfer the project to namespaces you manage.') + %li= _('You will need to update your local repositories to point to the new location.') + %li= _('Project visibility level will be changed to match namespace rules when transferring to a group.') + = f.submit 'Transfer project', class: "gl-button btn btn-danger js-confirm-danger qa-transfer-button", data: { "confirm-danger-message" => transfer_project_message(@project) } diff --git a/app/views/projects/edit.html.haml b/app/views/projects/edit.html.haml index 63d571e718e..10dd80501e0 100644 --- a/app/views/projects/edit.html.haml +++ b/app/views/projects/edit.html.haml @@ -93,31 +93,9 @@ %li= _('Your deployment services will be broken, you will need to manually fix the services after renaming.') = f.submit _('Change path'), class: "btn btn-warning qa-change-path-button" - - if can?(current_user, :change_namespace, @project) - .sub-section - %h4.danger-title= _('Transfer project') - = form_for @project, url: transfer_project_path(@project), method: :put, remote: true, html: { class: 'js-project-transfer-form' } do |f| - .form-group - = label_tag :new_namespace_id, nil, class: 'label-bold' do - %span= _('Select a new namespace') - .form-group - = select_tag :new_namespace_id, namespaces_options(nil), include_blank: true, class: 'select2' - %ul - %li= _("Be careful. Changing the project's namespace can have unintended side effects.") - %li= _('You can only transfer the project to namespaces you manage.') - %li= _('You will need to update your local repositories to point to the new location.') - %li= _('Project visibility level will be changed to match namespace rules when transferring to a group.') - = f.submit 'Transfer project', class: "gl-button btn btn-danger js-confirm-danger qa-transfer-button", data: { "confirm-danger-message" => transfer_project_message(@project) } - - - if @project.forked? && can?(current_user, :remove_fork_project, @project) - .sub-section - %h4.danger-title= _('Remove fork relationship') - %p= remove_fork_project_description_message(@project) - - = form_for @project, url: remove_fork_project_path(@project), method: :delete, remote: true, html: { class: 'transfer-project' } do |f| - %p - %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: "gl-button btn btn-danger js-confirm-danger", data: { "confirm-danger-message" => remove_fork_project_warning_message(@project) } + = render 'transfer', project: @project + + = render 'remove_fork', project: @project = render 'remove', project: @project |