report user also now has sweetalert

This commit is contained in:
nilsding 2015-01-03 19:45:14 +01:00
parent d183a79493
commit 0485be8eb9
2 changed files with 11 additions and 2 deletions

View file

@ -2,7 +2,7 @@ $(document).on "click", "a[data-action=ab-report]", (ev) ->
ev.preventDefault()
swal
title: "Really report?"
text: "A moderator will review this comment and decide what happens."
text: "A moderator will review this answer and decide what happens."
type: "warning"
showCancelButton: true
confirmButtonColor: "#DD6B55"

View file

@ -50,7 +50,16 @@ $(document).on "click", "a[data-action=report-user]", (ev) ->
ev.preventDefault()
btn = $(this)
target = btn[0].dataset.target
if confirm "Are you sure you want to report #{target}?"
swal
title: "Really report #{target}?"
text: "A moderator will review this user and decide what happens."
type: "warning"
showCancelButton: true
confirmButtonColor: "#DD6B55"
confirmButtonText: "Report"
closeOnConfirm: false
, ->
$.ajax
url: '/ajax/report'
type: 'POST'