-
Notifications
You must be signed in to change notification settings - Fork 434
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Instead of generating html code for each modal that asks for removing a user from a group only one modal is created. Arguments for the modal are passed with "data-*" attributes. Rename the modal and the partials from "remove" to "delete", for being consistent with the naming of the previous modals and partials.
- Loading branch information
Showing
3 changed files
with
30 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
src/api/app/views/webui2/webui/groups/_delete_group_user_modal.html.haml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
.modal.fade{ id: 'delete-group-user-modal', tabindex: -1, role: 'dialog', aria: { labelledby: 'delete-modal-label', hidden: true } } | ||
.modal-dialog.modal-dialog-centered{ role: 'document' } | ||
.modal-content | ||
.modal-header | ||
%h5.modal-title | ||
Remove user | ||
= succeed '?' do | ||
= surround "'" do | ||
%span.user | ||
.modal-body | ||
%p | ||
Please confirm removing user | ||
= surround "'" do | ||
%span.user | ||
from group '#{group}'. | ||
= form_tag(nil, method: :delete) do | ||
.modal-footer | ||
%button.btn.btn-sm.btn-outline-secondary.px-4{ data: { dismiss: 'modal' } } | ||
Cancel | ||
= submit_tag('Delete', class: 'btn btn-sm btn-danger px-4') | ||
= content_for :ready_function do | ||
:plain | ||
$('#delete-group-user-modal').on('show.bs.modal', function (event) { | ||
var link = $(event.relatedTarget); | ||
$(this).find('.user').text(link.data('user')); | ||
$(this).find('form').attr('action', link.data('action')); | ||
}); |
13 changes: 0 additions & 13 deletions
13
src/api/app/views/webui2/webui/groups/_remove_user_modal.html.haml
This file was deleted.
Oops, something went wrong.