mirror of
https://github.com/Retrospring/retrospring.git
synced 2025-04-02 16:39:13 +02:00
report user also now has sweetalert
This commit is contained in:
parent
d183a79493
commit
0485be8eb9
2 changed files with 11 additions and 2 deletions
app/assets/javascripts
|
@ -2,7 +2,7 @@ $(document).on "click", "a[data-action=ab-report]", (ev) ->
|
||||||
ev.preventDefault()
|
ev.preventDefault()
|
||||||
swal
|
swal
|
||||||
title: "Really report?"
|
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"
|
type: "warning"
|
||||||
showCancelButton: true
|
showCancelButton: true
|
||||||
confirmButtonColor: "#DD6B55"
|
confirmButtonColor: "#DD6B55"
|
||||||
|
|
|
@ -50,7 +50,16 @@ $(document).on "click", "a[data-action=report-user]", (ev) ->
|
||||||
ev.preventDefault()
|
ev.preventDefault()
|
||||||
btn = $(this)
|
btn = $(this)
|
||||||
target = btn[0].dataset.target
|
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
|
$.ajax
|
||||||
url: '/ajax/report'
|
url: '/ajax/report'
|
||||||
type: 'POST'
|
type: 'POST'
|
||||||
|
|
Loading…
Reference in a new issue