Skip to content

Commit

Permalink
Allow to remove repository paths
Browse files Browse the repository at this point in the history
Include confirmation modal.

Co-authored-by: David Kang <dkang@suse.com>
  • Loading branch information
Ana06 and DavidKang committed Dec 6, 2018
1 parent 36880c6 commit 3c48d20
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.modal.fade{ id: "delete-path-#{path.id}", tabindex: -1, role: 'dialog', aria: { labelledby: 'delete-repository-path-label', hidden: true } }
.modal-dialog.modal-dialog-centered{ role: 'document' }
.modal-content
.modal-header
%h5.modal-title
Delete repository path?
.modal-body
%p Please confirm deletion of '#{path.link.project}/#{path.link.name}' repository path from #{repository}
= form_tag(remove_repository_path_path(project: project, repository: repository, path: path), method: :post) do
.modal-footer
%a.btn.btn-sm.btn-outline-secondary.px-4{ data: { dismiss: 'modal' } }
Cancel
= submit_tag('Delete', class: 'btn btn-sm btn-danger px-4')
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,8 @@
= link_to(move_repository_path_path(project: project, repository: repository, path: path, direction: 'down'), method: :post,
title: 'Move Down the Repository Path') do
%i.fas.fa-arrow-alt-circle-down.fa-lg.text-info
= link_to('#', title: "Delete '#{path.link.project}/#{path.link.name}' repository path",
data: { toggle: 'modal', target: "#delete-path-#{path.id}" }) do
%i.fas.fa-times-circle.fa-lg.text-danger

= render partial: 'delete_repository_path_modal', locals: { repository: repository, project: project, path: path }
2 changes: 1 addition & 1 deletion src/api/config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ def self.public_or_about_path?(request)
post 'project/save_path_element' => :save_path_element
get 'project/remove_target_request_dialog' => :remove_target_request_dialog
post 'project/remove_target_request' => :remove_target_request, as: 'project_remove_target_request'
post 'project/remove_path_from_target' => :remove_path_from_target
post 'project/remove_path_from_target' => :remove_path_from_target, as: 'remove_repository_path'
post 'project/release_repository/:project/:repository' => :release_repository, constraints: cons
get 'project/release_repository_dialog/:project/:repository' => :release_repository_dialog, constraints: cons
post 'project/move_path/:project' => :move_path, as: 'move_repository_path'
Expand Down

0 comments on commit 3c48d20

Please sign in to comment.