diff --git a/static/js/src/app/campaign_results.js b/static/js/src/app/campaign_results.js
index 36bb3bf6..62b28f35 100644
--- a/static/js/src/app/campaign_results.js
+++ b/static/js/src/app/campaign_results.js
@@ -777,7 +777,7 @@ function load() {
if (reported) {
return ""
}
- return ""
+ return ""
}
return reported
},
@@ -916,7 +916,35 @@ function refresh() {
setRefresh = setTimeout(refresh, 60000)
};
-
+function report_mail(rid, cid) {
+ Swal.fire({
+ title: "Are you sure?",
+ text: "This result will be flagged as reported (RID: " + rid + ")",
+ type: "question",
+ animation: false,
+ showCancelButton: true,
+ confirmButtonText: "Continue",
+ confirmButtonColor: "#428bca",
+ reverseButtons: true,
+ allowOutsideClick: false,
+ showLoaderOnConfirm: true
+ }).then(function (result) {
+ if (result.value){
+ api.campaignId.get(cid).success((function(c) {
+ report_url = c.url;
+ report_url += report_url.endsWith("/") ? "" : "/";
+ report_url += "report?rid=" + rid;
+ $.ajax({
+ url: report_url,
+ method: "GET",
+ success: function(data) {
+ refresh();
+ }
+ });
+ }));
+ }
+ })
+}
$(document).ready(function () {
Highcharts.setOptions({
@@ -928,4 +956,4 @@ $(document).ready(function () {
// Start the polling loop
setRefresh = setTimeout(refresh, 60000)
-})
\ No newline at end of file
+})