forked from larvalabs/pullup
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(Refs Issue larvalabs#100) * User can delete their own news item and all child comments * Make delete button a mixin * Add confirmation modal to both news item and comment delete
- Loading branch information
1 parent
d10c632
commit 986c04f
Showing
6 changed files
with
80 additions
and
6 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
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
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
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,16 @@ | ||
mixin delete(owner, url) | ||
- var modalId = url.replace(/\//g, "") | ||
if user && user.username == owner.username | ||
button(type='button', data-toggle='modal', data-target='##{modalId}' class='delete btn btn-danger btn-xs pull-right', title='Delete') × | ||
div.modal.fade(id=modalId) | ||
div.modal-dialog | ||
div.modal-content | ||
div.modal-header | ||
button.close(type='button', data-dismiss='modal', aria-hidden='true') × | ||
h4.modal-title Confirm Delete | ||
div.modal-body | ||
p Are you sure you want to permanently delete this item? | ||
div.modal-footer | ||
button.btn.btn-default(type='button', data-dismiss='modal') Cancel | ||
form(action=url, method='POST', class='delete-form') | ||
button.btn.btn-danger(type='submit') Delete |
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
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